From cb12a2f95c35bbe12336af53b04c545e30cf6995 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 13 Apr 2022 23:47:47 +0300 Subject: [PATCH 1/6] PMM-5680 add log to struct AgentInfo --- api/agentlocalpb/agentlocal.pb.go | 117 ++++++++++-------- api/agentlocalpb/agentlocal.proto | 2 + api/agentlocalpb/json/agentlocalpb.json | 16 +++ .../client/agent_local/status_responses.go | 3 + api/agentpb/agent.pb.go | 15 ++- api/agentpb/collector.pb.go | 9 +- api/inventorypb/agent_status.pb.go | 7 +- api/inventorypb/agents.pb.go | 7 +- api/inventorypb/nodes.pb.go | 7 +- api/inventorypb/services.pb.go | 7 +- api/managementpb/actions.pb.go | 7 +- api/managementpb/annotation.pb.go | 7 +- api/managementpb/azure/azure.pb.go | 7 +- api/managementpb/backup/artifacts.pb.go | 7 +- api/managementpb/backup/backups.pb.go | 7 +- api/managementpb/backup/common.pb.go | 7 +- api/managementpb/backup/errors.pb.go | 7 +- api/managementpb/backup/locations.pb.go | 7 +- api/managementpb/backup/restores.pb.go | 7 +- api/managementpb/checks.pb.go | 7 +- api/managementpb/dbaas/components.pb.go | 7 +- api/managementpb/dbaas/db_clusters.pb.go | 7 +- api/managementpb/dbaas/dbaas.pb.go | 7 +- api/managementpb/dbaas/kubernetes.pb.go | 7 +- api/managementpb/dbaas/logs.pb.go | 7 +- api/managementpb/dbaas/psmdb_clusters.pb.go | 7 +- api/managementpb/dbaas/pxc_clusters.pb.go | 7 +- api/managementpb/external.pb.go | 7 +- api/managementpb/haproxy.pb.go | 7 +- api/managementpb/ia/alerts.pb.go | 9 +- api/managementpb/ia/boolean_flag.pb.go | 7 +- api/managementpb/ia/channels.pb.go | 7 +- api/managementpb/ia/params.pb.go | 7 +- api/managementpb/ia/rules.pb.go | 15 ++- api/managementpb/ia/status.pb.go | 7 +- api/managementpb/ia/templates.pb.go | 9 +- api/managementpb/metrics.pb.go | 7 +- api/managementpb/mongodb.pb.go | 7 +- api/managementpb/mysql.pb.go | 7 +- api/managementpb/node.pb.go | 9 +- api/managementpb/pagination.pb.go | 7 +- api/managementpb/postgresql.pb.go | 7 +- api/managementpb/proxysql.pb.go | 7 +- api/managementpb/rds.pb.go | 7 +- api/managementpb/service.pb.go | 11 +- api/managementpb/severity.pb.go | 7 +- api/platformpb/platform.pb.go | 7 +- api/qanpb/collector.pb.go | 9 +- api/qanpb/filters.pb.go | 7 +- api/qanpb/metrics_names.pb.go | 7 +- api/qanpb/object_details.pb.go | 7 +- api/qanpb/profile.pb.go | 7 +- api/qanpb/qan.pb.go | 7 +- api/serverpb/server.pb.go | 7 +- 54 files changed, 402 insertions(+), 116 deletions(-) diff --git a/api/agentlocalpb/agentlocal.pb.go b/api/agentlocalpb/agentlocal.pb.go index 3dd203f99f..dc9e1e6518 100644 --- a/api/agentlocalpb/agentlocal.pb.go +++ b/api/agentlocalpb/agentlocal.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: agentlocalpb/agentlocal.proto package agentlocalpb import ( + proto "github.com/golang/protobuf/proto" inventorypb "github.com/percona/pmm/api/inventorypb" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -23,6 +24,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // ServerInfo contains information about the PMM Server. type ServerInfo struct { state protoimpl.MessageState @@ -129,6 +134,8 @@ type AgentInfo struct { // 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"` + //Store logs + Logs []string `protobuf:"bytes,5,rep,name=logs,proto3" json:"logs,omitempty"` } func (x *AgentInfo) Reset() { @@ -174,14 +181,14 @@ func (x *AgentInfo) GetAgentType() inventorypb.AgentType { if x != nil { return x.AgentType } - return inventorypb.AgentType(0) + return inventorypb.AgentType_AGENT_TYPE_INVALID } func (x *AgentInfo) GetStatus() inventorypb.AgentStatus { if x != nil { return x.Status } - return inventorypb.AgentStatus(0) + return inventorypb.AgentStatus_AGENT_STATUS_INVALID } func (x *AgentInfo) GetListenPort() uint32 { @@ -191,6 +198,13 @@ func (x *AgentInfo) GetListenPort() uint32 { return 0 } +func (x *AgentInfo) GetLogs() []string { + if x != nil { + return x.Logs + } + return nil +} + type StatusRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -433,7 +447,7 @@ var file_agentlocalpb_agentlocal_proto_rawDesc = []byte{ 0x69, 0x66, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x72, 0x69, 0x66, 0x74, - 0x22, 0xac, 0x01, 0x0a, 0x09, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, + 0x22, 0xc0, 0x01, 0x0a, 0x09, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x0a, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, @@ -443,54 +457,55 @@ var file_agentlocalpb_agentlocal_proto_rawDesc = []byte{ 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x22, - 0x39, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x28, 0x0a, 0x10, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, - 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x67, 0x65, 0x74, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x91, 0x02, 0x0a, 0x0e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, - 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0f, 0x72, 0x75, 0x6e, 0x73, - 0x5f, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x72, 0x75, 0x6e, 0x73, 0x4f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, - 0x37, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x46, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x0f, - 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x32, 0xd3, 0x01, 0x0a, 0x0a, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x6c, - 0x12, 0x6a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, + 0x6f, 0x67, 0x73, 0x22, 0x39, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x67, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x91, + 0x02, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0f, + 0x72, 0x75, 0x6e, 0x73, 0x5f, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x75, 0x6e, 0x73, 0x4f, 0x6e, 0x4e, 0x6f, 0x64, + 0x65, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x0b, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x66, + 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x12, 0x23, 0x0a, + 0x0d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xd3, 0x01, 0x0a, 0x0a, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x4c, + 0x6f, 0x63, 0x61, 0x6c, 0x12, 0x6a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, + 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x22, 0x0d, 0x2f, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x01, 0x2a, 0x5a, + 0x0f, 0x12, 0x0d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x59, 0x0a, 0x06, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x22, 0x0d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x2f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x01, 0x2a, 0x5a, 0x0f, 0x12, 0x0d, 0x2f, - 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x59, 0x0a, 0x06, - 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x19, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, - 0x63, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x52, - 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2f, 0x52, 0x65, - 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x01, 0x2a, 0x42, 0x92, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x42, 0x0f, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, - 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, - 0x6f, 0x63, 0x61, 0x6c, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0xca, 0x02, 0x0a, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0xe2, 0x02, 0x16, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, - 0x63, 0x61, 0x6c, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0a, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x2f, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x01, 0x2a, 0x42, 0x92, 0x01, 0x0a, 0x0e, + 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x42, 0x0f, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, + 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, + 0xaa, 0x02, 0x0a, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0xca, 0x02, 0x0a, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0xe2, 0x02, 0x16, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x61, 0x6c, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/agentlocalpb/agentlocal.proto b/api/agentlocalpb/agentlocal.proto index aa470a2c75..5f230e11eb 100644 --- a/api/agentlocalpb/agentlocal.proto +++ b/api/agentlocalpb/agentlocal.proto @@ -33,6 +33,8 @@ message AgentInfo { // The current listen port of this Agent (exporter or vmagent). // Zero for other Agent types, or if unknown or not yet supported. uint32 listen_port = 4; + //Store logs + repeated string logs = 5; } message StatusRequest { diff --git a/api/agentlocalpb/json/agentlocalpb.json b/api/agentlocalpb/json/agentlocalpb.json index e42db2fd9d..ff001d89c7 100644 --- a/api/agentlocalpb/json/agentlocalpb.json +++ b/api/agentlocalpb/json/agentlocalpb.json @@ -152,6 +152,14 @@ "format": "int64", "x-order": 3 }, + "logs": { + "type": "array", + "title": "Store logs", + "items": { + "type": "string" + }, + "x-order": 4 + }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", @@ -339,6 +347,14 @@ "format": "int64", "x-order": 3 }, + "logs": { + "type": "array", + "title": "Store logs", + "items": { + "type": "string" + }, + "x-order": 4 + }, "status": { "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", "type": "string", diff --git a/api/agentlocalpb/json/client/agent_local/status_responses.go b/api/agentlocalpb/json/client/agent_local/status_responses.go index cd8461e901..edd023d969 100644 --- a/api/agentlocalpb/json/client/agent_local/status_responses.go +++ b/api/agentlocalpb/json/client/agent_local/status_responses.go @@ -145,6 +145,9 @@ type AgentsInfoItems0 struct { // 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"` + + // Store logs + Logs []string `json:"logs"` } // Validate validates this agents info items0 diff --git a/api/agentpb/agent.pb.go b/api/agentpb/agent.pb.go index 983ed03dc2..8759f8dd19 100644 --- a/api/agentpb/agent.pb.go +++ b/api/agentpb/agent.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: agentpb/agent.proto package agentpb import ( + proto "github.com/golang/protobuf/proto" inventorypb "github.com/percona/pmm/api/inventorypb" status "google.golang.org/genproto/googleapis/rpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // MysqlExplainOutputFormat output formats supported by MySQL Explain action. type MysqlExplainOutputFormat int32 @@ -375,7 +380,7 @@ func (x *StateChangedRequest) GetStatus() inventorypb.AgentStatus { if x != nil { return x.Status } - return inventorypb.AgentStatus(0) + return inventorypb.AgentStatus_AGENT_STATUS_INVALID } func (x *StateChangedRequest) GetListenPort() uint32 { @@ -1693,7 +1698,7 @@ func (x *CheckConnectionRequest) GetType() inventorypb.ServiceType { if x != nil { return x.Type } - return inventorypb.ServiceType(0) + return inventorypb.ServiceType_SERVICE_TYPE_INVALID } func (x *CheckConnectionRequest) GetDsn() string { @@ -3185,7 +3190,7 @@ func (x *SetStateRequest_AgentProcess) GetType() inventorypb.AgentType { if x != nil { return x.Type } - return inventorypb.AgentType(0) + return inventorypb.AgentType_AGENT_TYPE_INVALID } func (x *SetStateRequest_AgentProcess) GetTemplateLeftDelim() string { @@ -3286,7 +3291,7 @@ func (x *SetStateRequest_BuiltinAgent) GetType() inventorypb.AgentType { if x != nil { return x.Type } - return inventorypb.AgentType(0) + return inventorypb.AgentType_AGENT_TYPE_INVALID } func (x *SetStateRequest_BuiltinAgent) GetDsn() string { diff --git a/api/agentpb/collector.pb.go b/api/agentpb/collector.pb.go index c2a488bd12..71188111a6 100644 --- a/api/agentpb/collector.pb.go +++ b/api/agentpb/collector.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: agentpb/collector.proto package agentpb import ( + proto "github.com/golang/protobuf/proto" inventorypb "github.com/percona/pmm/api/inventorypb" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -21,6 +22,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // ExampleFormat is format of query example: real or query without values. // // Deprecated: is not used, should not be used, should be removed. @@ -415,7 +420,7 @@ func (x *MetricsBucket_Common) GetAgentType() inventorypb.AgentType { if x != nil { return x.AgentType } - return inventorypb.AgentType(0) + return inventorypb.AgentType_AGENT_TYPE_INVALID } func (x *MetricsBucket_Common) GetPeriodStartUnixSecs() uint32 { diff --git a/api/inventorypb/agent_status.pb.go b/api/inventorypb/agent_status.pb.go index 311ba77b3c..b285f1e6b0 100644 --- a/api/inventorypb/agent_status.pb.go +++ b/api/inventorypb/agent_status.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: inventorypb/agent_status.proto package inventorypb import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,6 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // AgentStatus represents actual Agent status. type AgentStatus int32 diff --git a/api/inventorypb/agents.pb.go b/api/inventorypb/agents.pb.go index 73c99fa0fb..426959aaa2 100644 --- a/api/inventorypb/agents.pb.go +++ b/api/inventorypb/agents.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: inventorypb/agents.proto package inventorypb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -23,6 +24,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // AgentType describes supported Agent types. type AgentType int32 diff --git a/api/inventorypb/nodes.pb.go b/api/inventorypb/nodes.pb.go index 965cc72fd9..bf22c2ca29 100644 --- a/api/inventorypb/nodes.pb.go +++ b/api/inventorypb/nodes.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: inventorypb/nodes.proto package inventorypb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -23,6 +24,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // NodeType describes supported Node types. type NodeType int32 diff --git a/api/inventorypb/services.pb.go b/api/inventorypb/services.pb.go index 70a6fbf83a..3715722c8e 100644 --- a/api/inventorypb/services.pb.go +++ b/api/inventorypb/services.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: inventorypb/services.proto package inventorypb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -23,6 +24,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // ServiceType describes supported Service types. type ServiceType int32 diff --git a/api/managementpb/actions.pb.go b/api/managementpb/actions.pb.go index af445fbab1..cde2a028b6 100644 --- a/api/managementpb/actions.pb.go +++ b/api/managementpb/actions.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/actions.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -23,6 +24,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // ActionType represents Action type. type ActionType int32 diff --git a/api/managementpb/annotation.pb.go b/api/managementpb/annotation.pb.go index db5b6b71f7..67b19d93af 100644 --- a/api/managementpb/annotation.pb.go +++ b/api/managementpb/annotation.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/annotation.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -23,6 +24,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // AddAnnotationRequest is a params to add new annotation. type AddAnnotationRequest struct { state protoimpl.MessageState diff --git a/api/managementpb/azure/azure.pb.go b/api/managementpb/azure/azure.pb.go index b2cc79d489..579951a57f 100644 --- a/api/managementpb/azure/azure.pb.go +++ b/api/managementpb/azure/azure.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/azure/azure.proto package azurev1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // DiscoverAzureDatabaseType describes supported Azure Database instance engines. type DiscoverAzureDatabaseType int32 diff --git a/api/managementpb/backup/artifacts.pb.go b/api/managementpb/backup/artifacts.pb.go index 4821adb2b1..5b4815423a 100644 --- a/api/managementpb/backup/artifacts.pb.go +++ b/api/managementpb/backup/artifacts.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/backup/artifacts.proto package backupv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // BackupStatus shows the current status of execution of backup. type BackupStatus int32 diff --git a/api/managementpb/backup/backups.pb.go b/api/managementpb/backup/backups.pb.go index d796175112..29d3c3f15c 100644 --- a/api/managementpb/backup/backups.pb.go +++ b/api/managementpb/backup/backups.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/backup/backups.proto package backupv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -27,6 +28,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type StartBackupRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/backup/common.pb.go b/api/managementpb/backup/common.pb.go index ca470a7aa9..51ce04e61c 100644 --- a/api/managementpb/backup/common.pb.go +++ b/api/managementpb/backup/common.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/backup/common.proto package backupv1beta1 import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,6 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // DataModel is a model used for performing a backup. type DataModel int32 diff --git a/api/managementpb/backup/errors.pb.go b/api/managementpb/backup/errors.pb.go index b67524d438..1dfc581c3d 100644 --- a/api/managementpb/backup/errors.pb.go +++ b/api/managementpb/backup/errors.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/backup/errors.proto package backupv1beta1 import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,6 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // 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 diff --git a/api/managementpb/backup/locations.pb.go b/api/managementpb/backup/locations.pb.go index 83d4b71479..677dadaedb 100644 --- a/api/managementpb/backup/locations.pb.go +++ b/api/managementpb/backup/locations.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/backup/locations.proto package backupv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // PMMServerLocationConfig represents file system config inside pmm-server. type PMMServerLocationConfig struct { state protoimpl.MessageState diff --git a/api/managementpb/backup/restores.pb.go b/api/managementpb/backup/restores.pb.go index fbdc87a582..4728cfe0d7 100644 --- a/api/managementpb/backup/restores.pb.go +++ b/api/managementpb/backup/restores.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/backup/restores.proto package backupv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // RestoreStatus shows the current status of execution of restore. type RestoreStatus int32 diff --git a/api/managementpb/checks.pb.go b/api/managementpb/checks.pb.go index 67d3de35e6..96c48aae8a 100644 --- a/api/managementpb/checks.pb.go +++ b/api/managementpb/checks.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/checks.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "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" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // SecurityCheckInterval represents possible execution interval values for checks. type SecurityCheckInterval int32 diff --git a/api/managementpb/dbaas/components.pb.go b/api/managementpb/dbaas/components.pb.go index 79d877d37e..d12e643c61 100644 --- a/api/managementpb/dbaas/components.pb.go +++ b/api/managementpb/dbaas/components.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/dbaas/components.proto package dbaasv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // Component contains information about component. type Component struct { state protoimpl.MessageState diff --git a/api/managementpb/dbaas/db_clusters.pb.go b/api/managementpb/dbaas/db_clusters.pb.go index 7f955613c1..cf4115782a 100644 --- a/api/managementpb/dbaas/db_clusters.pb.go +++ b/api/managementpb/dbaas/db_clusters.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/dbaas/db_clusters.proto package dbaasv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // DBClusterState represents DB cluster CR state. type DBClusterState int32 diff --git a/api/managementpb/dbaas/dbaas.pb.go b/api/managementpb/dbaas/dbaas.pb.go index 2ea42920c5..92d5754279 100644 --- a/api/managementpb/dbaas/dbaas.pb.go +++ b/api/managementpb/dbaas/dbaas.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/dbaas/dbaas.proto package dbaasv1beta1 import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,6 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // DBClusterType represents database cluster type. type DBClusterType int32 diff --git a/api/managementpb/dbaas/kubernetes.pb.go b/api/managementpb/dbaas/kubernetes.pb.go index 826622ba3c..e088ec8441 100644 --- a/api/managementpb/dbaas/kubernetes.pb.go +++ b/api/managementpb/dbaas/kubernetes.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/dbaas/kubernetes.proto package dbaasv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // KubernetesClusterStatus defines status of Kubernetes cluster. type KubernetesClusterStatus int32 diff --git a/api/managementpb/dbaas/logs.pb.go b/api/managementpb/dbaas/logs.pb.go index f4f5c7460e..d76429437a 100644 --- a/api/managementpb/dbaas/logs.pb.go +++ b/api/managementpb/dbaas/logs.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/dbaas/logs.proto package dbaasv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // Logs contain logs for certain pod's container. If container is an empty // string, logs contain pod's events. type Logs struct { diff --git a/api/managementpb/dbaas/psmdb_clusters.pb.go b/api/managementpb/dbaas/psmdb_clusters.pb.go index 519d343159..7ceb25c73f 100644 --- a/api/managementpb/dbaas/psmdb_clusters.pb.go +++ b/api/managementpb/dbaas/psmdb_clusters.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/dbaas/psmdb_clusters.proto package dbaasv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // PSMDBClusterParams represents PSMDB cluster parameters that can be updated. type PSMDBClusterParams struct { state protoimpl.MessageState diff --git a/api/managementpb/dbaas/pxc_clusters.pb.go b/api/managementpb/dbaas/pxc_clusters.pb.go index 6822f134da..efcc25bca1 100644 --- a/api/managementpb/dbaas/pxc_clusters.pb.go +++ b/api/managementpb/dbaas/pxc_clusters.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/dbaas/pxc_clusters.proto package dbaasv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // PXCBackupState represents PXC backup CR state. type PXCBackupState int32 diff --git a/api/managementpb/external.pb.go b/api/managementpb/external.pb.go index cdc921b45a..fcebd43534 100644 --- a/api/managementpb/external.pb.go +++ b/api/managementpb/external.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/external.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type AddExternalRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/haproxy.pb.go b/api/managementpb/haproxy.pb.go index de8a19d240..1b570c9c83 100644 --- a/api/managementpb/haproxy.pb.go +++ b/api/managementpb/haproxy.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/haproxy.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type AddHAProxyRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/ia/alerts.pb.go b/api/managementpb/ia/alerts.pb.go index 292fc57f2b..af6b9125e3 100644 --- a/api/managementpb/ia/alerts.pb.go +++ b/api/managementpb/ia/alerts.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/ia/alerts.proto package iav1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" managementpb "github.com/percona/pmm/api/managementpb" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // Alert represents Alert. type Alert struct { state protoimpl.MessageState @@ -98,7 +103,7 @@ func (x *Alert) GetSeverity() managementpb.Severity { if x != nil { return x.Severity } - return managementpb.Severity(0) + return managementpb.Severity_SEVERITY_INVALID } func (x *Alert) GetStatus() Status { diff --git a/api/managementpb/ia/boolean_flag.pb.go b/api/managementpb/ia/boolean_flag.pb.go index ac9a79e465..18569b2251 100644 --- a/api/managementpb/ia/boolean_flag.pb.go +++ b/api/managementpb/ia/boolean_flag.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/ia/boolean_flag.proto package iav1beta1 import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,6 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // BooleanFlag represent a command to set some boolean property to true, // to false, or avoid changing that property. type BooleanFlag int32 diff --git a/api/managementpb/ia/channels.pb.go b/api/managementpb/ia/channels.pb.go index 3eaa809a28..c635e9a7ca 100644 --- a/api/managementpb/ia/channels.pb.go +++ b/api/managementpb/ia/channels.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/ia/channels.proto package iav1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" managementpb "github.com/percona/pmm/api/managementpb" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -23,6 +24,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // BasicAuth represents basic HTTP auth configuration. type BasicAuth struct { state protoimpl.MessageState diff --git a/api/managementpb/ia/params.pb.go b/api/managementpb/ia/params.pb.go index b230996a52..90402452b0 100644 --- a/api/managementpb/ia/params.pb.go +++ b/api/managementpb/ia/params.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/ia/params.proto package iav1beta1 import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,6 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // ParamUnit represents template parameter unit. type ParamUnit int32 diff --git a/api/managementpb/ia/rules.pb.go b/api/managementpb/ia/rules.pb.go index bb36a229ae..bbb433f9c2 100644 --- a/api/managementpb/ia/rules.pb.go +++ b/api/managementpb/ia/rules.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/ia/rules.proto package iav1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" managementpb "github.com/percona/pmm/api/managementpb" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -25,6 +26,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // FilterType represents filter matching type. type FilterType int32 @@ -418,14 +423,14 @@ func (x *Rule) GetDefaultSeverity() managementpb.Severity { if x != nil { return x.DefaultSeverity } - return managementpb.Severity(0) + return managementpb.Severity_SEVERITY_INVALID } func (x *Rule) GetSeverity() managementpb.Severity { if x != nil { return x.Severity } - return managementpb.Severity(0) + return managementpb.Severity_SEVERITY_INVALID } func (x *Rule) GetCustomLabels() map[string]string { @@ -679,7 +684,7 @@ func (x *CreateAlertRuleRequest) GetSeverity() managementpb.Severity { if x != nil { return x.Severity } - return managementpb.Severity(0) + return managementpb.Severity_SEVERITY_INVALID } func (x *CreateAlertRuleRequest) GetCustomLabels() map[string]string { @@ -847,7 +852,7 @@ func (x *UpdateAlertRuleRequest) GetSeverity() managementpb.Severity { if x != nil { return x.Severity } - return managementpb.Severity(0) + return managementpb.Severity_SEVERITY_INVALID } func (x *UpdateAlertRuleRequest) GetCustomLabels() map[string]string { diff --git a/api/managementpb/ia/status.pb.go b/api/managementpb/ia/status.pb.go index f39eaebc9e..bd125868ac 100644 --- a/api/managementpb/ia/status.pb.go +++ b/api/managementpb/ia/status.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/ia/status.proto package iav1beta1 import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,6 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // Status represents Alert Rule's and Alert's combined status. type Status int32 diff --git a/api/managementpb/ia/templates.pb.go b/api/managementpb/ia/templates.pb.go index 0ebc6f2712..d8ea20b445 100644 --- a/api/managementpb/ia/templates.pb.go +++ b/api/managementpb/ia/templates.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/ia/templates.proto package iav1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" managementpb "github.com/percona/pmm/api/managementpb" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -25,6 +26,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // TemplateSource defines template source. type TemplateSource int32 @@ -522,7 +527,7 @@ func (x *Template) GetSeverity() managementpb.Severity { if x != nil { return x.Severity } - return managementpb.Severity(0) + return managementpb.Severity_SEVERITY_INVALID } func (x *Template) GetLabels() map[string]string { diff --git a/api/managementpb/metrics.pb.go b/api/managementpb/metrics.pb.go index a37039db81..05b7ce39b4 100644 --- a/api/managementpb/metrics.pb.go +++ b/api/managementpb/metrics.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/metrics.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,6 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // MetricsMode defines desired metrics mode for agent, // it can be pull, push or auto mode chosen by server. type MetricsMode int32 diff --git a/api/managementpb/mongodb.pb.go b/api/managementpb/mongodb.pb.go index f9e582916a..ea2d463d74 100644 --- a/api/managementpb/mongodb.pb.go +++ b/api/managementpb/mongodb.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/mongodb.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type AddMongoDBRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/mysql.pb.go b/api/managementpb/mysql.pb.go index 820e3859a2..ea997d7cca 100644 --- a/api/managementpb/mysql.pb.go +++ b/api/managementpb/mysql.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/mysql.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type AddMySQLRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/node.pb.go b/api/managementpb/node.pb.go index b94e634b89..55fdb4d78c 100644 --- a/api/managementpb/node.pb.go +++ b/api/managementpb/node.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/node.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type RegisterNodeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -97,7 +102,7 @@ func (x *RegisterNodeRequest) GetNodeType() inventorypb.NodeType { if x != nil { return x.NodeType } - return inventorypb.NodeType(0) + return inventorypb.NodeType_NODE_TYPE_INVALID } func (x *RegisterNodeRequest) GetNodeName() string { diff --git a/api/managementpb/pagination.pb.go b/api/managementpb/pagination.pb.go index 12f8e9a5d2..a75027df16 100644 --- a/api/managementpb/pagination.pb.go +++ b/api/managementpb/pagination.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/pagination.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -21,6 +22,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // PageParams represents page request parameters for pagination. type PageParams struct { state protoimpl.MessageState diff --git a/api/managementpb/postgresql.pb.go b/api/managementpb/postgresql.pb.go index bb31f0f9ec..7869778f4c 100644 --- a/api/managementpb/postgresql.pb.go +++ b/api/managementpb/postgresql.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/postgresql.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type AddPostgreSQLRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/proxysql.pb.go b/api/managementpb/proxysql.pb.go index 29a76c8d22..32f39ba820 100644 --- a/api/managementpb/proxysql.pb.go +++ b/api/managementpb/proxysql.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/proxysql.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type AddProxySQLRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/rds.pb.go b/api/managementpb/rds.pb.go index b18d38e49c..140a13824a 100644 --- a/api/managementpb/rds.pb.go +++ b/api/managementpb/rds.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/rds.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // DiscoverRDSEngine describes supported RDS instance engines. type DiscoverRDSEngine int32 diff --git a/api/managementpb/service.pb.go b/api/managementpb/service.pb.go index 75d4619c30..b5dc1201c2 100644 --- a/api/managementpb/service.pb.go +++ b/api/managementpb/service.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/service.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -24,6 +25,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // AddNodeParams is a params to add new node to inventory while adding new service. type AddNodeParams struct { state protoimpl.MessageState @@ -88,7 +93,7 @@ func (x *AddNodeParams) GetNodeType() inventorypb.NodeType { if x != nil { return x.NodeType } - return inventorypb.NodeType(0) + return inventorypb.NodeType_NODE_TYPE_INVALID } func (x *AddNodeParams) GetNodeName() string { @@ -204,7 +209,7 @@ func (x *RemoveServiceRequest) GetServiceType() inventorypb.ServiceType { if x != nil { return x.ServiceType } - return inventorypb.ServiceType(0) + return inventorypb.ServiceType_SERVICE_TYPE_INVALID } func (x *RemoveServiceRequest) GetServiceId() string { diff --git a/api/managementpb/severity.pb.go b/api/managementpb/severity.pb.go index 4687d856c1..754042cd0b 100644 --- a/api/managementpb/severity.pb.go +++ b/api/managementpb/severity.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: managementpb/severity.proto package managementpb import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,6 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // Severity represents severity level of the check result or alert. type Severity int32 diff --git a/api/platformpb/platform.pb.go b/api/platformpb/platform.pb.go index 507704c282..4f4306d189 100644 --- a/api/platformpb/platform.pb.go +++ b/api/platformpb/platform.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: platformpb/platform.proto package platformpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -25,6 +26,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type ConnectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/qanpb/collector.pb.go b/api/qanpb/collector.pb.go index e2d227157c..e516d3d517 100644 --- a/api/qanpb/collector.pb.go +++ b/api/qanpb/collector.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: qanpb/collector.proto package qanv1beta1 import ( + proto "github.com/golang/protobuf/proto" inventorypb "github.com/percona/pmm/api/inventorypb" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -21,6 +22,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + type CollectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -607,7 +612,7 @@ func (x *MetricsBucket) GetAgentType() inventorypb.AgentType { if x != nil { return x.AgentType } - return inventorypb.AgentType(0) + return inventorypb.AgentType_AGENT_TYPE_INVALID } func (x *MetricsBucket) GetLabels() map[string]string { diff --git a/api/qanpb/filters.pb.go b/api/qanpb/filters.pb.go index f5bdebaa33..1fcdd2959a 100644 --- a/api/qanpb/filters.pb.go +++ b/api/qanpb/filters.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: qanpb/filters.proto package qanv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // FiltersRequest contains period for which we need filters. type FiltersRequest struct { state protoimpl.MessageState diff --git a/api/qanpb/metrics_names.pb.go b/api/qanpb/metrics_names.pb.go index 4384b8d87b..34113fa7f5 100644 --- a/api/qanpb/metrics_names.pb.go +++ b/api/qanpb/metrics_names.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: qanpb/metrics_names.proto package qanv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -21,6 +22,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // MetricsNamesRequest is emty. type MetricsNamesRequest struct { state protoimpl.MessageState diff --git a/api/qanpb/object_details.pb.go b/api/qanpb/object_details.pb.go index 2e21d46259..45335ab43d 100644 --- a/api/qanpb/object_details.pb.go +++ b/api/qanpb/object_details.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: qanpb/object_details.proto package qanv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // MetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. type MetricsRequest struct { state protoimpl.MessageState diff --git a/api/qanpb/profile.pb.go b/api/qanpb/profile.pb.go index 2d0d814aa6..dae9ea54f1 100644 --- a/api/qanpb/profile.pb.go +++ b/api/qanpb/profile.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: qanpb/profile.proto package qanv1beta1 import ( + proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -22,6 +23,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // ReportRequest defines filtering of metrics report for db server or other dimentions. type ReportRequest struct { state protoimpl.MessageState diff --git a/api/qanpb/qan.pb.go b/api/qanpb/qan.pb.go index db22bc73ea..9263bef3a0 100644 --- a/api/qanpb/qan.pb.go +++ b/api/qanpb/qan.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: qanpb/qan.proto package qanv1beta1 import ( + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,6 +21,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // ExampleFormat is format of query example: real or query without values. // // Deprecated: is not used, should not be used, should be removed. diff --git a/api/serverpb/server.pb.go b/api/serverpb/server.pb.go index 189be55871..f991d8f3ae 100644 --- a/api/serverpb/server.pb.go +++ b/api/serverpb/server.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.25.0 // protoc (unknown) // source: serverpb/server.proto package serverpb import ( + proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -25,6 +26,10 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + // DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI. type DistributionMethod int32 From eade5b37aded4b39e6b1d4ba8b85583c42ccb666 Mon Sep 17 00:00:00 2001 From: Alexey Mukas Date: Wed, 13 Apr 2022 23:31:00 +0200 Subject: [PATCH 2/6] regenerate --- api/agentlocalpb/agentlocal.pb.go | 11 +++-------- api/agentpb/agent.pb.go | 15 +++++---------- api/agentpb/collector.pb.go | 9 ++------- api/inventorypb/agent_status.pb.go | 7 +------ api/inventorypb/agents.pb.go | 7 +------ api/inventorypb/nodes.pb.go | 7 +------ api/inventorypb/services.pb.go | 7 +------ api/managementpb/actions.pb.go | 7 +------ api/managementpb/annotation.pb.go | 7 +------ api/managementpb/azure/azure.pb.go | 7 +------ api/managementpb/backup/artifacts.pb.go | 7 +------ api/managementpb/backup/backups.pb.go | 7 +------ api/managementpb/backup/common.pb.go | 7 +------ api/managementpb/backup/errors.pb.go | 7 +------ api/managementpb/backup/locations.pb.go | 7 +------ api/managementpb/backup/restores.pb.go | 7 +------ api/managementpb/checks.pb.go | 7 +------ api/managementpb/dbaas/components.pb.go | 7 +------ api/managementpb/dbaas/db_clusters.pb.go | 7 +------ api/managementpb/dbaas/dbaas.pb.go | 7 +------ api/managementpb/dbaas/kubernetes.pb.go | 7 +------ api/managementpb/dbaas/logs.pb.go | 7 +------ api/managementpb/dbaas/psmdb_clusters.pb.go | 7 +------ api/managementpb/dbaas/pxc_clusters.pb.go | 7 +------ api/managementpb/external.pb.go | 7 +------ api/managementpb/haproxy.pb.go | 7 +------ api/managementpb/ia/alerts.pb.go | 9 ++------- api/managementpb/ia/boolean_flag.pb.go | 7 +------ api/managementpb/ia/channels.pb.go | 7 +------ api/managementpb/ia/params.pb.go | 7 +------ api/managementpb/ia/rules.pb.go | 15 +++++---------- api/managementpb/ia/status.pb.go | 7 +------ api/managementpb/ia/templates.pb.go | 9 ++------- api/managementpb/metrics.pb.go | 7 +------ api/managementpb/mongodb.pb.go | 7 +------ api/managementpb/mysql.pb.go | 7 +------ api/managementpb/node.pb.go | 9 ++------- api/managementpb/pagination.pb.go | 7 +------ api/managementpb/postgresql.pb.go | 7 +------ api/managementpb/proxysql.pb.go | 7 +------ api/managementpb/rds.pb.go | 7 +------ api/managementpb/service.pb.go | 11 +++-------- api/managementpb/severity.pb.go | 7 +------ api/platformpb/platform.pb.go | 7 +------ api/qanpb/collector.pb.go | 9 ++------- api/qanpb/filters.pb.go | 7 +------ api/qanpb/metrics_names.pb.go | 7 +------ api/qanpb/object_details.pb.go | 7 +------ api/qanpb/profile.pb.go | 7 +------ api/qanpb/qan.pb.go | 7 +------ api/serverpb/server.pb.go | 7 +------ 51 files changed, 68 insertions(+), 323 deletions(-) diff --git a/api/agentlocalpb/agentlocal.pb.go b/api/agentlocalpb/agentlocal.pb.go index dc9e1e6518..b1b19e7ebc 100644 --- a/api/agentlocalpb/agentlocal.pb.go +++ b/api/agentlocalpb/agentlocal.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: agentlocalpb/agentlocal.proto package agentlocalpb import ( - proto "github.com/golang/protobuf/proto" inventorypb "github.com/percona/pmm/api/inventorypb" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -24,10 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // ServerInfo contains information about the PMM Server. type ServerInfo struct { state protoimpl.MessageState @@ -181,14 +176,14 @@ func (x *AgentInfo) GetAgentType() inventorypb.AgentType { if x != nil { return x.AgentType } - return inventorypb.AgentType_AGENT_TYPE_INVALID + return inventorypb.AgentType(0) } func (x *AgentInfo) GetStatus() inventorypb.AgentStatus { if x != nil { return x.Status } - return inventorypb.AgentStatus_AGENT_STATUS_INVALID + return inventorypb.AgentStatus(0) } func (x *AgentInfo) GetListenPort() uint32 { diff --git a/api/agentpb/agent.pb.go b/api/agentpb/agent.pb.go index 8759f8dd19..983ed03dc2 100644 --- a/api/agentpb/agent.pb.go +++ b/api/agentpb/agent.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: agentpb/agent.proto package agentpb import ( - proto "github.com/golang/protobuf/proto" inventorypb "github.com/percona/pmm/api/inventorypb" status "google.golang.org/genproto/googleapis/rpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // MysqlExplainOutputFormat output formats supported by MySQL Explain action. type MysqlExplainOutputFormat int32 @@ -380,7 +375,7 @@ func (x *StateChangedRequest) GetStatus() inventorypb.AgentStatus { if x != nil { return x.Status } - return inventorypb.AgentStatus_AGENT_STATUS_INVALID + return inventorypb.AgentStatus(0) } func (x *StateChangedRequest) GetListenPort() uint32 { @@ -1698,7 +1693,7 @@ func (x *CheckConnectionRequest) GetType() inventorypb.ServiceType { if x != nil { return x.Type } - return inventorypb.ServiceType_SERVICE_TYPE_INVALID + return inventorypb.ServiceType(0) } func (x *CheckConnectionRequest) GetDsn() string { @@ -3190,7 +3185,7 @@ func (x *SetStateRequest_AgentProcess) GetType() inventorypb.AgentType { if x != nil { return x.Type } - return inventorypb.AgentType_AGENT_TYPE_INVALID + return inventorypb.AgentType(0) } func (x *SetStateRequest_AgentProcess) GetTemplateLeftDelim() string { @@ -3291,7 +3286,7 @@ func (x *SetStateRequest_BuiltinAgent) GetType() inventorypb.AgentType { if x != nil { return x.Type } - return inventorypb.AgentType_AGENT_TYPE_INVALID + return inventorypb.AgentType(0) } func (x *SetStateRequest_BuiltinAgent) GetDsn() string { diff --git a/api/agentpb/collector.pb.go b/api/agentpb/collector.pb.go index 71188111a6..c2a488bd12 100644 --- a/api/agentpb/collector.pb.go +++ b/api/agentpb/collector.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: agentpb/collector.proto package agentpb import ( - proto "github.com/golang/protobuf/proto" inventorypb "github.com/percona/pmm/api/inventorypb" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -22,10 +21,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // ExampleFormat is format of query example: real or query without values. // // Deprecated: is not used, should not be used, should be removed. @@ -420,7 +415,7 @@ func (x *MetricsBucket_Common) GetAgentType() inventorypb.AgentType { if x != nil { return x.AgentType } - return inventorypb.AgentType_AGENT_TYPE_INVALID + return inventorypb.AgentType(0) } func (x *MetricsBucket_Common) GetPeriodStartUnixSecs() uint32 { diff --git a/api/inventorypb/agent_status.pb.go b/api/inventorypb/agent_status.pb.go index b285f1e6b0..311ba77b3c 100644 --- a/api/inventorypb/agent_status.pb.go +++ b/api/inventorypb/agent_status.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: inventorypb/agent_status.proto package inventorypb import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // AgentStatus represents actual Agent status. type AgentStatus int32 diff --git a/api/inventorypb/agents.pb.go b/api/inventorypb/agents.pb.go index 426959aaa2..73c99fa0fb 100644 --- a/api/inventorypb/agents.pb.go +++ b/api/inventorypb/agents.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: inventorypb/agents.proto package inventorypb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -24,10 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // AgentType describes supported Agent types. type AgentType int32 diff --git a/api/inventorypb/nodes.pb.go b/api/inventorypb/nodes.pb.go index bf22c2ca29..965cc72fd9 100644 --- a/api/inventorypb/nodes.pb.go +++ b/api/inventorypb/nodes.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: inventorypb/nodes.proto package inventorypb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -24,10 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // NodeType describes supported Node types. type NodeType int32 diff --git a/api/inventorypb/services.pb.go b/api/inventorypb/services.pb.go index 3715722c8e..70a6fbf83a 100644 --- a/api/inventorypb/services.pb.go +++ b/api/inventorypb/services.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: inventorypb/services.proto package inventorypb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -24,10 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // ServiceType describes supported Service types. type ServiceType int32 diff --git a/api/managementpb/actions.pb.go b/api/managementpb/actions.pb.go index cde2a028b6..af445fbab1 100644 --- a/api/managementpb/actions.pb.go +++ b/api/managementpb/actions.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/actions.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -24,10 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // ActionType represents Action type. type ActionType int32 diff --git a/api/managementpb/annotation.pb.go b/api/managementpb/annotation.pb.go index 67b19d93af..db5b6b71f7 100644 --- a/api/managementpb/annotation.pb.go +++ b/api/managementpb/annotation.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/annotation.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -24,10 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // AddAnnotationRequest is a params to add new annotation. type AddAnnotationRequest struct { state protoimpl.MessageState diff --git a/api/managementpb/azure/azure.pb.go b/api/managementpb/azure/azure.pb.go index 579951a57f..b2cc79d489 100644 --- a/api/managementpb/azure/azure.pb.go +++ b/api/managementpb/azure/azure.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/azure/azure.proto package azurev1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // DiscoverAzureDatabaseType describes supported Azure Database instance engines. type DiscoverAzureDatabaseType int32 diff --git a/api/managementpb/backup/artifacts.pb.go b/api/managementpb/backup/artifacts.pb.go index 5b4815423a..4821adb2b1 100644 --- a/api/managementpb/backup/artifacts.pb.go +++ b/api/managementpb/backup/artifacts.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/backup/artifacts.proto package backupv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // BackupStatus shows the current status of execution of backup. type BackupStatus int32 diff --git a/api/managementpb/backup/backups.pb.go b/api/managementpb/backup/backups.pb.go index 29d3c3f15c..d796175112 100644 --- a/api/managementpb/backup/backups.pb.go +++ b/api/managementpb/backup/backups.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/backup/backups.proto package backupv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -28,10 +27,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type StartBackupRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/backup/common.pb.go b/api/managementpb/backup/common.pb.go index 51ce04e61c..ca470a7aa9 100644 --- a/api/managementpb/backup/common.pb.go +++ b/api/managementpb/backup/common.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/backup/common.proto package backupv1beta1 import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // DataModel is a model used for performing a backup. type DataModel int32 diff --git a/api/managementpb/backup/errors.pb.go b/api/managementpb/backup/errors.pb.go index 1dfc581c3d..b67524d438 100644 --- a/api/managementpb/backup/errors.pb.go +++ b/api/managementpb/backup/errors.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/backup/errors.proto package backupv1beta1 import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // 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 diff --git a/api/managementpb/backup/locations.pb.go b/api/managementpb/backup/locations.pb.go index 677dadaedb..83d4b71479 100644 --- a/api/managementpb/backup/locations.pb.go +++ b/api/managementpb/backup/locations.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/backup/locations.proto package backupv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // PMMServerLocationConfig represents file system config inside pmm-server. type PMMServerLocationConfig struct { state protoimpl.MessageState diff --git a/api/managementpb/backup/restores.pb.go b/api/managementpb/backup/restores.pb.go index 4728cfe0d7..fbdc87a582 100644 --- a/api/managementpb/backup/restores.pb.go +++ b/api/managementpb/backup/restores.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/backup/restores.proto package backupv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // RestoreStatus shows the current status of execution of restore. type RestoreStatus int32 diff --git a/api/managementpb/checks.pb.go b/api/managementpb/checks.pb.go index 96c48aae8a..67d3de35e6 100644 --- a/api/managementpb/checks.pb.go +++ b/api/managementpb/checks.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/checks.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "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" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // SecurityCheckInterval represents possible execution interval values for checks. type SecurityCheckInterval int32 diff --git a/api/managementpb/dbaas/components.pb.go b/api/managementpb/dbaas/components.pb.go index d12e643c61..79d877d37e 100644 --- a/api/managementpb/dbaas/components.pb.go +++ b/api/managementpb/dbaas/components.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/dbaas/components.proto package dbaasv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // Component contains information about component. type Component struct { state protoimpl.MessageState diff --git a/api/managementpb/dbaas/db_clusters.pb.go b/api/managementpb/dbaas/db_clusters.pb.go index cf4115782a..7f955613c1 100644 --- a/api/managementpb/dbaas/db_clusters.pb.go +++ b/api/managementpb/dbaas/db_clusters.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/dbaas/db_clusters.proto package dbaasv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // DBClusterState represents DB cluster CR state. type DBClusterState int32 diff --git a/api/managementpb/dbaas/dbaas.pb.go b/api/managementpb/dbaas/dbaas.pb.go index 92d5754279..2ea42920c5 100644 --- a/api/managementpb/dbaas/dbaas.pb.go +++ b/api/managementpb/dbaas/dbaas.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/dbaas/dbaas.proto package dbaasv1beta1 import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // DBClusterType represents database cluster type. type DBClusterType int32 diff --git a/api/managementpb/dbaas/kubernetes.pb.go b/api/managementpb/dbaas/kubernetes.pb.go index e088ec8441..826622ba3c 100644 --- a/api/managementpb/dbaas/kubernetes.pb.go +++ b/api/managementpb/dbaas/kubernetes.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/dbaas/kubernetes.proto package dbaasv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // KubernetesClusterStatus defines status of Kubernetes cluster. type KubernetesClusterStatus int32 diff --git a/api/managementpb/dbaas/logs.pb.go b/api/managementpb/dbaas/logs.pb.go index d76429437a..f4f5c7460e 100644 --- a/api/managementpb/dbaas/logs.pb.go +++ b/api/managementpb/dbaas/logs.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/dbaas/logs.proto package dbaasv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // Logs contain logs for certain pod's container. If container is an empty // string, logs contain pod's events. type Logs struct { diff --git a/api/managementpb/dbaas/psmdb_clusters.pb.go b/api/managementpb/dbaas/psmdb_clusters.pb.go index 7ceb25c73f..519d343159 100644 --- a/api/managementpb/dbaas/psmdb_clusters.pb.go +++ b/api/managementpb/dbaas/psmdb_clusters.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/dbaas/psmdb_clusters.proto package dbaasv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // PSMDBClusterParams represents PSMDB cluster parameters that can be updated. type PSMDBClusterParams struct { state protoimpl.MessageState diff --git a/api/managementpb/dbaas/pxc_clusters.pb.go b/api/managementpb/dbaas/pxc_clusters.pb.go index efcc25bca1..6822f134da 100644 --- a/api/managementpb/dbaas/pxc_clusters.pb.go +++ b/api/managementpb/dbaas/pxc_clusters.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/dbaas/pxc_clusters.proto package dbaasv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // PXCBackupState represents PXC backup CR state. type PXCBackupState int32 diff --git a/api/managementpb/external.pb.go b/api/managementpb/external.pb.go index fcebd43534..cdc921b45a 100644 --- a/api/managementpb/external.pb.go +++ b/api/managementpb/external.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/external.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type AddExternalRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/haproxy.pb.go b/api/managementpb/haproxy.pb.go index 1b570c9c83..de8a19d240 100644 --- a/api/managementpb/haproxy.pb.go +++ b/api/managementpb/haproxy.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/haproxy.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type AddHAProxyRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/ia/alerts.pb.go b/api/managementpb/ia/alerts.pb.go index af6b9125e3..292fc57f2b 100644 --- a/api/managementpb/ia/alerts.pb.go +++ b/api/managementpb/ia/alerts.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/ia/alerts.proto package iav1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" managementpb "github.com/percona/pmm/api/managementpb" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // Alert represents Alert. type Alert struct { state protoimpl.MessageState @@ -103,7 +98,7 @@ func (x *Alert) GetSeverity() managementpb.Severity { if x != nil { return x.Severity } - return managementpb.Severity_SEVERITY_INVALID + return managementpb.Severity(0) } func (x *Alert) GetStatus() Status { diff --git a/api/managementpb/ia/boolean_flag.pb.go b/api/managementpb/ia/boolean_flag.pb.go index 18569b2251..ac9a79e465 100644 --- a/api/managementpb/ia/boolean_flag.pb.go +++ b/api/managementpb/ia/boolean_flag.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/ia/boolean_flag.proto package iav1beta1 import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // BooleanFlag represent a command to set some boolean property to true, // to false, or avoid changing that property. type BooleanFlag int32 diff --git a/api/managementpb/ia/channels.pb.go b/api/managementpb/ia/channels.pb.go index c635e9a7ca..3eaa809a28 100644 --- a/api/managementpb/ia/channels.pb.go +++ b/api/managementpb/ia/channels.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/ia/channels.proto package iav1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" managementpb "github.com/percona/pmm/api/managementpb" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -24,10 +23,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // BasicAuth represents basic HTTP auth configuration. type BasicAuth struct { state protoimpl.MessageState diff --git a/api/managementpb/ia/params.pb.go b/api/managementpb/ia/params.pb.go index 90402452b0..b230996a52 100644 --- a/api/managementpb/ia/params.pb.go +++ b/api/managementpb/ia/params.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/ia/params.proto package iav1beta1 import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // ParamUnit represents template parameter unit. type ParamUnit int32 diff --git a/api/managementpb/ia/rules.pb.go b/api/managementpb/ia/rules.pb.go index bbb433f9c2..bb36a229ae 100644 --- a/api/managementpb/ia/rules.pb.go +++ b/api/managementpb/ia/rules.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/ia/rules.proto package iav1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" managementpb "github.com/percona/pmm/api/managementpb" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -26,10 +25,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // FilterType represents filter matching type. type FilterType int32 @@ -423,14 +418,14 @@ func (x *Rule) GetDefaultSeverity() managementpb.Severity { if x != nil { return x.DefaultSeverity } - return managementpb.Severity_SEVERITY_INVALID + return managementpb.Severity(0) } func (x *Rule) GetSeverity() managementpb.Severity { if x != nil { return x.Severity } - return managementpb.Severity_SEVERITY_INVALID + return managementpb.Severity(0) } func (x *Rule) GetCustomLabels() map[string]string { @@ -684,7 +679,7 @@ func (x *CreateAlertRuleRequest) GetSeverity() managementpb.Severity { if x != nil { return x.Severity } - return managementpb.Severity_SEVERITY_INVALID + return managementpb.Severity(0) } func (x *CreateAlertRuleRequest) GetCustomLabels() map[string]string { @@ -852,7 +847,7 @@ func (x *UpdateAlertRuleRequest) GetSeverity() managementpb.Severity { if x != nil { return x.Severity } - return managementpb.Severity_SEVERITY_INVALID + return managementpb.Severity(0) } func (x *UpdateAlertRuleRequest) GetCustomLabels() map[string]string { diff --git a/api/managementpb/ia/status.pb.go b/api/managementpb/ia/status.pb.go index bd125868ac..f39eaebc9e 100644 --- a/api/managementpb/ia/status.pb.go +++ b/api/managementpb/ia/status.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/ia/status.proto package iav1beta1 import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // Status represents Alert Rule's and Alert's combined status. type Status int32 diff --git a/api/managementpb/ia/templates.pb.go b/api/managementpb/ia/templates.pb.go index d8ea20b445..0ebc6f2712 100644 --- a/api/managementpb/ia/templates.pb.go +++ b/api/managementpb/ia/templates.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/ia/templates.proto package iav1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" managementpb "github.com/percona/pmm/api/managementpb" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -26,10 +25,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // TemplateSource defines template source. type TemplateSource int32 @@ -527,7 +522,7 @@ func (x *Template) GetSeverity() managementpb.Severity { if x != nil { return x.Severity } - return managementpb.Severity_SEVERITY_INVALID + return managementpb.Severity(0) } func (x *Template) GetLabels() map[string]string { diff --git a/api/managementpb/metrics.pb.go b/api/managementpb/metrics.pb.go index 05b7ce39b4..a37039db81 100644 --- a/api/managementpb/metrics.pb.go +++ b/api/managementpb/metrics.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/metrics.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // MetricsMode defines desired metrics mode for agent, // it can be pull, push or auto mode chosen by server. type MetricsMode int32 diff --git a/api/managementpb/mongodb.pb.go b/api/managementpb/mongodb.pb.go index ea2d463d74..f9e582916a 100644 --- a/api/managementpb/mongodb.pb.go +++ b/api/managementpb/mongodb.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/mongodb.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type AddMongoDBRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/mysql.pb.go b/api/managementpb/mysql.pb.go index ea997d7cca..820e3859a2 100644 --- a/api/managementpb/mysql.pb.go +++ b/api/managementpb/mysql.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/mysql.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type AddMySQLRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/node.pb.go b/api/managementpb/node.pb.go index 55fdb4d78c..b94e634b89 100644 --- a/api/managementpb/node.pb.go +++ b/api/managementpb/node.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/node.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type RegisterNodeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -102,7 +97,7 @@ func (x *RegisterNodeRequest) GetNodeType() inventorypb.NodeType { if x != nil { return x.NodeType } - return inventorypb.NodeType_NODE_TYPE_INVALID + return inventorypb.NodeType(0) } func (x *RegisterNodeRequest) GetNodeName() string { diff --git a/api/managementpb/pagination.pb.go b/api/managementpb/pagination.pb.go index a75027df16..12f8e9a5d2 100644 --- a/api/managementpb/pagination.pb.go +++ b/api/managementpb/pagination.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/pagination.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/mwitkow/go-proto-validators" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -22,10 +21,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // PageParams represents page request parameters for pagination. type PageParams struct { state protoimpl.MessageState diff --git a/api/managementpb/postgresql.pb.go b/api/managementpb/postgresql.pb.go index 7869778f4c..bb31f0f9ec 100644 --- a/api/managementpb/postgresql.pb.go +++ b/api/managementpb/postgresql.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/postgresql.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type AddPostgreSQLRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/proxysql.pb.go b/api/managementpb/proxysql.pb.go index 32f39ba820..29a76c8d22 100644 --- a/api/managementpb/proxysql.pb.go +++ b/api/managementpb/proxysql.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/proxysql.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type AddProxySQLRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/managementpb/rds.pb.go b/api/managementpb/rds.pb.go index 140a13824a..b18d38e49c 100644 --- a/api/managementpb/rds.pb.go +++ b/api/managementpb/rds.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/rds.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // DiscoverRDSEngine describes supported RDS instance engines. type DiscoverRDSEngine int32 diff --git a/api/managementpb/service.pb.go b/api/managementpb/service.pb.go index b5dc1201c2..75d4619c30 100644 --- a/api/managementpb/service.pb.go +++ b/api/managementpb/service.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/service.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" inventorypb "github.com/percona/pmm/api/inventorypb" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // AddNodeParams is a params to add new node to inventory while adding new service. type AddNodeParams struct { state protoimpl.MessageState @@ -93,7 +88,7 @@ func (x *AddNodeParams) GetNodeType() inventorypb.NodeType { if x != nil { return x.NodeType } - return inventorypb.NodeType_NODE_TYPE_INVALID + return inventorypb.NodeType(0) } func (x *AddNodeParams) GetNodeName() string { @@ -209,7 +204,7 @@ func (x *RemoveServiceRequest) GetServiceType() inventorypb.ServiceType { if x != nil { return x.ServiceType } - return inventorypb.ServiceType_SERVICE_TYPE_INVALID + return inventorypb.ServiceType(0) } func (x *RemoveServiceRequest) GetServiceId() string { diff --git a/api/managementpb/severity.pb.go b/api/managementpb/severity.pb.go index 754042cd0b..4687d856c1 100644 --- a/api/managementpb/severity.pb.go +++ b/api/managementpb/severity.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: managementpb/severity.proto package managementpb import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // Severity represents severity level of the check result or alert. type Severity int32 diff --git a/api/platformpb/platform.pb.go b/api/platformpb/platform.pb.go index 4f4306d189..507704c282 100644 --- a/api/platformpb/platform.pb.go +++ b/api/platformpb/platform.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: platformpb/platform.proto package platformpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -26,10 +25,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type ConnectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/qanpb/collector.pb.go b/api/qanpb/collector.pb.go index e516d3d517..e2d227157c 100644 --- a/api/qanpb/collector.pb.go +++ b/api/qanpb/collector.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: qanpb/collector.proto package qanv1beta1 import ( - proto "github.com/golang/protobuf/proto" inventorypb "github.com/percona/pmm/api/inventorypb" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -22,10 +21,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type CollectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -612,7 +607,7 @@ func (x *MetricsBucket) GetAgentType() inventorypb.AgentType { if x != nil { return x.AgentType } - return inventorypb.AgentType_AGENT_TYPE_INVALID + return inventorypb.AgentType(0) } func (x *MetricsBucket) GetLabels() map[string]string { diff --git a/api/qanpb/filters.pb.go b/api/qanpb/filters.pb.go index 1fcdd2959a..f5bdebaa33 100644 --- a/api/qanpb/filters.pb.go +++ b/api/qanpb/filters.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: qanpb/filters.proto package qanv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // FiltersRequest contains period for which we need filters. type FiltersRequest struct { state protoimpl.MessageState diff --git a/api/qanpb/metrics_names.pb.go b/api/qanpb/metrics_names.pb.go index 34113fa7f5..4384b8d87b 100644 --- a/api/qanpb/metrics_names.pb.go +++ b/api/qanpb/metrics_names.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: qanpb/metrics_names.proto package qanv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -22,10 +21,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // MetricsNamesRequest is emty. type MetricsNamesRequest struct { state protoimpl.MessageState diff --git a/api/qanpb/object_details.pb.go b/api/qanpb/object_details.pb.go index 45335ab43d..2e21d46259 100644 --- a/api/qanpb/object_details.pb.go +++ b/api/qanpb/object_details.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: qanpb/object_details.proto package qanv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // MetricsRequest defines filtering of metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. type MetricsRequest struct { state protoimpl.MessageState diff --git a/api/qanpb/profile.pb.go b/api/qanpb/profile.pb.go index dae9ea54f1..2d0d814aa6 100644 --- a/api/qanpb/profile.pb.go +++ b/api/qanpb/profile.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: qanpb/profile.proto package qanv1beta1 import ( - proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -23,10 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // ReportRequest defines filtering of metrics report for db server or other dimentions. type ReportRequest struct { state protoimpl.MessageState diff --git a/api/qanpb/qan.pb.go b/api/qanpb/qan.pb.go index 9263bef3a0..db22bc73ea 100644 --- a/api/qanpb/qan.pb.go +++ b/api/qanpb/qan.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: qanpb/qan.proto package qanv1beta1 import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,10 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // ExampleFormat is format of query example: real or query without values. // // Deprecated: is not used, should not be used, should be removed. diff --git a/api/serverpb/server.pb.go b/api/serverpb/server.pb.go index f991d8f3ae..189be55871 100644 --- a/api/serverpb/server.pb.go +++ b/api/serverpb/server.pb.go @@ -1,13 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 +// protoc-gen-go v1.27.1 // protoc (unknown) // source: serverpb/server.proto package serverpb import ( - proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -26,10 +25,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI. type DistributionMethod int32 From 8d4a9d2d014e97a7752c4039a0bae65598d3a22f Mon Sep 17 00:00:00 2001 From: Alexey Mukas Date: Wed, 13 Apr 2022 23:59:52 +0200 Subject: [PATCH 3/6] update deps task --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index dbdc7620ee..068dde168d 100644 --- a/Makefile +++ b/Makefile @@ -99,6 +99,11 @@ gen-alertmanager: # Generate Alertmanager client. go fmt ./api/alertmanager/... go install -v ./api/alertmanager/... +update-deps: + go get -u ./... # deps + go get -t -u ./... # test deps + go mod tidy + clean_swagger: find api -name '*.swagger.json' -print -delete From 9ac772f2d702d10ae563f07e9bbe385a8bcaa366 Mon Sep 17 00:00:00 2001 From: Alexey Mukas Date: Thu, 14 Apr 2022 00:30:34 +0200 Subject: [PATCH 4/6] update deps --- Makefile | 6 +- go.mod | 29 ++++---- go.sum | 200 ++++++++++++++++++++++----------------------------- tools/go.mod | 82 +++++++++++---------- tools/go.sum | 135 ++++++++++++++++++++++++++++++++++ 5 files changed, 282 insertions(+), 170 deletions(-) diff --git a/Makefile b/Makefile index 068dde168d..09cad0194a 100644 --- a/Makefile +++ b/Makefile @@ -100,8 +100,10 @@ gen-alertmanager: # Generate Alertmanager client. go install -v ./api/alertmanager/... update-deps: - go get -u ./... # deps - go get -t -u ./... # test deps + go get -u ./... + cd tools && go get -u . + go get -t -u ./... + cd tools && go get -t -u . go mod tidy clean_swagger: diff --git a/go.mod b/go.mod index bdc11145be..f03ef44159 100644 --- a/go.mod +++ b/go.mod @@ -2,27 +2,28 @@ module github.com/percona/pmm go 1.16 -replace github.com/go-openapi/spec => github.com/Percona-Lab/spec v0.19.8-percona - require ( - github.com/go-openapi/errors v0.19.6 - github.com/go-openapi/jsonreference v0.19.4 // indirect - github.com/go-openapi/runtime v0.19.20 - github.com/go-openapi/strfmt v0.19.5 - github.com/go-openapi/swag v0.19.9 - github.com/go-openapi/validate v0.19.10 + github.com/go-openapi/analysis v0.21.3 // indirect + github.com/go-openapi/errors v0.20.2 + github.com/go-openapi/runtime v0.23.3 + github.com/go-openapi/spec v0.20.5 // indirect + github.com/go-openapi/strfmt v0.21.2 + github.com/go-openapi/swag v0.21.1 + github.com/go-openapi/validate v0.21.0 + github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0 - github.com/mitchellh/mapstructure v1.3.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0 github.com/mwitkow/go-proto-validators v0.3.2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 + github.com/prometheus/common v0.33.0 // indirect github.com/stretchr/testify v1.7.1 - go.mongodb.org/mongo-driver v1.7.1 - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 - google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a + go.mongodb.org/mongo-driver v1.9.0 + golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad + google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9 google.golang.org/grpc v1.45.0 - google.golang.org/protobuf v1.27.1 + google.golang.org/protobuf v1.28.0 gopkg.in/reform.v1 v1.5.1 ) diff --git a/go.sum b/go.sum index ddb401a792..c2a86f9408 100644 --- a/go.sum +++ b/go.sum @@ -35,13 +35,8 @@ github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Percona-Lab/spec v0.19.8-percona h1:4J6hPM0Q0xuyXPBDlmI2Vw5veP/lRMZZbjFB46XoQmw= -github.com/Percona-Lab/spec v0.19.8-percona/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -50,11 +45,9 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -82,7 +75,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.9.0 h1:RSohk2RsiZqLZ0zCjtfn3S4Gp4exhpBWHyQ7D0yGjAk= github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -91,79 +83,52 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= -github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys= -github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/analysis v0.21.3 h1:CPEa+B2oYCkb+lIKB4xP6Ork8Gvh0GNg9dm/twI3+QA= +github.com/go-openapi/analysis v0.21.3/go.mod h1:2rtHDVV21tLgvJd+eXu+ExiOhfMO4+dNb7496llyke0= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.2 h1:dxy7PGTqEh94zj2E3h1cUmQQWiM1+aeCROfAr02EmK8= +github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= -github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= -github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls= -github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/runtime v0.19.20 h1:J/t+QIjbcoq8WJvjGxRKiFBhqUE8slS9SbmD0Oi/raQ= -github.com/go-openapi/runtime v0.19.20/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/loads v0.21.1 h1:Wb3nVZpdEzDTcly8S4HMkey6fjARRzb7iEaySimlDW0= +github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= +github.com/go-openapi/runtime v0.23.3 h1:/dxjx4KCOQI5ImBMz036F6v/DzZ2NUjSRvbLJs1rgoE= +github.com/go-openapi/runtime v0.23.3/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.5 h1:skHa8av4VnAtJU5zyAUXrrdK/NDiVX8lchbG+BfcdrE= +github.com/go-openapi/spec v0.20.5/go.mod h1:QbfOSIVt3/sac+a1wzmKbbcLXm5NdZnyBZYtCijp43o= +github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= +github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.2 h1:5NDNgadiX1Vhemth/TH4gCGopWSTdDjxl60H3B7f+os= +github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= -github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk= -github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/validate v0.21.0 h1:+Wqk39yKOhfpLqNLEC0/eViCkzM5FVXVqrvt526+wcI= +github.com/go-openapi/validate v0.21.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= @@ -190,8 +155,9 @@ github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/V github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.0 h1:G8O7TerXerS4F6sx9OV7/nRfJdnXgHZu/S/7F2SN+UE= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -249,7 +215,6 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -257,8 +222,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0 h1:/57CcG6YAO31FWwTVUnNl+2RcDUAaT55HtI71KQAXVw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0/go.mod h1:/fckq3NE+vGiJsd4fDt4ge1XrK8cN+e5G5QWIzdg7Q8= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0 h1:ESEyqQqXXFIcImj/BE8oKEX37Zsuceb2cZI+EL/zNCY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0/go.mod h1:XnLCLFp3tjoZJszVKjfpyAK6J8sYIcQXWQxmqLWF21I= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -267,6 +232,8 @@ github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80s github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -279,36 +246,35 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.8.0 h1:9xohqzkUwzR4Ga4ivdTcawVS89YSDVxXMa3xJX3cGzg= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -321,8 +287,10 @@ github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURS github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -344,8 +312,9 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.33.0 h1:rHgav/0a6+uYgGdNt3jwz8FNSesO/Hsang3O0T9A5SE= +github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -366,7 +335,6 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -380,18 +348,16 @@ github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.7.1 h1:jwqTeEM3x6L9xDXrCxN0Hbg7vdGfPBOTIkr0+/LYZDA= -go.mongodb.org/mongo-driver v1.7.1/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= +go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= +go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.mongodb.org/mongo-driver v1.9.0 h1:f3aLGJvQmBl8d9S40IL+jEyBC6hfLPbJjv9t5hEM9ck= +go.mongodb.org/mongo-driver v1.9.0/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -400,18 +366,15 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f h1:aZp0e2vLN4MToVqnjNEYEtrEA8RH8U8FN1CU7JgqsPU= +golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -445,12 +408,10 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -459,7 +420,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -471,14 +431,17 @@ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -486,6 +449,7 @@ golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -495,13 +459,13 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -510,10 +474,10 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -532,16 +496,20 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -572,8 +540,6 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -601,9 +567,11 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -661,8 +629,9 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a h1:uqouglH745GoGeZ1YFZbPBiu961tgi/9Qm5jaorajjQ= -google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9 h1:XGQ6tc+EnM35IAazg4y6AHmUg4oK8NXsXaILte1vRlk= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -677,7 +646,6 @@ google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -692,8 +660,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -714,8 +683,9 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/tools/go.mod b/tools/go.mod index 7c58f7c1d1..01cc190226 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -2,90 +2,94 @@ module github.com/percona/pmm/tools go 1.17 -replace github.com/go-openapi/spec => github.com/Percona-Lab/spec v0.19.8-percona - require ( github.com/BurntSushi/go-sumtype v0.0.0-20190304192233-fcb4a6205bdc github.com/Percona-Lab/swagger-order v0.0.0-20191002141859-166b3973d026 - github.com/bufbuild/buf v1.1.0 - github.com/go-openapi/runtime v0.19.28 - github.com/go-openapi/spec v0.20.3 - github.com/go-swagger/go-swagger v0.24.0 + github.com/bufbuild/buf v1.3.1 + github.com/go-openapi/runtime v0.23.3 + github.com/go-openapi/spec v0.20.5 + github.com/go-swagger/go-swagger v0.29.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/mwitkow/go-proto-validators v0.3.2 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 - google.golang.org/protobuf v1.27.1 + google.golang.org/protobuf v1.28.0 ) require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 // indirect - github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect + github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect + github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/go-openapi/analysis v0.19.10 // indirect - github.com/go-openapi/errors v0.19.6 // indirect + github.com/go-openapi/analysis v0.21.3 // indirect + github.com/go-openapi/errors v0.20.2 // indirect github.com/go-openapi/inflect v0.19.0 // indirect - github.com/go-openapi/jsonpointer v0.19.3 // indirect - github.com/go-openapi/jsonreference v0.19.3 // indirect - github.com/go-openapi/loads v0.19.5 // indirect - github.com/go-openapi/strfmt v0.19.5 // indirect - github.com/go-openapi/swag v0.19.9 // indirect - github.com/go-openapi/validate v0.19.10 // indirect - github.com/go-stack/stack v1.8.0 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-openapi/loads v0.21.1 // indirect + github.com/go-openapi/strfmt v0.21.2 // indirect + github.com/go-openapi/swag v0.21.1 // indirect + github.com/go-openapi/validate v0.21.0 // indirect + github.com/go-stack/stack v1.8.1 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gofrs/uuid v4.2.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect + github.com/golang/glog v1.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/gorilla/handlers v1.4.2 // indirect + github.com/gorilla/handlers v1.5.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/iancoleman/orderedmap v0.2.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a // indirect - github.com/jessevdk/go-flags v1.4.0 // indirect - github.com/jhump/protoreflect v1.11.1-0.20220213155251-0c2aedc66cf4 // indirect - github.com/klauspost/compress v1.14.4 // indirect + github.com/jessevdk/go-flags v1.5.0 // indirect + github.com/jhump/protocompile v0.0.0-20220216033700-d705409f108f // indirect + github.com/jhump/protoreflect v1.12.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/klauspost/compress v1.15.1 // indirect github.com/klauspost/pgzip v1.2.5 // indirect - github.com/kr/pretty v0.2.0 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/kr/text v0.2.0 // indirect - github.com/magiconair/properties v1.8.5 // indirect - github.com/mailru/easyjson v0.7.1 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/oklog/ulid v1.3.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pelletier/go-toml v1.9.4 // indirect + github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.6.0 // indirect + github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/afero v1.8.2 // indirect github.com/spf13/cast v1.4.1 // indirect - github.com/spf13/cobra v1.3.0 // indirect + github.com/spf13/cobra v1.4.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.10.0 // indirect + github.com/spf13/viper v1.11.0 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/toqueteos/webbrowser v1.2.0 // indirect - go.mongodb.org/mongo-driver v1.3.4 // indirect + go.mongodb.org/mongo-driver v1.9.0 // indirect go.opencensus.io v0.23.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect - golang.org/x/mod v0.5.1 // indirect - golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect - golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect + golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect + golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect + golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/tools v0.1.9 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/genproto v0.0.0-20220228195345-15d65a4533f7 // indirect - google.golang.org/grpc v1.45.0-dev.0.20220209221444-a354b1eec350 // indirect + golang.org/x/tools v0.1.10 // indirect + golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect + google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9 // indirect + google.golang.org/grpc v1.45.0 // indirect gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect - gopkg.in/ini.v1 v1.66.2 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/tools/go.sum b/tools/go.sum index 97261d512c..ae8106480d 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -3,6 +3,7 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -15,6 +16,7 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -46,6 +48,7 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/go-sumtype v0.0.0-20190304192233-fcb4a6205bdc h1:nvTP+jmloR0+J4YQur/rLRdLcGVEU4SquDgH+Bo7gBY= github.com/BurntSushi/go-sumtype v0.0.0-20190304192233-fcb4a6205bdc/go.mod h1:7yTWMMG2vOm4ABVciEt4EgNVP7fxwtcKIb/EuiLiKqY= @@ -69,6 +72,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -81,6 +86,9 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -91,6 +99,8 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bufbuild/buf v1.1.0 h1:35Y7ASzkrV+O5PLua9iZjsGe4knkuLUjF6a/WDKBRIw= github.com/bufbuild/buf v1.1.0/go.mod h1:tqf7PmTZsOBbecm9SVqBAhUc1pNBscVYYSqbwoc61q4= +github.com/bufbuild/buf v1.3.1 h1:AelWcENnbNEjwxmQXIZaU51GHgnWQ8Mc94kZdDUKgRs= +github.com/bufbuild/buf v1.3.1/go.mod h1:CTRUb23N+zlm1U8ZIBKz0Sqluk++qQloB2i/MZNZHIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -145,6 +155,9 @@ github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= +github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= @@ -168,12 +181,19 @@ github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9sn github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= +github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/analysis v0.21.3 h1:CPEa+B2oYCkb+lIKB4xP6Ork8Gvh0GNg9dm/twI3+QA= +github.com/go-openapi/analysis v0.21.3/go.mod h1:2rtHDVV21tLgvJd+eXu+ExiOhfMO4+dNb7496llyke0= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys= github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.2 h1:dxy7PGTqEh94zj2E3h1cUmQQWiM1+aeCROfAr02EmK8= +github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= @@ -181,11 +201,16 @@ github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwds github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= @@ -193,6 +218,8 @@ github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls= github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= +github.com/go-openapi/loads v0.21.1 h1:Wb3nVZpdEzDTcly8S4HMkey6fjARRzb7iEaySimlDW0= +github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= @@ -200,6 +227,11 @@ github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2g github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= github.com/go-openapi/runtime v0.19.28 h1:9lYu6axek8LJrVkMVViVirRcpoaCxXX7+sSvmizGVnA= github.com/go-openapi/runtime v0.19.28/go.mod h1:BvrQtn6iVb2QmiVXRsFAm6ZCAZBpbVKFfN6QWCp582M= +github.com/go-openapi/runtime v0.23.3 h1:/dxjx4KCOQI5ImBMz036F6v/DzZ2NUjSRvbLJs1rgoE= +github.com/go-openapi/runtime v0.23.3/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.5 h1:skHa8av4VnAtJU5zyAUXrrdK/NDiVX8lchbG+BfcdrE= +github.com/go-openapi/spec v0.20.5/go.mod h1:QbfOSIVt3/sac+a1wzmKbbcLXm5NdZnyBZYtCijp43o= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= @@ -208,6 +240,10 @@ github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6 github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= +github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.2 h1:5NDNgadiX1Vhemth/TH4gCGopWSTdDjxl60H3B7f+os= +github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -215,15 +251,24 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk= github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= +github.com/go-openapi/validate v0.21.0 h1:+Wqk39yKOhfpLqNLEC0/eViCkzM5FVXVqrvt526+wcI= +github.com/go-openapi/validate v0.21.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-swagger/go-swagger v0.24.0 h1:Mcf468Inw+StBNLkWUPyc9rxNRpaeuV0jNJXGT2L8so= github.com/go-swagger/go-swagger v0.24.0/go.mod h1:c9aQFJez+LeV1heNtxEclIL2XIbeS+CTKt+Bm1kuz4E= +github.com/go-swagger/go-swagger v0.29.0 h1:z3YoZtLvS1Y8TE/PCat1VypcZxM0IgKLt0NvZxQyNl8= +github.com/go-swagger/go-swagger v0.29.0/go.mod h1:Z4GJzI+bHKKkGB2Ji1rawpi3/ldXX8CkzGIa9HAC5EE= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013 h1:l9rI6sNaZgNC0LnF3MiE+qTmyBA/tZAg1rtyrGbUMK0= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.mod h1:b65mBPzqzZWxOZGxSWrqs4GInLIn+u99Q9q7p+GKni0= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= @@ -262,6 +307,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -327,6 +374,7 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -341,9 +389,12 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -399,10 +450,22 @@ github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a h1:d4+I1YEKVmWZrgkt6 github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= +github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= +github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ= +github.com/jhump/protocompile v0.0.0-20220216033700-d705409f108f h1:BNuUg9k2EiJmlMwjoef3e8vZLHplbVw6DrjGFjLL+Yo= +github.com/jhump/protocompile v0.0.0-20220216033700-d705409f108f/go.mod h1:qr2b5kx4HbFS7/g4uYO5qv9ei8303JMsC7ESbYiqr2Q= +github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= github.com/jhump/protoreflect v1.11.1-0.20220213155251-0c2aedc66cf4 h1:E2CdxLXYSn6Zrj2+u8DWrwMJW3YZLSWtM/7kIL8OL18= github.com/jhump/protoreflect v1.11.1-0.20220213155251-0c2aedc66cf4/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= +github.com/jhump/protoreflect v1.12.0 h1:1NQ4FpWMgn3by/n1X0fbeKEUxP1wBt7+Oitpv01HR10= +github.com/jhump/protoreflect v1.12.0/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -418,8 +481,11 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A= +github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -429,6 +495,8 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -438,12 +506,17 @@ github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc8 github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -471,6 +544,8 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -484,6 +559,7 @@ github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURS github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= @@ -494,11 +570,15 @@ github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwp github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.0-beta.8 h1:dy81yyLYJDwMTifq24Oi/IslOslRrDSb3jwDggjz3Z0= +github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -506,6 +586,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -533,6 +614,9 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -552,6 +636,8 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= @@ -559,6 +645,8 @@ github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0= github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= +github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= +github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -568,6 +656,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.10.0 h1:mXH0UwHS4D2HwWZa75im4xIQynLfblmWV7qcWpfv0yk= github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= +github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= +github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -578,6 +668,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= @@ -587,9 +678,13 @@ github.com/toqueteos/webbrowser v1.2.0 h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9r github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -605,6 +700,11 @@ go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.3.4 h1:zs/dKNwX0gYUtzwrN9lLiR15hCO0nDwQj5xXx+vjCdE= go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= +go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= +go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.mongodb.org/mongo-driver v1.9.0 h1:f3aLGJvQmBl8d9S40IL+jEyBC6hfLPbJjv9t5hEM9ck= +go.mongodb.org/mongo-driver v1.9.0/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -641,9 +741,13 @@ golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -682,6 +786,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -722,16 +828,21 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -813,13 +924,16 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -839,9 +953,14 @@ golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 h1:nhht2DYV/Sn3qOayu8lM+cU1ii9sTLUeBQwQQfUHtrs= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 h1:EH1Deb8WZJ0xc0WK//leUHXcX9aLE5SymusoTmMZye8= +golang.org/x/term v0.0.0-20220411215600-e5f449aeb171/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -916,6 +1035,7 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -924,11 +1044,15 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1003,7 +1127,9 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1033,6 +1159,8 @@ google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220228195345-15d65a4533f7 h1:ntPPoHzFW6Xp09ueznmahONZufyoSakK/piXnr2BU3I= google.golang.org/genproto v0.0.0-20220228195345-15d65a4533f7/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9 h1:XGQ6tc+EnM35IAazg4y6AHmUg4oK8NXsXaILte1vRlk= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1063,6 +1191,8 @@ google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ5 google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0-dev.0.20220209221444-a354b1eec350 h1:qXjElMhLX63I1nytdRlsHDThhMwFn5WldqtCY6e+oVk= google.golang.org/grpc v1.45.0-dev.0.20220209221444-a354b1eec350/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 h1:TLkBREm4nIsEcexnCjgQd5GQWaHcqMzwQV0TX9pq8S0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= @@ -1078,8 +1208,11 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1093,6 +1226,8 @@ gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= +gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= From 3ec5062d3957b16a07be5b1f94834d21136b7ccc Mon Sep 17 00:00:00 2001 From: Alexey Mukas Date: Thu, 14 Apr 2022 01:14:13 +0200 Subject: [PATCH 5/6] update deps and regenerate --- api/agentlocalpb/agentlocal.pb.go | 2 +- api/agentlocalpb/json/agentlocalpb.json | 18 +- .../client/agent_local/agent_local_client.go | 45 +- .../client/agent_local/reload_parameters.go | 45 +- .../client/agent_local/reload_responses.go | 123 +- .../client/agent_local/status2_parameters.go | 49 +- .../client/agent_local/status2_responses.go | 369 +- .../client/agent_local/status_parameters.go | 45 +- .../client/agent_local/status_responses.go | 582 +- ...lient.go => pmm_agent_local_api_client.go} | 22 +- api/agentpb/agent.pb.go | 2 +- api/agentpb/collector.pb.go | 2 +- api/inventorypb/agent_status.pb.go | 2 +- api/inventorypb/agents.pb.go | 2 +- .../add_azure_database_exporter_parameters.go | 45 +- .../add_azure_database_exporter_responses.go | 179 +- .../add_external_exporter_parameters.go | 45 +- .../agents/add_external_exporter_responses.go | 130 +- .../add_mongo_db_exporter_parameters.go | 45 +- .../agents/add_mongo_db_exporter_responses.go | 153 +- .../add_my_s_q_ld_exporter_parameters.go | 45 +- .../add_my_s_q_ld_exporter_responses.go | 143 +- .../agents/add_node_exporter_parameters.go | 45 +- .../agents/add_node_exporter_responses.go | 137 +- .../client/agents/add_pmm_agent_parameters.go | 45 +- .../client/agents/add_pmm_agent_responses.go | 130 +- .../add_postgres_exporter_parameters.go | 45 +- .../agents/add_postgres_exporter_responses.go | 137 +- .../add_proxy_sql_exporter_parameters.go | 45 +- .../add_proxy_sql_exporter_responses.go | 137 +- ..._qan_mongo_db_profiler_agent_parameters.go | 45 +- ...d_qan_mongo_db_profiler_agent_responses.go | 131 +- ...qan_my_sql_perf_schema_agent_parameters.go | 45 +- ..._qan_my_sql_perf_schema_agent_responses.go | 131 +- ...add_qan_my_sql_slowlog_agent_parameters.go | 45 +- .../add_qan_my_sql_slowlog_agent_responses.go | 131 +- ...re_sql_pg_stat_monitor_agent_parameters.go | 45 +- ...gre_sql_pg_stat_monitor_agent_responses.go | 131 +- ...tgre_sql_pg_statements_agent_parameters.go | 45 +- ...stgre_sql_pg_statements_agent_responses.go | 131 +- .../agents/add_rds_exporter_parameters.go | 45 +- .../agents/add_rds_exporter_responses.go | 153 +- .../json/client/agents/agents_client.go | 423 +- ...ange_azure_database_exporter_parameters.go | 45 +- ...hange_azure_database_exporter_responses.go | 176 +- .../change_external_exporter_parameters.go | 45 +- .../change_external_exporter_responses.go | 163 +- .../change_mongo_db_exporter_parameters.go | 45 +- .../change_mongo_db_exporter_responses.go | 186 +- .../change_my_s_q_ld_exporter_parameters.go | 45 +- .../change_my_s_q_ld_exporter_responses.go | 176 +- .../agents/change_node_exporter_parameters.go | 45 +- .../agents/change_node_exporter_responses.go | 170 +- .../change_postgres_exporter_parameters.go | 45 +- .../change_postgres_exporter_responses.go | 170 +- .../change_proxy_sql_exporter_parameters.go | 45 +- .../change_proxy_sql_exporter_responses.go | 170 +- ..._qan_mongo_db_profiler_agent_parameters.go | 45 +- ...e_qan_mongo_db_profiler_agent_responses.go | 164 +- ...qan_my_sql_perf_schema_agent_parameters.go | 45 +- ..._qan_my_sql_perf_schema_agent_responses.go | 164 +- ...nge_qan_my_sql_slowlog_agent_parameters.go | 45 +- ...ange_qan_my_sql_slowlog_agent_responses.go | 164 +- ...re_sql_pg_stat_monitor_agent_parameters.go | 45 +- ...gre_sql_pg_stat_monitor_agent_responses.go | 164 +- ...tgre_sql_pg_statements_agent_parameters.go | 45 +- ...stgre_sql_pg_statements_agent_responses.go | 164 +- .../agents/change_rds_exporter_parameters.go | 45 +- .../agents/change_rds_exporter_responses.go | 186 +- .../client/agents/get_agent_parameters.go | 45 +- .../json/client/agents/get_agent_responses.go | 621 +- .../client/agents/list_agents_parameters.go | 45 +- .../client/agents/list_agents_responses.go | 1904 +- .../client/agents/remove_agent_parameters.go | 45 +- .../client/agents/remove_agent_responses.go | 92 +- .../nodes/add_container_node_parameters.go | 45 +- .../nodes/add_container_node_responses.go | 166 +- .../nodes/add_generic_node_parameters.go | 45 +- .../nodes/add_generic_node_responses.go | 130 +- ...d_remote_azure_database_node_parameters.go | 45 +- ...dd_remote_azure_database_node_responses.go | 130 +- .../nodes/add_remote_node_parameters.go | 45 +- .../client/nodes/add_remote_node_responses.go | 130 +- .../nodes/add_remote_rds_node_parameters.go | 45 +- .../nodes/add_remote_rds_node_responses.go | 130 +- .../json/client/nodes/get_node_parameters.go | 45 +- .../json/client/nodes/get_node_responses.go | 242 +- .../client/nodes/list_nodes_parameters.go | 45 +- .../json/client/nodes/list_nodes_responses.go | 551 +- .../json/client/nodes/nodes_client.go | 115 +- .../client/nodes/remove_node_parameters.go | 45 +- .../client/nodes/remove_node_responses.go | 92 +- ..._client.go => pmm_inventory_api_client.go} | 22 +- .../add_external_service_parameters.go | 45 +- .../add_external_service_responses.go | 166 +- .../add_ha_proxy_service_parameters.go | 45 +- .../add_ha_proxy_service_responses.go | 130 +- .../add_mongo_db_service_parameters.go | 45 +- .../add_mongo_db_service_responses.go | 130 +- .../services/add_my_sql_service_parameters.go | 45 +- .../services/add_my_sql_service_responses.go | 130 +- .../add_postgre_sql_service_parameters.go | 45 +- .../add_postgre_sql_service_responses.go | 130 +- .../add_proxy_sql_service_parameters.go | 45 +- .../add_proxy_sql_service_responses.go | 130 +- .../client/services/get_service_parameters.go | 45 +- .../client/services/get_service_responses.go | 270 +- .../services/list_services_parameters.go | 45 +- .../services/list_services_responses.go | 583 +- .../services/remove_service_parameters.go | 45 +- .../services/remove_service_responses.go | 92 +- .../json/client/services/services_client.go | 129 +- api/inventorypb/json/inventorypb.json | 390 +- api/inventorypb/nodes.pb.go | 2 +- api/inventorypb/services.pb.go | 2 +- api/managementpb/actions.pb.go | 2 +- api/managementpb/annotation.pb.go | 2 +- api/managementpb/azure/azure.pb.go | 2 +- .../add_azure_database_parameters.go | 45 +- .../add_azure_database_responses.go | 73 +- .../azure_database/azure_database_client.go | 31 +- .../discover_azure_database_parameters.go | 45 +- .../discover_azure_database_responses.go | 373 +- ..._s_client.go => pmm_d_baa_s_api_client.go} | 22 +- api/managementpb/backup/artifacts.pb.go | 2 +- api/managementpb/backup/backups.pb.go | 2 +- api/managementpb/backup/common.pb.go | 2 +- api/managementpb/backup/errors.pb.go | 2 +- api/managementpb/backup/json/backup.json | 60 +- .../json/client/artifacts/artifacts_client.go | 31 +- .../artifacts/delete_artifact_parameters.go | 45 +- .../artifacts/delete_artifact_responses.go | 72 +- .../artifacts/list_artifacts_parameters.go | 45 +- .../artifacts/list_artifacts_responses.go | 569 +- .../json/client/backups/backups_client.go | 115 +- .../change_scheduled_backup_parameters.go | 45 +- .../change_scheduled_backup_responses.go | 73 +- .../client/backups/get_logs_parameters.go | 45 +- .../json/client/backups/get_logs_responses.go | 152 +- ...artifact_compatible_services_parameters.go | 45 +- ..._artifact_compatible_services_responses.go | 202 +- .../list_scheduled_backups_parameters.go | 45 +- .../list_scheduled_backups_responses.go | 264 +- .../remove_scheduled_backup_parameters.go | 45 +- .../remove_scheduled_backup_responses.go | 92 +- .../backups/restore_backup_parameters.go | 45 +- .../backups/restore_backup_responses.go | 97 +- .../backups/schedule_backup_parameters.go | 45 +- .../backups/schedule_backup_responses.go | 99 +- .../client/backups/start_backup_parameters.go | 45 +- .../client/backups/start_backup_responses.go | 97 +- .../locations/add_location_parameters.go | 45 +- .../locations/add_location_responses.go | 222 +- .../locations/change_location_parameters.go | 45 +- .../locations/change_location_responses.go | 181 +- .../locations/list_locations_parameters.go | 45 +- .../locations/list_locations_responses.go | 296 +- .../json/client/locations/locations_client.go | 73 +- .../locations/remove_location_parameters.go | 45 +- .../locations/remove_location_responses.go | 92 +- .../test_location_config_parameters.go | 45 +- .../test_location_config_responses.go | 181 +- ...go => pmm_backup_management_api_client.go} | 22 +- .../list_restore_history_parameters.go | 45 +- .../list_restore_history_responses.go | 515 +- .../restore_history/restore_history_client.go | 17 +- api/managementpb/backup/locations.pb.go | 2 +- api/managementpb/backup/restores.pb.go | 2 +- api/managementpb/checks.pb.go | 2 +- api/managementpb/dbaas/components.pb.go | 2 +- api/managementpb/dbaas/db_clusters.pb.go | 2 +- api/managementpb/dbaas/dbaas.pb.go | 2 +- .../change_psmdb_components_parameters.go | 45 +- .../change_psmdb_components_responses.go | 198 +- .../change_pxc_components_parameters.go | 45 +- .../change_pxc_components_responses.go | 292 +- .../check_for_operator_update_parameters.go | 45 +- .../check_for_operator_update_responses.go | 200 +- .../client/components/components_client.go | 87 +- .../get_psmdb_components_parameters.go | 45 +- .../get_psmdb_components_responses.go | 610 +- .../get_pxc_components_parameters.go | 45 +- .../get_pxc_components_responses.go | 1103 +- .../components/install_operator_parameters.go | 45 +- .../components/install_operator_responses.go | 98 +- .../client/db_clusters/db_clusters_client.go | 45 +- .../delete_db_cluster_parameters.go | 45 +- .../delete_db_cluster_responses.go | 73 +- .../list_db_clusters_parameters.go | 45 +- .../db_clusters/list_db_clusters_responses.go | 984 +- .../restart_db_cluster_parameters.go | 45 +- .../restart_db_cluster_responses.go | 93 +- .../get_kubernetes_cluster_parameters.go | 45 +- .../get_kubernetes_cluster_responses.go | 166 +- .../kubernetes/get_resources_parameters.go | 45 +- .../kubernetes/get_resources_responses.go | 158 +- .../client/kubernetes/kubernetes_client.go | 73 +- .../list_kubernetes_clusters_parameters.go | 45 +- .../list_kubernetes_clusters_responses.go | 670 +- .../register_kubernetes_cluster_parameters.go | 45 +- .../register_kubernetes_cluster_responses.go | 125 +- ...nregister_kubernetes_cluster_parameters.go | 45 +- ...unregister_kubernetes_cluster_responses.go | 92 +- .../client/logs_api/get_logs_parameters.go | 45 +- .../client/logs_api/get_logs_responses.go | 188 +- .../json/client/logs_api/logs_api_client.go | 17 +- ..._s_client.go => pmm_d_baa_s_api_client.go} | 22 +- .../create_psmdb_cluster_parameters.go | 45 +- .../create_psmdb_cluster_responses.go | 227 +- ...et_psmdb_cluster_credentials_parameters.go | 45 +- ...get_psmdb_cluster_credentials_responses.go | 130 +- .../get_psmdb_cluster_resources_parameters.go | 45 +- .../get_psmdb_cluster_resources_responses.go | 229 +- .../psmdb_clusters/psmdb_clusters_client.go | 59 +- .../update_psmdb_cluster_parameters.go | 45 +- .../update_psmdb_cluster_responses.go | 191 +- .../create_pxc_cluster_parameters.go | 45 +- .../create_pxc_cluster_responses.go | 349 +- .../get_pxc_cluster_credentials_parameters.go | 45 +- .../get_pxc_cluster_credentials_responses.go | 130 +- .../get_pxc_cluster_resources_parameters.go | 45 +- .../get_pxc_cluster_resources_responses.go | 351 +- .../pxc_clusters/pxc_clusters_client.go | 59 +- .../update_pxc_cluster_parameters.go | 45 +- .../update_pxc_cluster_responses.go | 313 +- api/managementpb/dbaas/json/dbaas.json | 201 +- api/managementpb/dbaas/kubernetes.pb.go | 2 +- api/managementpb/dbaas/logs.pb.go | 2 +- api/managementpb/dbaas/psmdb_clusters.pb.go | 2 +- api/managementpb/dbaas/pxc_clusters.pb.go | 2 +- api/managementpb/external.pb.go | 2 +- api/managementpb/haproxy.pb.go | 2 +- api/managementpb/ia/alerts.pb.go | 2 +- api/managementpb/ia/boolean_flag.pb.go | 2 +- api/managementpb/ia/channels.pb.go | 2 +- .../ia/json/client/alerts/alerts_client.go | 31 +- .../client/alerts/list_alerts_parameters.go | 45 +- .../client/alerts/list_alerts_responses.go | 2157 +- .../client/alerts/toggle_alerts_parameters.go | 45 +- .../client/alerts/toggle_alerts_responses.go | 93 +- .../client/channels/add_channel_parameters.go | 45 +- .../client/channels/add_channel_responses.go | 344 +- .../channels/change_channel_parameters.go | 45 +- .../channels/change_channel_responses.go | 303 +- .../json/client/channels/channels_client.go | 59 +- .../channels/list_channels_parameters.go | 45 +- .../channels/list_channels_responses.go | 1122 +- .../channels/remove_channel_parameters.go | 45 +- .../channels/remove_channel_responses.go | 92 +- ... => pmm_integrated_alerting_api_client.go} | 22 +- .../rules/create_alert_rule_parameters.go | 45 +- .../rules/create_alert_rule_responses.go | 307 +- .../rules/delete_alert_rule_parameters.go | 45 +- .../rules/delete_alert_rule_responses.go | 92 +- .../rules/list_alert_rules_parameters.go | 45 +- .../rules/list_alert_rules_responses.go | 1426 +- .../ia/json/client/rules/rules_client.go | 73 +- .../rules/toggle_alert_rule_parameters.go | 45 +- .../rules/toggle_alert_rule_responses.go | 93 +- .../rules/update_alert_rule_parameters.go | 45 +- .../rules/update_alert_rule_responses.go | 388 +- .../templates/create_template_parameters.go | 45 +- .../templates/create_template_responses.go | 72 +- .../templates/delete_template_parameters.go | 45 +- .../templates/delete_template_responses.go | 92 +- .../templates/list_templates_parameters.go | 45 +- .../templates/list_templates_responses.go | 779 +- .../json/client/templates/templates_client.go | 59 +- .../templates/update_template_parameters.go | 45 +- .../templates/update_template_responses.go | 92 +- api/managementpb/ia/json/ia.json | 246 +- api/managementpb/ia/params.pb.go | 2 +- api/managementpb/ia/rules.pb.go | 2 +- api/managementpb/ia/status.pb.go | 2 +- api/managementpb/ia/templates.pb.go | 2 +- .../json/client/actions/actions_client.go | 213 +- .../actions/cancel_action_parameters.go | 45 +- .../client/actions/cancel_action_responses.go | 72 +- .../client/actions/get_action_parameters.go | 45 +- .../client/actions/get_action_responses.go | 97 +- ...tart_mongo_db_explain_action_parameters.go | 45 +- ...start_mongo_db_explain_action_responses.go | 97 +- .../start_my_sql_explain_action_parameters.go | 45 +- .../start_my_sql_explain_action_responses.go | 97 +- ...t_my_sql_explain_json_action_parameters.go | 45 +- ...rt_my_sql_explain_json_action_responses.go | 97 +- ...lain_traditional_json_action_parameters.go | 45 +- ...plain_traditional_json_action_responses.go | 97 +- ...sql_show_create_table_action_parameters.go | 45 +- ..._sql_show_create_table_action_responses.go | 97 +- ...art_my_sql_show_index_action_parameters.go | 45 +- ...tart_my_sql_show_index_action_responses.go | 97 +- ...sql_show_table_status_action_parameters.go | 45 +- ..._sql_show_table_status_action_responses.go | 97 +- ...sql_show_create_table_action_parameters.go | 45 +- ..._sql_show_create_table_action_responses.go | 97 +- ...ostgre_sql_show_index_action_parameters.go | 45 +- ...postgre_sql_show_index_action_responses.go | 97 +- ...t_pt_mongo_db_summary_action_parameters.go | 45 +- ...rt_pt_mongo_db_summary_action_responses.go | 97 +- ...art_pt_my_sql_summary_action_parameters.go | 45 +- ...tart_pt_my_sql_summary_action_responses.go | 97 +- .../start_pt_pg_summary_action_parameters.go | 45 +- .../start_pt_pg_summary_action_responses.go | 97 +- .../start_pt_summary_action_parameters.go | 45 +- .../start_pt_summary_action_responses.go | 97 +- .../annotation/add_annotation_parameters.go | 45 +- .../annotation/add_annotation_responses.go | 72 +- .../client/annotation/annotation_client.go | 17 +- .../external/add_external_parameters.go | 45 +- .../client/external/add_external_responses.go | 257 +- .../json/client/external/external_client.go | 17 +- .../ha_proxy/add_ha_proxy_parameters.go | 45 +- .../client/ha_proxy/add_ha_proxy_responses.go | 257 +- .../json/client/ha_proxy/ha_proxy_client.go | 17 +- .../mongo_db/add_mongo_db_parameters.go | 45 +- .../client/mongo_db/add_mongo_db_responses.go | 309 +- .../json/client/mongo_db/mongo_db_client.go | 17 +- .../client/my_sql/add_my_sql_parameters.go | 45 +- .../client/my_sql/add_my_sql_responses.go | 328 +- .../json/client/my_sql/my_sql_client.go | 17 +- .../json/client/node/node_client.go | 17 +- .../client/node/register_node_parameters.go | 45 +- .../client/node/register_node_responses.go | 314 +- ...client.go => pmm_management_api_client.go} | 22 +- .../postgre_sql/add_postgre_sql_parameters.go | 45 +- .../postgre_sql/add_postgre_sql_responses.go | 322 +- .../client/postgre_sql/postgre_sql_client.go | 17 +- .../proxy_sql/add_proxy_sql_parameters.go | 45 +- .../proxy_sql/add_proxy_sql_responses.go | 264 +- .../json/client/proxy_sql/proxy_sql_client.go | 17 +- .../json/client/rds/add_rds_parameters.go | 45 +- .../json/client/rds/add_rds_responses.go | 427 +- .../client/rds/discover_rds_parameters.go | 45 +- .../json/client/rds/discover_rds_responses.go | 181 +- .../json/client/rds/rds_client.go | 31 +- .../change_security_checks_parameters.go | 45 +- .../change_security_checks_responses.go | 154 +- .../get_failed_checks_parameters.go | 45 +- .../get_failed_checks_responses.go | 338 +- .../get_security_check_results_parameters.go | 45 +- .../get_security_check_results_responses.go | 253 +- .../list_failed_services_parameters.go | 45 +- .../list_failed_services_responses.go | 147 +- .../list_security_checks_parameters.go | 45 +- .../list_security_checks_responses.go | 328 +- .../security_checks/security_checks_client.go | 101 +- .../start_security_checks_parameters.go | 45 +- .../start_security_checks_responses.go | 92 +- .../toggle_check_alert_parameters.go | 45 +- .../toggle_check_alert_responses.go | 92 +- .../service/remove_service_parameters.go | 45 +- .../service/remove_service_responses.go | 137 +- .../json/client/service/service_client.go | 17 +- api/managementpb/json/managementpb.json | 216 +- api/managementpb/metrics.pb.go | 2 +- api/managementpb/mongodb.pb.go | 2 +- api/managementpb/mysql.pb.go | 2 +- api/managementpb/node.pb.go | 2 +- api/managementpb/pagination.pb.go | 2 +- api/managementpb/postgresql.pb.go | 2 +- api/managementpb/proxysql.pb.go | 2 +- api/managementpb/rds.pb.go | 2 +- api/managementpb/service.pb.go | 2 +- api/managementpb/severity.pb.go | 2 +- .../client/platform/connect_parameters.go | 131 - .../json/client/platform/connect_responses.go | 268 - .../client/platform/disconnect_parameters.go | 133 - .../client/platform/disconnect_responses.go | 191 - .../json/client/platform/platform_client.go | 256 - ...ch_organization_entitlements_parameters.go | 133 - ...rch_organization_entitlements_responses.go | 422 - .../search_organization_tickets_parameters.go | 133 - .../search_organization_tickets_responses.go | 339 - .../client/platform/server_info_parameters.go | 133 - .../client/platform/server_info_responses.go | 228 - .../client/platform/user_status_parameters.go | 133 - .../client/platform/user_status_responses.go | 225 - .../json/client/pmm_platform_client.go | 112 - api/platformpb/json/platformpb.json | 602 - api/platformpb/platform.pb.go | 2 +- api/qanpb/collector.pb.go | 2 +- api/qanpb/filters.pb.go | 2 +- .../json/client/filters/filters_client.go | 69 - .../json/client/filters/get_parameters.go | 131 - .../json/client/filters/get_responses.go | 544 - .../get_metrics_names_parameters.go | 133 - .../get_metrics_names_responses.go | 263 - .../metrics_names/metrics_names_client.go | 69 - .../get_histogram_parameters.go | 131 - .../object_details/get_histogram_responses.go | 477 - .../object_details/get_labels_parameters.go | 131 - .../object_details/get_labels_responses.go | 372 - .../object_details/get_metrics_parameters.go | 131 - .../object_details/get_metrics_responses.go | 775 - .../get_query_example_parameters.go | 131 - .../get_query_example_responses.go | 550 - .../get_query_plan_parameters.go | 131 - .../get_query_plan_responses.go | 260 - .../object_details/object_details_client.go | 209 - api/qanpb/json/client/pmm_qan_client.go | 127 - .../client/profile/get_report_parameters.go | 131 - .../client/profile/get_report_responses.go | 922 - .../json/client/profile/profile_client.go | 69 - api/qanpb/json/qanpb.json | 9 +- api/qanpb/metrics_names.pb.go | 2 +- api/qanpb/object_details.pb.go | 2 +- api/qanpb/profile.pb.go | 2 +- api/qanpb/qan.pb.go | 2 +- ...ver_client.go => pmm_server_api_client.go} | 28 +- .../server/aws_instance_check_parameters.go | 45 +- .../server/aws_instance_check_responses.go | 72 +- .../server/change_settings_parameters.go | 45 +- .../server/change_settings_responses.go | 364 +- .../client/server/check_updates_parameters.go | 45 +- .../client/server/check_updates_responses.go | 161 +- .../client/server/get_settings_parameters.go | 45 +- .../client/server/get_settings_responses.go | 242 +- .../json/client/server/logs_parameters.go | 42 +- .../json/client/server/logs_responses.go | 13 +- .../client/server/readiness_parameters.go | 42 +- .../json/client/server/readiness_responses.go | 87 +- .../json/client/server/server_client.go | 143 +- .../client/server/start_update_parameters.go | 45 +- .../client/server/start_update_responses.go | 92 +- ...test_email_alerting_settings_parameters.go | 45 +- .../test_email_alerting_settings_responses.go | 125 +- .../client/server/update_status_parameters.go | 45 +- .../client/server/update_status_responses.go | 97 +- .../json/client/server/version_parameters.go | 49 +- .../json/client/server/version_responses.go | 156 +- api/serverpb/json/serverpb.json | 60 +- api/serverpb/server.pb.go | 2 +- api/swagger/swagger-dev-only.json | 11913 ------ api/swagger/swagger-dev.json | 31381 ---------------- api/swagger/swagger.json | 19505 ---------- 436 files changed, 35729 insertions(+), 83015 deletions(-) rename api/agentlocalpb/json/client/{pmm_agent_local_client.go => pmm_agent_local_api_client.go} (83%) rename api/inventorypb/json/client/{pmm_inventory_client.go => pmm_inventory_api_client.go} (85%) rename api/managementpb/azure/json/client/{pmm_d_baa_s_client.go => pmm_d_baa_s_api_client.go} (85%) rename api/managementpb/backup/json/client/{pmm_backup_management_client.go => pmm_backup_management_api_client.go} (86%) rename api/managementpb/dbaas/json/client/{pmm_d_baa_s_client.go => pmm_d_baa_s_api_client.go} (88%) rename api/managementpb/ia/json/client/{pmm_integrated_alerting_client.go => pmm_integrated_alerting_api_client.go} (86%) rename api/managementpb/json/client/{pmm_management_client.go => pmm_management_api_client.go} (89%) delete mode 100644 api/platformpb/json/client/platform/connect_parameters.go delete mode 100644 api/platformpb/json/client/platform/connect_responses.go delete mode 100644 api/platformpb/json/client/platform/disconnect_parameters.go delete mode 100644 api/platformpb/json/client/platform/disconnect_responses.go delete mode 100644 api/platformpb/json/client/platform/platform_client.go delete mode 100644 api/platformpb/json/client/platform/search_organization_entitlements_parameters.go delete mode 100644 api/platformpb/json/client/platform/search_organization_entitlements_responses.go delete mode 100644 api/platformpb/json/client/platform/search_organization_tickets_parameters.go delete mode 100644 api/platformpb/json/client/platform/search_organization_tickets_responses.go delete mode 100644 api/platformpb/json/client/platform/server_info_parameters.go delete mode 100644 api/platformpb/json/client/platform/server_info_responses.go delete mode 100644 api/platformpb/json/client/platform/user_status_parameters.go delete mode 100644 api/platformpb/json/client/platform/user_status_responses.go delete mode 100644 api/platformpb/json/client/pmm_platform_client.go delete mode 100644 api/platformpb/json/platformpb.json delete mode 100644 api/qanpb/json/client/filters/filters_client.go delete mode 100644 api/qanpb/json/client/filters/get_parameters.go delete mode 100644 api/qanpb/json/client/filters/get_responses.go delete mode 100644 api/qanpb/json/client/metrics_names/get_metrics_names_parameters.go delete mode 100644 api/qanpb/json/client/metrics_names/get_metrics_names_responses.go delete mode 100644 api/qanpb/json/client/metrics_names/metrics_names_client.go delete mode 100644 api/qanpb/json/client/object_details/get_histogram_parameters.go delete mode 100644 api/qanpb/json/client/object_details/get_histogram_responses.go delete mode 100644 api/qanpb/json/client/object_details/get_labels_parameters.go delete mode 100644 api/qanpb/json/client/object_details/get_labels_responses.go delete mode 100644 api/qanpb/json/client/object_details/get_metrics_parameters.go delete mode 100644 api/qanpb/json/client/object_details/get_metrics_responses.go delete mode 100644 api/qanpb/json/client/object_details/get_query_example_parameters.go delete mode 100644 api/qanpb/json/client/object_details/get_query_example_responses.go delete mode 100644 api/qanpb/json/client/object_details/get_query_plan_parameters.go delete mode 100644 api/qanpb/json/client/object_details/get_query_plan_responses.go delete mode 100644 api/qanpb/json/client/object_details/object_details_client.go delete mode 100644 api/qanpb/json/client/pmm_qan_client.go delete mode 100644 api/qanpb/json/client/profile/get_report_parameters.go delete mode 100644 api/qanpb/json/client/profile/get_report_responses.go delete mode 100644 api/qanpb/json/client/profile/profile_client.go rename api/serverpb/json/client/{pmm_server_client.go => pmm_server_api_client.go} (80%) delete mode 100644 api/swagger/swagger-dev-only.json delete mode 100644 api/swagger/swagger-dev.json delete mode 100644 api/swagger/swagger.json diff --git a/api/agentlocalpb/agentlocal.pb.go b/api/agentlocalpb/agentlocal.pb.go index b1b19e7ebc..a8d9e11c68 100644 --- a/api/agentlocalpb/agentlocal.pb.go +++ b/api/agentlocalpb/agentlocal.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: agentlocalpb/agentlocal.proto diff --git a/api/agentlocalpb/json/agentlocalpb.json b/api/agentlocalpb/json/agentlocalpb.json index ff001d89c7..179344e902 100644 --- a/api/agentlocalpb/json/agentlocalpb.json +++ b/api/agentlocalpb/json/agentlocalpb.json @@ -143,8 +143,7 @@ "RDS_EXPORTER", "EXTERNAL_EXPORTER", "AZURE_DATABASE_EXPORTER" - ], - "x-order": 1 + ] }, "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.", @@ -172,8 +171,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 2 + ] } } }, @@ -222,8 +220,7 @@ "type": "string", "x-order": 3 } - }, - "x-order": 2 + } } } } @@ -338,8 +335,7 @@ "RDS_EXPORTER", "EXTERNAL_EXPORTER", "AZURE_DATABASE_EXPORTER" - ], - "x-order": 1 + ] }, "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.", @@ -367,8 +363,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 2 + ] } } }, @@ -417,8 +412,7 @@ "type": "string", "x-order": 3 } - }, - "x-order": 2 + } } } } diff --git a/api/agentlocalpb/json/client/agent_local/agent_local_client.go b/api/agentlocalpb/json/client/agent_local/agent_local_client.go index 28a9c0b932..0cc7d74b16 100644 --- a/api/agentlocalpb/json/client/agent_local/agent_local_client.go +++ b/api/agentlocalpb/json/client/agent_local/agent_local_client.go @@ -23,13 +23,16 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - Reload(params *ReloadParams) (*ReloadOK, error) + Reload(params *ReloadParams, opts ...ClientOption) (*ReloadOK, error) - Status(params *StatusParams) (*StatusOK, error) + Status(params *StatusParams, opts ...ClientOption) (*StatusOK, error) - Status2(params *Status2Params) (*Status2OK, error) + Status2(params *Status2Params, opts ...ClientOption) (*Status2OK, error) SetTransport(transport runtime.ClientTransport) } @@ -37,13 +40,12 @@ type ClientService interface { /* Reload reloads reloads pmm agent configuration */ -func (a *Client) Reload(params *ReloadParams) (*ReloadOK, error) { +func (a *Client) Reload(params *ReloadParams, opts ...ClientOption) (*ReloadOK, error) { // TODO: Validate the params before sending if params == nil { params = NewReloadParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "Reload", Method: "POST", PathPattern: "/local/Reload", @@ -54,7 +56,12 @@ func (a *Client) Reload(params *ReloadParams) (*ReloadOK, error) { 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 } @@ -70,13 +77,12 @@ func (a *Client) Reload(params *ReloadParams) (*ReloadOK, error) { /* Status statuses returns current pmm agent status */ -func (a *Client) Status(params *StatusParams) (*StatusOK, error) { +func (a *Client) Status(params *StatusParams, opts ...ClientOption) (*StatusOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStatusParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "Status", Method: "POST", PathPattern: "/local/Status", @@ -87,7 +93,12 @@ func (a *Client) Status(params *StatusParams) (*StatusOK, error) { 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 } @@ -103,13 +114,12 @@ func (a *Client) Status(params *StatusParams) (*StatusOK, error) { /* Status2 statuses returns current pmm agent status */ -func (a *Client) Status2(params *Status2Params) (*Status2OK, error) { +func (a *Client) Status2(params *Status2Params, opts ...ClientOption) (*Status2OK, error) { // TODO: Validate the params before sending if params == nil { params = NewStatus2Params() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "Status2", Method: "GET", PathPattern: "/local/Status", @@ -120,7 +130,12 @@ func (a *Client) Status2(params *Status2Params) (*Status2OK, error) { 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 } diff --git a/api/agentlocalpb/json/client/agent_local/reload_parameters.go b/api/agentlocalpb/json/client/agent_local/reload_parameters.go index 3c0289f131..ba92fcc5c1 100644 --- a/api/agentlocalpb/json/client/agent_local/reload_parameters.go +++ b/api/agentlocalpb/json/client/agent_local/reload_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewReloadParams creates a new ReloadParams object -// with the default values initialized. +// 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 { - var () return &ReloadParams{ - timeout: cr.DefaultTimeout, } } // NewReloadParamsWithTimeout creates a new ReloadParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewReloadParamsWithTimeout(timeout time.Duration) *ReloadParams { - var () return &ReloadParams{ - timeout: timeout, } } // NewReloadParamsWithContext creates a new ReloadParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewReloadParamsWithContext(ctx context.Context) *ReloadParams { - var () return &ReloadParams{ - Context: ctx, } } // NewReloadParamsWithHTTPClient creates a new ReloadParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewReloadParamsWithHTTPClient(client *http.Client) *ReloadParams { - var () 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 +/* 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. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type ReloadParams struct { 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) @@ -119,7 +133,6 @@ func (o *ReloadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/agentlocalpb/json/client/agent_local/reload_responses.go b/api/agentlocalpb/json/client/agent_local/reload_responses.go index df502ad7f0..f9fd14f322 100644 --- a/api/agentlocalpb/json/client/agent_local/reload_responses.go +++ b/api/agentlocalpb/json/client/agent_local/reload_responses.go @@ -6,6 +6,7 @@ package agent_local // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewReloadOK() *ReloadOK { return &ReloadOK{} } -/*ReloadOK handles this case with default header values. +/* ReloadOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ReloadOK struct { func (o *ReloadOK) Error() string { return fmt.Sprintf("[POST /local/Reload][%d] reloadOk %+v", 200, o.Payload) } - func (o *ReloadOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewReloadDefault(code int) *ReloadDefault { } } -/*ReloadDefault handles this case with default header values. +/* ReloadDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *ReloadDefault) Code() int { func (o *ReloadDefault) Error() string { return fmt.Sprintf("[POST /local/Reload][%d] Reload default %+v", o._statusCode, o.Payload) } - func (o *ReloadDefault) GetPayload() *ReloadDefaultBody { return o.Payload } @@ -115,42 +114,6 @@ func (o *ReloadDefault) readResponse(response runtime.ClientResponse, consumer r return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*ReloadDefaultBody reload default body swagger:model ReloadDefaultBody */ @@ -166,7 +129,7 @@ type ReloadDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ReloadDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this reload default body @@ -184,7 +147,6 @@ func (o *ReloadDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ReloadDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -198,6 +160,42 @@ func (o *ReloadDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Reload default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Reload default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Reload default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -225,3 +223,44 @@ func (o *ReloadDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*ReloadDefaultBodyDetailsItems0 reload default body details items0 +swagger:model ReloadDefaultBodyDetailsItems0 +*/ +type ReloadDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/agentlocalpb/json/client/agent_local/status2_parameters.go b/api/agentlocalpb/json/client/agent_local/status2_parameters.go index 1daa28c03a..42eeaacc0b 100644 --- a/api/agentlocalpb/json/client/agent_local/status2_parameters.go +++ b/api/agentlocalpb/json/client/agent_local/status2_parameters.go @@ -17,53 +17,52 @@ import ( "github.com/go-openapi/swag" ) -// NewStatus2Params creates a new Status2Params object -// with the default values initialized. +// 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 { - var () return &Status2Params{ - timeout: cr.DefaultTimeout, } } // NewStatus2ParamsWithTimeout creates a new Status2Params object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStatus2ParamsWithTimeout(timeout time.Duration) *Status2Params { - var () return &Status2Params{ - timeout: timeout, } } // NewStatus2ParamsWithContext creates a new Status2Params object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStatus2ParamsWithContext(ctx context.Context) *Status2Params { - var () return &Status2Params{ - Context: ctx, } } // NewStatus2ParamsWithHTTPClient creates a new Status2Params object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStatus2ParamsWithHTTPClient(client *http.Client) *Status2Params { - var () 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 +/* 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. + Returns network info (latency and clock_drift) if true. */ GetNetworkInfo *bool @@ -72,6 +71,21 @@ type Status2Params struct { 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) @@ -128,16 +142,17 @@ func (o *Status2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis // 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 { diff --git a/api/agentlocalpb/json/client/agent_local/status2_responses.go b/api/agentlocalpb/json/client/agent_local/status2_responses.go index f04ef8fd06..640d88a923 100644 --- a/api/agentlocalpb/json/client/agent_local/status2_responses.go +++ b/api/agentlocalpb/json/client/agent_local/status2_responses.go @@ -6,6 +6,8 @@ package agent_local // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "encoding/json" "fmt" "io" "strconv" @@ -14,6 +16,7 @@ import ( "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. @@ -47,7 +50,7 @@ func NewStatus2OK() *Status2OK { return &Status2OK{} } -/*Status2OK handles this case with default header values. +/* Status2OK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +61,6 @@ type Status2OK struct { func (o *Status2OK) Error() string { return fmt.Sprintf("[GET /local/Status][%d] status2Ok %+v", 200, o.Payload) } - func (o *Status2OK) GetPayload() *Status2OKBody { return o.Payload } @@ -82,7 +84,7 @@ func NewStatus2Default(code int) *Status2Default { } } -/*Status2Default handles this case with default header values. +/* Status2Default describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +102,6 @@ func (o *Status2Default) Code() int { func (o *Status2Default) Error() string { return fmt.Sprintf("[GET /local/Status][%d] Status2 default %+v", o._statusCode, o.Payload) } - func (o *Status2Default) GetPayload() *Status2DefaultBody { return o.Payload } @@ -132,7 +133,7 @@ type Status2DefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*Status2DefaultBodyDetailsItems0 `json:"details"` } // Validate validates this status2 default body @@ -150,7 +151,6 @@ func (o *Status2DefaultBody) Validate(formats strfmt.Registry) error { } func (o *Status2DefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -164,6 +164,42 @@ func (o *Status2DefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Status2 default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Status2 default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Status2 default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -192,6 +228,47 @@ func (o *Status2DefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*Status2DefaultBodyDetailsItems0 status2 default body details items0 +swagger:model Status2DefaultBodyDetailsItems0 +*/ +type Status2DefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -204,7 +281,7 @@ type Status2OKBody struct { RunsOnNodeID string `json:"runs_on_node_id,omitempty"` // agents info - AgentsInfo []*AgentsInfoItems0 `json:"agents_info"` + AgentsInfo []*Status2OKBodyAgentsInfoItems0 `json:"agents_info"` // Config file path if pmm-agent was started with one. ConfigFilepath string `json:"config_filepath,omitempty"` @@ -235,7 +312,6 @@ func (o *Status2OKBody) Validate(formats strfmt.Registry) error { } func (o *Status2OKBody) validateAgentsInfo(formats strfmt.Registry) error { - if swag.IsZero(o.AgentsInfo) { // not required return nil } @@ -249,6 +325,8 @@ func (o *Status2OKBody) validateAgentsInfo(formats strfmt.Registry) error { if err := o.AgentsInfo[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status2Ok" + "." + "agents_info" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status2Ok" + "." + "agents_info" + "." + strconv.Itoa(i)) } return err } @@ -260,7 +338,6 @@ func (o *Status2OKBody) validateAgentsInfo(formats strfmt.Registry) error { } func (o *Status2OKBody) validateServerInfo(formats strfmt.Registry) error { - if swag.IsZero(o.ServerInfo) { // not required return nil } @@ -269,6 +346,62 @@ func (o *Status2OKBody) validateServerInfo(formats strfmt.Registry) error { if err := o.ServerInfo.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status2Ok" + "." + "server_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.AgentsInfo[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status2Ok" + "." + "agents_info" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.ServerInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status2Ok" + "." + "server_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status2Ok" + "." + "server_info") } return err } @@ -295,6 +428,219 @@ func (o *Status2OKBody) UnmarshalBinary(b []byte) error { 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"` + + // 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"` + + // Store logs + Logs []string `json:"logs"` + + // AgentType describes supported Agent types. + // Enum: [AGENT_TYPE_INVALID PMM_AGENT VM_AGENT NODE_EXPORTER MYSQLD_EXPORTER MONGODB_EXPORTER POSTGRES_EXPORTER PROXYSQL_EXPORTER QAN_MYSQL_PERFSCHEMA_AGENT QAN_MYSQL_SLOWLOG_AGENT QAN_MONGODB_PROFILER_AGENT QAN_POSTGRESQL_PGSTATEMENTS_AGENT QAN_POSTGRESQL_PGSTATMONITOR_AGENT RDS_EXPORTER EXTERNAL_EXPORTER AZURE_DATABASE_EXPORTER] + AgentType *string `json:"agent_type,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,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 []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_TYPE_INVALID","PMM_AGENT","VM_AGENT","NODE_EXPORTER","MYSQLD_EXPORTER","MONGODB_EXPORTER","POSTGRES_EXPORTER","PROXYSQL_EXPORTER","QAN_MYSQL_PERFSCHEMA_AGENT","QAN_MYSQL_SLOWLOG_AGENT","QAN_MONGODB_PROFILER_AGENT","QAN_POSTGRESQL_PGSTATEMENTS_AGENT","QAN_POSTGRESQL_PGSTATMONITOR_AGENT","RDS_EXPORTER","EXTERNAL_EXPORTER","AZURE_DATABASE_EXPORTER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + status2OkBodyAgentsInfoItems0TypeAgentTypePropEnum = append(status2OkBodyAgentsInfoItems0TypeAgentTypePropEnum, v) + } +} + +const ( + + // Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEINVALID captures enum value "AGENT_TYPE_INVALID" + Status2OKBodyAgentsInfoItems0AgentTypeAGENTTYPEINVALID string = "AGENT_TYPE_INVALID" + + // Status2OKBodyAgentsInfoItems0AgentTypePMMAGENT captures enum value "PMM_AGENT" + Status2OKBodyAgentsInfoItems0AgentTypePMMAGENT string = "PMM_AGENT" + + // Status2OKBodyAgentsInfoItems0AgentTypeVMAGENT captures enum value "VM_AGENT" + Status2OKBodyAgentsInfoItems0AgentTypeVMAGENT string = "VM_AGENT" + + // Status2OKBodyAgentsInfoItems0AgentTypeNODEEXPORTER captures enum value "NODE_EXPORTER" + Status2OKBodyAgentsInfoItems0AgentTypeNODEEXPORTER string = "NODE_EXPORTER" + + // Status2OKBodyAgentsInfoItems0AgentTypeMYSQLDEXPORTER captures enum value "MYSQLD_EXPORTER" + Status2OKBodyAgentsInfoItems0AgentTypeMYSQLDEXPORTER string = "MYSQLD_EXPORTER" + + // Status2OKBodyAgentsInfoItems0AgentTypeMONGODBEXPORTER captures enum value "MONGODB_EXPORTER" + Status2OKBodyAgentsInfoItems0AgentTypeMONGODBEXPORTER string = "MONGODB_EXPORTER" + + // Status2OKBodyAgentsInfoItems0AgentTypePOSTGRESEXPORTER captures enum value "POSTGRES_EXPORTER" + Status2OKBodyAgentsInfoItems0AgentTypePOSTGRESEXPORTER string = "POSTGRES_EXPORTER" + + // Status2OKBodyAgentsInfoItems0AgentTypePROXYSQLEXPORTER captures enum value "PROXYSQL_EXPORTER" + Status2OKBodyAgentsInfoItems0AgentTypePROXYSQLEXPORTER string = "PROXYSQL_EXPORTER" + + // Status2OKBodyAgentsInfoItems0AgentTypeQANMYSQLPERFSCHEMAAGENT captures enum value "QAN_MYSQL_PERFSCHEMA_AGENT" + Status2OKBodyAgentsInfoItems0AgentTypeQANMYSQLPERFSCHEMAAGENT string = "QAN_MYSQL_PERFSCHEMA_AGENT" + + // Status2OKBodyAgentsInfoItems0AgentTypeQANMYSQLSLOWLOGAGENT captures enum value "QAN_MYSQL_SLOWLOG_AGENT" + Status2OKBodyAgentsInfoItems0AgentTypeQANMYSQLSLOWLOGAGENT string = "QAN_MYSQL_SLOWLOG_AGENT" + + // Status2OKBodyAgentsInfoItems0AgentTypeQANMONGODBPROFILERAGENT captures enum value "QAN_MONGODB_PROFILER_AGENT" + Status2OKBodyAgentsInfoItems0AgentTypeQANMONGODBPROFILERAGENT string = "QAN_MONGODB_PROFILER_AGENT" + + // Status2OKBodyAgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATEMENTSAGENT captures enum value "QAN_POSTGRESQL_PGSTATEMENTS_AGENT" + Status2OKBodyAgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATEMENTSAGENT string = "QAN_POSTGRESQL_PGSTATEMENTS_AGENT" + + // Status2OKBodyAgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATMONITORAGENT captures enum value "QAN_POSTGRESQL_PGSTATMONITOR_AGENT" + Status2OKBodyAgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATMONITORAGENT string = "QAN_POSTGRESQL_PGSTATMONITOR_AGENT" + + // Status2OKBodyAgentsInfoItems0AgentTypeRDSEXPORTER captures enum value "RDS_EXPORTER" + Status2OKBodyAgentsInfoItems0AgentTypeRDSEXPORTER string = "RDS_EXPORTER" + + // Status2OKBodyAgentsInfoItems0AgentTypeEXTERNALEXPORTER captures enum value "EXTERNAL_EXPORTER" + Status2OKBodyAgentsInfoItems0AgentTypeEXTERNALEXPORTER string = "EXTERNAL_EXPORTER" + + // Status2OKBodyAgentsInfoItems0AgentTypeAZUREDATABASEEXPORTER captures enum value "AZURE_DATABASE_EXPORTER" + Status2OKBodyAgentsInfoItems0AgentTypeAZUREDATABASEEXPORTER string = "AZURE_DATABASE_EXPORTER" +) + +// 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 []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_INVALID","STARTING","RUNNING","WAITING","STOPPING","DONE","UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + status2OkBodyAgentsInfoItems0TypeStatusPropEnum = append(status2OkBodyAgentsInfoItems0TypeStatusPropEnum, v) + } +} + +const ( + + // Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + Status2OKBodyAgentsInfoItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + + // Status2OKBodyAgentsInfoItems0StatusSTARTING captures enum value "STARTING" + Status2OKBodyAgentsInfoItems0StatusSTARTING string = "STARTING" + + // Status2OKBodyAgentsInfoItems0StatusRUNNING captures enum value "RUNNING" + Status2OKBodyAgentsInfoItems0StatusRUNNING string = "RUNNING" + + // Status2OKBodyAgentsInfoItems0StatusWAITING captures enum value "WAITING" + Status2OKBodyAgentsInfoItems0StatusWAITING string = "WAITING" + + // Status2OKBodyAgentsInfoItems0StatusSTOPPING captures enum value "STOPPING" + Status2OKBodyAgentsInfoItems0StatusSTOPPING string = "STOPPING" + + // Status2OKBodyAgentsInfoItems0StatusDONE captures enum value "DONE" + Status2OKBodyAgentsInfoItems0StatusDONE string = "DONE" + + // Status2OKBodyAgentsInfoItems0StatusUNKNOWN captures enum value "UNKNOWN" + Status2OKBodyAgentsInfoItems0StatusUNKNOWN string = "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 */ @@ -324,6 +670,11 @@ 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 { diff --git a/api/agentlocalpb/json/client/agent_local/status_parameters.go b/api/agentlocalpb/json/client/agent_local/status_parameters.go index cf6495c287..b3d7fba9b8 100644 --- a/api/agentlocalpb/json/client/agent_local/status_parameters.go +++ b/api/agentlocalpb/json/client/agent_local/status_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStatusParams creates a new StatusParams object -// with the default values initialized. +// 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 { - var () return &StatusParams{ - timeout: cr.DefaultTimeout, } } // NewStatusParamsWithTimeout creates a new StatusParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStatusParamsWithTimeout(timeout time.Duration) *StatusParams { - var () return &StatusParams{ - timeout: timeout, } } // NewStatusParamsWithContext creates a new StatusParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStatusParamsWithContext(ctx context.Context) *StatusParams { - var () return &StatusParams{ - Context: ctx, } } // NewStatusParamsWithHTTPClient creates a new StatusParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStatusParamsWithHTTPClient(client *http.Client) *StatusParams { - var () 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 +/* 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. Body StatusBody timeout time.Duration @@ -68,6 +67,21 @@ type StatusParams struct { 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) @@ -119,7 +133,6 @@ func (o *StatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/agentlocalpb/json/client/agent_local/status_responses.go b/api/agentlocalpb/json/client/agent_local/status_responses.go index edd023d969..32765157e3 100644 --- a/api/agentlocalpb/json/client/agent_local/status_responses.go +++ b/api/agentlocalpb/json/client/agent_local/status_responses.go @@ -6,6 +6,7 @@ package agent_local // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewStatusOK() *StatusOK { return &StatusOK{} } -/*StatusOK handles this case with default header values. +/* StatusOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type StatusOK struct { func (o *StatusOK) Error() string { return fmt.Sprintf("[POST /local/Status][%d] statusOk %+v", 200, o.Payload) } - func (o *StatusOK) GetPayload() *StatusOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewStatusDefault(code int) *StatusDefault { } } -/*StatusDefault handles this case with default header values. +/* StatusDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *StatusDefault) Code() int { func (o *StatusDefault) Error() string { return fmt.Sprintf("[POST /local/Status][%d] Status default %+v", o._statusCode, o.Payload) } - func (o *StatusDefault) GetPayload() *StatusDefaultBody { return o.Payload } @@ -119,216 +118,6 @@ func (o *StatusDefault) readResponse(response runtime.ClientResponse, consumer r return nil } -/*AgentsInfoItems0 AgentInfo contains information about Agent managed by pmm-agent. -swagger:model AgentsInfoItems0 -*/ -type AgentsInfoItems0 struct { - - // agent id - AgentID string `json:"agent_id,omitempty"` - - // AgentType describes supported Agent types. - // Enum: [AGENT_TYPE_INVALID PMM_AGENT VM_AGENT NODE_EXPORTER MYSQLD_EXPORTER MONGODB_EXPORTER POSTGRES_EXPORTER PROXYSQL_EXPORTER QAN_MYSQL_PERFSCHEMA_AGENT QAN_MYSQL_SLOWLOG_AGENT QAN_MONGODB_PROFILER_AGENT QAN_POSTGRESQL_PGSTATEMENTS_AGENT QAN_POSTGRESQL_PGSTATMONITOR_AGENT RDS_EXPORTER EXTERNAL_EXPORTER AZURE_DATABASE_EXPORTER] - AgentType *string `json:"agent_type,omitempty"` - - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` - - // Store logs - Logs []string `json:"logs"` -} - -// Validate validates this agents info items0 -func (o *AgentsInfoItems0) 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 agentsInfoItems0TypeAgentTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_TYPE_INVALID","PMM_AGENT","VM_AGENT","NODE_EXPORTER","MYSQLD_EXPORTER","MONGODB_EXPORTER","POSTGRES_EXPORTER","PROXYSQL_EXPORTER","QAN_MYSQL_PERFSCHEMA_AGENT","QAN_MYSQL_SLOWLOG_AGENT","QAN_MONGODB_PROFILER_AGENT","QAN_POSTGRESQL_PGSTATEMENTS_AGENT","QAN_POSTGRESQL_PGSTATMONITOR_AGENT","RDS_EXPORTER","EXTERNAL_EXPORTER","AZURE_DATABASE_EXPORTER"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - agentsInfoItems0TypeAgentTypePropEnum = append(agentsInfoItems0TypeAgentTypePropEnum, v) - } -} - -const ( - - // AgentsInfoItems0AgentTypeAGENTTYPEINVALID captures enum value "AGENT_TYPE_INVALID" - AgentsInfoItems0AgentTypeAGENTTYPEINVALID string = "AGENT_TYPE_INVALID" - - // AgentsInfoItems0AgentTypePMMAGENT captures enum value "PMM_AGENT" - AgentsInfoItems0AgentTypePMMAGENT string = "PMM_AGENT" - - // AgentsInfoItems0AgentTypeVMAGENT captures enum value "VM_AGENT" - AgentsInfoItems0AgentTypeVMAGENT string = "VM_AGENT" - - // AgentsInfoItems0AgentTypeNODEEXPORTER captures enum value "NODE_EXPORTER" - AgentsInfoItems0AgentTypeNODEEXPORTER string = "NODE_EXPORTER" - - // AgentsInfoItems0AgentTypeMYSQLDEXPORTER captures enum value "MYSQLD_EXPORTER" - AgentsInfoItems0AgentTypeMYSQLDEXPORTER string = "MYSQLD_EXPORTER" - - // AgentsInfoItems0AgentTypeMONGODBEXPORTER captures enum value "MONGODB_EXPORTER" - AgentsInfoItems0AgentTypeMONGODBEXPORTER string = "MONGODB_EXPORTER" - - // AgentsInfoItems0AgentTypePOSTGRESEXPORTER captures enum value "POSTGRES_EXPORTER" - AgentsInfoItems0AgentTypePOSTGRESEXPORTER string = "POSTGRES_EXPORTER" - - // AgentsInfoItems0AgentTypePROXYSQLEXPORTER captures enum value "PROXYSQL_EXPORTER" - AgentsInfoItems0AgentTypePROXYSQLEXPORTER string = "PROXYSQL_EXPORTER" - - // AgentsInfoItems0AgentTypeQANMYSQLPERFSCHEMAAGENT captures enum value "QAN_MYSQL_PERFSCHEMA_AGENT" - AgentsInfoItems0AgentTypeQANMYSQLPERFSCHEMAAGENT string = "QAN_MYSQL_PERFSCHEMA_AGENT" - - // AgentsInfoItems0AgentTypeQANMYSQLSLOWLOGAGENT captures enum value "QAN_MYSQL_SLOWLOG_AGENT" - AgentsInfoItems0AgentTypeQANMYSQLSLOWLOGAGENT string = "QAN_MYSQL_SLOWLOG_AGENT" - - // AgentsInfoItems0AgentTypeQANMONGODBPROFILERAGENT captures enum value "QAN_MONGODB_PROFILER_AGENT" - AgentsInfoItems0AgentTypeQANMONGODBPROFILERAGENT string = "QAN_MONGODB_PROFILER_AGENT" - - // AgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATEMENTSAGENT captures enum value "QAN_POSTGRESQL_PGSTATEMENTS_AGENT" - AgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATEMENTSAGENT string = "QAN_POSTGRESQL_PGSTATEMENTS_AGENT" - - // AgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATMONITORAGENT captures enum value "QAN_POSTGRESQL_PGSTATMONITOR_AGENT" - AgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATMONITORAGENT string = "QAN_POSTGRESQL_PGSTATMONITOR_AGENT" - - // AgentsInfoItems0AgentTypeRDSEXPORTER captures enum value "RDS_EXPORTER" - AgentsInfoItems0AgentTypeRDSEXPORTER string = "RDS_EXPORTER" - - // AgentsInfoItems0AgentTypeEXTERNALEXPORTER captures enum value "EXTERNAL_EXPORTER" - AgentsInfoItems0AgentTypeEXTERNALEXPORTER string = "EXTERNAL_EXPORTER" - - // AgentsInfoItems0AgentTypeAZUREDATABASEEXPORTER captures enum value "AZURE_DATABASE_EXPORTER" - AgentsInfoItems0AgentTypeAZUREDATABASEEXPORTER string = "AZURE_DATABASE_EXPORTER" -) - -// prop value enum -func (o *AgentsInfoItems0) validateAgentTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, agentsInfoItems0TypeAgentTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AgentsInfoItems0) 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 agentsInfoItems0TypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_INVALID","STARTING","RUNNING","WAITING","STOPPING","DONE","UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - agentsInfoItems0TypeStatusPropEnum = append(agentsInfoItems0TypeStatusPropEnum, v) - } -} - -const ( - - // AgentsInfoItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - AgentsInfoItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - - // AgentsInfoItems0StatusSTARTING captures enum value "STARTING" - AgentsInfoItems0StatusSTARTING string = "STARTING" - - // AgentsInfoItems0StatusRUNNING captures enum value "RUNNING" - AgentsInfoItems0StatusRUNNING string = "RUNNING" - - // AgentsInfoItems0StatusWAITING captures enum value "WAITING" - AgentsInfoItems0StatusWAITING string = "WAITING" - - // AgentsInfoItems0StatusSTOPPING captures enum value "STOPPING" - AgentsInfoItems0StatusSTOPPING string = "STOPPING" - - // AgentsInfoItems0StatusDONE captures enum value "DONE" - AgentsInfoItems0StatusDONE string = "DONE" - - // AgentsInfoItems0StatusUNKNOWN captures enum value "UNKNOWN" - AgentsInfoItems0StatusUNKNOWN string = "UNKNOWN" -) - -// prop value enum -func (o *AgentsInfoItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, agentsInfoItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AgentsInfoItems0) 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 -} - -// MarshalBinary interface implementation -func (o *AgentsInfoItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AgentsInfoItems0) UnmarshalBinary(b []byte) error { - var res AgentsInfoItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*StatusBody status body swagger:model StatusBody */ @@ -343,6 +132,11 @@ 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 { @@ -376,7 +170,7 @@ type StatusDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StatusDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this status default body @@ -394,7 +188,6 @@ func (o *StatusDefaultBody) Validate(formats strfmt.Registry) error { } func (o *StatusDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -408,6 +201,42 @@ func (o *StatusDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Status default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Status default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Status default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -436,6 +265,47 @@ func (o *StatusDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*StatusDefaultBodyDetailsItems0 status default body details items0 +swagger:model StatusDefaultBodyDetailsItems0 +*/ +type StatusDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -448,7 +318,7 @@ type StatusOKBody struct { RunsOnNodeID string `json:"runs_on_node_id,omitempty"` // agents info - AgentsInfo []*AgentsInfoItems0 `json:"agents_info"` + AgentsInfo []*StatusOKBodyAgentsInfoItems0 `json:"agents_info"` // Config file path if pmm-agent was started with one. ConfigFilepath string `json:"config_filepath,omitempty"` @@ -479,7 +349,6 @@ func (o *StatusOKBody) Validate(formats strfmt.Registry) error { } func (o *StatusOKBody) validateAgentsInfo(formats strfmt.Registry) error { - if swag.IsZero(o.AgentsInfo) { // not required return nil } @@ -493,6 +362,8 @@ func (o *StatusOKBody) validateAgentsInfo(formats strfmt.Registry) error { if err := o.AgentsInfo[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("statusOk" + "." + "agents_info" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("statusOk" + "." + "agents_info" + "." + strconv.Itoa(i)) } return err } @@ -504,7 +375,6 @@ func (o *StatusOKBody) validateAgentsInfo(formats strfmt.Registry) error { } func (o *StatusOKBody) validateServerInfo(formats strfmt.Registry) error { - if swag.IsZero(o.ServerInfo) { // not required return nil } @@ -513,6 +383,62 @@ func (o *StatusOKBody) validateServerInfo(formats strfmt.Registry) error { if err := o.ServerInfo.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("statusOk" + "." + "server_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.AgentsInfo[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("statusOk" + "." + "agents_info" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.ServerInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("statusOk" + "." + "server_info") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("statusOk" + "." + "server_info") } return err } @@ -539,6 +465,219 @@ func (o *StatusOKBody) UnmarshalBinary(b []byte) error { 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"` + + // 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"` + + // Store logs + Logs []string `json:"logs"` + + // AgentType describes supported Agent types. + // Enum: [AGENT_TYPE_INVALID PMM_AGENT VM_AGENT NODE_EXPORTER MYSQLD_EXPORTER MONGODB_EXPORTER POSTGRES_EXPORTER PROXYSQL_EXPORTER QAN_MYSQL_PERFSCHEMA_AGENT QAN_MYSQL_SLOWLOG_AGENT QAN_MONGODB_PROFILER_AGENT QAN_POSTGRESQL_PGSTATEMENTS_AGENT QAN_POSTGRESQL_PGSTATMONITOR_AGENT RDS_EXPORTER EXTERNAL_EXPORTER AZURE_DATABASE_EXPORTER] + AgentType *string `json:"agent_type,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,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 []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_TYPE_INVALID","PMM_AGENT","VM_AGENT","NODE_EXPORTER","MYSQLD_EXPORTER","MONGODB_EXPORTER","POSTGRES_EXPORTER","PROXYSQL_EXPORTER","QAN_MYSQL_PERFSCHEMA_AGENT","QAN_MYSQL_SLOWLOG_AGENT","QAN_MONGODB_PROFILER_AGENT","QAN_POSTGRESQL_PGSTATEMENTS_AGENT","QAN_POSTGRESQL_PGSTATMONITOR_AGENT","RDS_EXPORTER","EXTERNAL_EXPORTER","AZURE_DATABASE_EXPORTER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + statusOkBodyAgentsInfoItems0TypeAgentTypePropEnum = append(statusOkBodyAgentsInfoItems0TypeAgentTypePropEnum, v) + } +} + +const ( + + // StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEINVALID captures enum value "AGENT_TYPE_INVALID" + StatusOKBodyAgentsInfoItems0AgentTypeAGENTTYPEINVALID string = "AGENT_TYPE_INVALID" + + // StatusOKBodyAgentsInfoItems0AgentTypePMMAGENT captures enum value "PMM_AGENT" + StatusOKBodyAgentsInfoItems0AgentTypePMMAGENT string = "PMM_AGENT" + + // StatusOKBodyAgentsInfoItems0AgentTypeVMAGENT captures enum value "VM_AGENT" + StatusOKBodyAgentsInfoItems0AgentTypeVMAGENT string = "VM_AGENT" + + // StatusOKBodyAgentsInfoItems0AgentTypeNODEEXPORTER captures enum value "NODE_EXPORTER" + StatusOKBodyAgentsInfoItems0AgentTypeNODEEXPORTER string = "NODE_EXPORTER" + + // StatusOKBodyAgentsInfoItems0AgentTypeMYSQLDEXPORTER captures enum value "MYSQLD_EXPORTER" + StatusOKBodyAgentsInfoItems0AgentTypeMYSQLDEXPORTER string = "MYSQLD_EXPORTER" + + // StatusOKBodyAgentsInfoItems0AgentTypeMONGODBEXPORTER captures enum value "MONGODB_EXPORTER" + StatusOKBodyAgentsInfoItems0AgentTypeMONGODBEXPORTER string = "MONGODB_EXPORTER" + + // StatusOKBodyAgentsInfoItems0AgentTypePOSTGRESEXPORTER captures enum value "POSTGRES_EXPORTER" + StatusOKBodyAgentsInfoItems0AgentTypePOSTGRESEXPORTER string = "POSTGRES_EXPORTER" + + // StatusOKBodyAgentsInfoItems0AgentTypePROXYSQLEXPORTER captures enum value "PROXYSQL_EXPORTER" + StatusOKBodyAgentsInfoItems0AgentTypePROXYSQLEXPORTER string = "PROXYSQL_EXPORTER" + + // StatusOKBodyAgentsInfoItems0AgentTypeQANMYSQLPERFSCHEMAAGENT captures enum value "QAN_MYSQL_PERFSCHEMA_AGENT" + StatusOKBodyAgentsInfoItems0AgentTypeQANMYSQLPERFSCHEMAAGENT string = "QAN_MYSQL_PERFSCHEMA_AGENT" + + // StatusOKBodyAgentsInfoItems0AgentTypeQANMYSQLSLOWLOGAGENT captures enum value "QAN_MYSQL_SLOWLOG_AGENT" + StatusOKBodyAgentsInfoItems0AgentTypeQANMYSQLSLOWLOGAGENT string = "QAN_MYSQL_SLOWLOG_AGENT" + + // StatusOKBodyAgentsInfoItems0AgentTypeQANMONGODBPROFILERAGENT captures enum value "QAN_MONGODB_PROFILER_AGENT" + StatusOKBodyAgentsInfoItems0AgentTypeQANMONGODBPROFILERAGENT string = "QAN_MONGODB_PROFILER_AGENT" + + // StatusOKBodyAgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATEMENTSAGENT captures enum value "QAN_POSTGRESQL_PGSTATEMENTS_AGENT" + StatusOKBodyAgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATEMENTSAGENT string = "QAN_POSTGRESQL_PGSTATEMENTS_AGENT" + + // StatusOKBodyAgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATMONITORAGENT captures enum value "QAN_POSTGRESQL_PGSTATMONITOR_AGENT" + StatusOKBodyAgentsInfoItems0AgentTypeQANPOSTGRESQLPGSTATMONITORAGENT string = "QAN_POSTGRESQL_PGSTATMONITOR_AGENT" + + // StatusOKBodyAgentsInfoItems0AgentTypeRDSEXPORTER captures enum value "RDS_EXPORTER" + StatusOKBodyAgentsInfoItems0AgentTypeRDSEXPORTER string = "RDS_EXPORTER" + + // StatusOKBodyAgentsInfoItems0AgentTypeEXTERNALEXPORTER captures enum value "EXTERNAL_EXPORTER" + StatusOKBodyAgentsInfoItems0AgentTypeEXTERNALEXPORTER string = "EXTERNAL_EXPORTER" + + // StatusOKBodyAgentsInfoItems0AgentTypeAZUREDATABASEEXPORTER captures enum value "AZURE_DATABASE_EXPORTER" + StatusOKBodyAgentsInfoItems0AgentTypeAZUREDATABASEEXPORTER string = "AZURE_DATABASE_EXPORTER" +) + +// 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 []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_INVALID","STARTING","RUNNING","WAITING","STOPPING","DONE","UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + statusOkBodyAgentsInfoItems0TypeStatusPropEnum = append(statusOkBodyAgentsInfoItems0TypeStatusPropEnum, v) + } +} + +const ( + + // StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + StatusOKBodyAgentsInfoItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + + // StatusOKBodyAgentsInfoItems0StatusSTARTING captures enum value "STARTING" + StatusOKBodyAgentsInfoItems0StatusSTARTING string = "STARTING" + + // StatusOKBodyAgentsInfoItems0StatusRUNNING captures enum value "RUNNING" + StatusOKBodyAgentsInfoItems0StatusRUNNING string = "RUNNING" + + // StatusOKBodyAgentsInfoItems0StatusWAITING captures enum value "WAITING" + StatusOKBodyAgentsInfoItems0StatusWAITING string = "WAITING" + + // StatusOKBodyAgentsInfoItems0StatusSTOPPING captures enum value "STOPPING" + StatusOKBodyAgentsInfoItems0StatusSTOPPING string = "STOPPING" + + // StatusOKBodyAgentsInfoItems0StatusDONE captures enum value "DONE" + StatusOKBodyAgentsInfoItems0StatusDONE string = "DONE" + + // StatusOKBodyAgentsInfoItems0StatusUNKNOWN captures enum value "UNKNOWN" + StatusOKBodyAgentsInfoItems0StatusUNKNOWN string = "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 */ @@ -568,6 +707,11 @@ 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 { diff --git a/api/agentlocalpb/json/client/pmm_agent_local_client.go b/api/agentlocalpb/json/client/pmm_agent_local_api_client.go similarity index 83% rename from api/agentlocalpb/json/client/pmm_agent_local_client.go rename to api/agentlocalpb/json/client/pmm_agent_local_api_client.go index c47793bb54..b84e14b9b8 100644 --- a/api/agentlocalpb/json/client/pmm_agent_local_client.go +++ b/api/agentlocalpb/json/client/pmm_agent_local_api_client.go @@ -13,7 +13,7 @@ import ( "github.com/percona/pmm/api/agentlocalpb/json/client/agent_local" ) -// Default PMM agent local HTTP client. +// Default PMM agent local API HTTP client. var Default = NewHTTPClient(nil) const ( @@ -28,14 +28,14 @@ const ( // DefaultSchemes are the default schemes found in Meta (info) section of spec file var DefaultSchemes = []string{"http"} -// NewHTTPClient creates a new PMM agent local HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMAgentLocal { +// 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 HTTP client, +// NewHTTPClientWithConfig creates a new PMM agent local API HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMAgentLocal { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMAgentLocalAPI { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -46,14 +46,14 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMM return New(transport, formats) } -// New creates a new PMM agent local client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMAgentLocal { +// 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(PMMAgentLocal) + cli := new(PMMAgentLocalAPI) cli.Transport = transport cli.AgentLocal = agent_local.New(transport, formats) return cli @@ -98,15 +98,15 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// PMMAgentLocal is a client for PMM agent local -type PMMAgentLocal struct { +// PMMAgentLocalAPI is a client for PMM agent local API +type PMMAgentLocalAPI struct { AgentLocal agent_local.ClientService Transport runtime.ClientTransport } // SetTransport changes the transport on the client and all its subresources -func (c *PMMAgentLocal) SetTransport(transport runtime.ClientTransport) { +func (c *PMMAgentLocalAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.AgentLocal.SetTransport(transport) } diff --git a/api/agentpb/agent.pb.go b/api/agentpb/agent.pb.go index 983ed03dc2..843463de84 100644 --- a/api/agentpb/agent.pb.go +++ b/api/agentpb/agent.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: agentpb/agent.proto diff --git a/api/agentpb/collector.pb.go b/api/agentpb/collector.pb.go index c2a488bd12..3d03a19de6 100644 --- a/api/agentpb/collector.pb.go +++ b/api/agentpb/collector.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: agentpb/collector.proto diff --git a/api/inventorypb/agent_status.pb.go b/api/inventorypb/agent_status.pb.go index 311ba77b3c..5aae0e483f 100644 --- a/api/inventorypb/agent_status.pb.go +++ b/api/inventorypb/agent_status.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: inventorypb/agent_status.proto diff --git a/api/inventorypb/agents.pb.go b/api/inventorypb/agents.pb.go index 73c99fa0fb..149c6ccc90 100644 --- a/api/inventorypb/agents.pb.go +++ b/api/inventorypb/agents.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: inventorypb/agents.proto diff --git a/api/inventorypb/json/client/agents/add_azure_database_exporter_parameters.go b/api/inventorypb/json/client/agents/add_azure_database_exporter_parameters.go index 216e7276fe..ccea432e36 100644 --- a/api/inventorypb/json/client/agents/add_azure_database_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/add_azure_database_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddAzureDatabaseExporterParams creates a new AddAzureDatabaseExporterParams object -// with the default values initialized. +// NewAddAzureDatabaseExporterParams creates a new AddAzureDatabaseExporterParams 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 NewAddAzureDatabaseExporterParams() *AddAzureDatabaseExporterParams { - var () return &AddAzureDatabaseExporterParams{ - timeout: cr.DefaultTimeout, } } // NewAddAzureDatabaseExporterParamsWithTimeout creates a new AddAzureDatabaseExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddAzureDatabaseExporterParamsWithTimeout(timeout time.Duration) *AddAzureDatabaseExporterParams { - var () return &AddAzureDatabaseExporterParams{ - timeout: timeout, } } // NewAddAzureDatabaseExporterParamsWithContext creates a new AddAzureDatabaseExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddAzureDatabaseExporterParamsWithContext(ctx context.Context) *AddAzureDatabaseExporterParams { - var () return &AddAzureDatabaseExporterParams{ - Context: ctx, } } // NewAddAzureDatabaseExporterParamsWithHTTPClient creates a new AddAzureDatabaseExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddAzureDatabaseExporterParamsWithHTTPClient(client *http.Client) *AddAzureDatabaseExporterParams { - var () return &AddAzureDatabaseExporterParams{ HTTPClient: client, } } -/*AddAzureDatabaseExporterParams contains all the parameters to send to the API endpoint -for the add azure database exporter operation typically these are written to a http.Request +/* AddAzureDatabaseExporterParams contains all the parameters to send to the API endpoint + for the add azure database exporter operation. + + Typically these are written to a http.Request. */ type AddAzureDatabaseExporterParams struct { - /*Body*/ + // Body. Body AddAzureDatabaseExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type AddAzureDatabaseExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add azure database exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddAzureDatabaseExporterParams) WithDefaults() *AddAzureDatabaseExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add azure database exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddAzureDatabaseExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add azure database exporter params func (o *AddAzureDatabaseExporterParams) WithTimeout(timeout time.Duration) *AddAzureDatabaseExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddAzureDatabaseExporterParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_azure_database_exporter_responses.go b/api/inventorypb/json/client/agents/add_azure_database_exporter_responses.go index 227f2f6fea..3f0229463a 100644 --- a/api/inventorypb/json/client/agents/add_azure_database_exporter_responses.go +++ b/api/inventorypb/json/client/agents/add_azure_database_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddAzureDatabaseExporterOK() *AddAzureDatabaseExporterOK { return &AddAzureDatabaseExporterOK{} } -/*AddAzureDatabaseExporterOK handles this case with default header values. +/* AddAzureDatabaseExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddAzureDatabaseExporterOK struct { func (o *AddAzureDatabaseExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddAzureDatabaseExporter][%d] addAzureDatabaseExporterOk %+v", 200, o.Payload) } - func (o *AddAzureDatabaseExporterOK) GetPayload() *AddAzureDatabaseExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddAzureDatabaseExporterDefault(code int) *AddAzureDatabaseExporterDefau } } -/*AddAzureDatabaseExporterDefault handles this case with default header values. +/* AddAzureDatabaseExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddAzureDatabaseExporterDefault) Code() int { func (o *AddAzureDatabaseExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddAzureDatabaseExporter][%d] AddAzureDatabaseExporter default %+v", o._statusCode, o.Payload) } - func (o *AddAzureDatabaseExporterDefault) GetPayload() *AddAzureDatabaseExporterDefaultBody { return o.Payload } @@ -163,6 +162,11 @@ func (o *AddAzureDatabaseExporterBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add azure database exporter body based on context it is used +func (o *AddAzureDatabaseExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddAzureDatabaseExporterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -196,7 +200,7 @@ type AddAzureDatabaseExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddAzureDatabaseExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add azure database exporter default body @@ -214,7 +218,6 @@ func (o *AddAzureDatabaseExporterDefaultBody) Validate(formats strfmt.Registry) } func (o *AddAzureDatabaseExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +231,42 @@ func (o *AddAzureDatabaseExporterDefaultBody) validateDetails(formats strfmt.Reg if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddAzureDatabaseExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddAzureDatabaseExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add azure database exporter default body based on the context it is used +func (o *AddAzureDatabaseExporterDefaultBody) 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 *AddAzureDatabaseExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddAzureDatabaseExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddAzureDatabaseExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +295,47 @@ func (o *AddAzureDatabaseExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddAzureDatabaseExporterDefaultBodyDetailsItems0 add azure database exporter default body details items0 +swagger:model AddAzureDatabaseExporterDefaultBodyDetailsItems0 +*/ +type AddAzureDatabaseExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add azure database exporter default body details items0 +func (o *AddAzureDatabaseExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add azure database exporter default body details items0 based on context it is used +func (o *AddAzureDatabaseExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddAzureDatabaseExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddAzureDatabaseExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddAzureDatabaseExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddAzureDatabaseExporterOKBody add azure database exporter OK body swagger:model AddAzureDatabaseExporterOKBody */ @@ -280,7 +360,6 @@ func (o *AddAzureDatabaseExporterOKBody) Validate(formats strfmt.Registry) error } func (o *AddAzureDatabaseExporterOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseExporter) { // not required return nil } @@ -289,6 +368,38 @@ func (o *AddAzureDatabaseExporterOKBody) validateAzureDatabaseExporter(formats s if err := o.AzureDatabaseExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addAzureDatabaseExporterOk" + "." + "azure_database_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addAzureDatabaseExporterOk" + "." + "azure_database_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add azure database exporter OK body based on the context it is used +func (o *AddAzureDatabaseExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateAzureDatabaseExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddAzureDatabaseExporterOKBody) contextValidateAzureDatabaseExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.AzureDatabaseExporter != nil { + if err := o.AzureDatabaseExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addAzureDatabaseExporterOk" + "." + "azure_database_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addAzureDatabaseExporterOk" + "." + "azure_database_exporter") } return err } @@ -341,6 +452,12 @@ type AddAzureDatabaseExporterOKBodyAzureDatabaseExporter struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,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"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -351,12 +468,6 @@ type AddAzureDatabaseExporterOKBodyAzureDatabaseExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` } // Validate validates this add azure database exporter OK body azure database exporter @@ -418,7 +529,6 @@ func (o *AddAzureDatabaseExporterOKBodyAzureDatabaseExporter) validateStatusEnum } func (o *AddAzureDatabaseExporterOKBodyAzureDatabaseExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -431,44 +541,13 @@ func (o *AddAzureDatabaseExporterOKBodyAzureDatabaseExporter) validateStatus(for return nil } -// MarshalBinary interface implementation -func (o *AddAzureDatabaseExporterOKBodyAzureDatabaseExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddAzureDatabaseExporterOKBodyAzureDatabaseExporter) UnmarshalBinary(b []byte) error { - var res AddAzureDatabaseExporterOKBodyAzureDatabaseExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add azure database exporter OK body azure database exporter based on context it is used +func (o *AddAzureDatabaseExporterOKBodyAzureDatabaseExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddAzureDatabaseExporterOKBodyAzureDatabaseExporter) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -476,8 +555,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddAzureDatabaseExporterOKBodyAzureDatabaseExporter) UnmarshalBinary(b []byte) error { + var res AddAzureDatabaseExporterOKBodyAzureDatabaseExporter if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_external_exporter_parameters.go b/api/inventorypb/json/client/agents/add_external_exporter_parameters.go index c247d74b78..85c365f9ce 100644 --- a/api/inventorypb/json/client/agents/add_external_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/add_external_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddExternalExporterParams creates a new AddExternalExporterParams object -// with the default values initialized. +// NewAddExternalExporterParams creates a new AddExternalExporterParams 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 NewAddExternalExporterParams() *AddExternalExporterParams { - var () return &AddExternalExporterParams{ - timeout: cr.DefaultTimeout, } } // NewAddExternalExporterParamsWithTimeout creates a new AddExternalExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddExternalExporterParamsWithTimeout(timeout time.Duration) *AddExternalExporterParams { - var () return &AddExternalExporterParams{ - timeout: timeout, } } // NewAddExternalExporterParamsWithContext creates a new AddExternalExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddExternalExporterParamsWithContext(ctx context.Context) *AddExternalExporterParams { - var () return &AddExternalExporterParams{ - Context: ctx, } } // NewAddExternalExporterParamsWithHTTPClient creates a new AddExternalExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddExternalExporterParamsWithHTTPClient(client *http.Client) *AddExternalExporterParams { - var () return &AddExternalExporterParams{ HTTPClient: client, } } -/*AddExternalExporterParams contains all the parameters to send to the API endpoint -for the add external exporter operation typically these are written to a http.Request +/* AddExternalExporterParams contains all the parameters to send to the API endpoint + for the add external exporter operation. + + Typically these are written to a http.Request. */ type AddExternalExporterParams struct { - /*Body*/ + // Body. Body AddExternalExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type AddExternalExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add external exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddExternalExporterParams) WithDefaults() *AddExternalExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add external exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddExternalExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add external exporter params func (o *AddExternalExporterParams) WithTimeout(timeout time.Duration) *AddExternalExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddExternalExporterParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_external_exporter_responses.go b/api/inventorypb/json/client/agents/add_external_exporter_responses.go index e3ef91bb32..d97a843ffb 100644 --- a/api/inventorypb/json/client/agents/add_external_exporter_responses.go +++ b/api/inventorypb/json/client/agents/add_external_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddExternalExporterOK() *AddExternalExporterOK { return &AddExternalExporterOK{} } -/*AddExternalExporterOK handles this case with default header values. +/* AddExternalExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddExternalExporterOK struct { func (o *AddExternalExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddExternalExporter][%d] addExternalExporterOk %+v", 200, o.Payload) } - func (o *AddExternalExporterOK) GetPayload() *AddExternalExporterOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddExternalExporterDefault(code int) *AddExternalExporterDefault { } } -/*AddExternalExporterDefault handles this case with default header values. +/* AddExternalExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddExternalExporterDefault) Code() int { func (o *AddExternalExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddExternalExporter][%d] AddExternalExporter default %+v", o._statusCode, o.Payload) } - func (o *AddExternalExporterDefault) GetPayload() *AddExternalExporterDefaultBody { return o.Payload } @@ -155,6 +154,11 @@ func (o *AddExternalExporterBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add external exporter body based on context it is used +func (o *AddExternalExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddExternalExporterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -188,7 +192,7 @@ type AddExternalExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddExternalExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add external exporter default body @@ -206,7 +210,6 @@ func (o *AddExternalExporterDefaultBody) Validate(formats strfmt.Registry) error } func (o *AddExternalExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -220,6 +223,42 @@ func (o *AddExternalExporterDefaultBody) validateDetails(formats strfmt.Registry if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddExternalExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddExternalExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add external exporter default body based on the context it is used +func (o *AddExternalExporterDefaultBody) 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 *AddExternalExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddExternalExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddExternalExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -248,6 +287,47 @@ func (o *AddExternalExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddExternalExporterDefaultBodyDetailsItems0 add external exporter default body details items0 +swagger:model AddExternalExporterDefaultBodyDetailsItems0 +*/ +type AddExternalExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add external exporter default body details items0 +func (o *AddExternalExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add external exporter default body details items0 based on context it is used +func (o *AddExternalExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddExternalExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddExternalExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddExternalExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddExternalExporterOKBody add external exporter OK body swagger:model AddExternalExporterOKBody */ @@ -272,7 +352,6 @@ func (o *AddExternalExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *AddExternalExporterOKBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required return nil } @@ -281,6 +360,38 @@ func (o *AddExternalExporterOKBody) validateExternalExporter(formats strfmt.Regi if err := o.ExternalExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addExternalExporterOk" + "." + "external_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addExternalExporterOk" + "." + "external_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add external exporter OK body based on the context it is used +func (o *AddExternalExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateExternalExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddExternalExporterOKBody) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.ExternalExporter != nil { + if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addExternalExporterOk" + "." + "external_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addExternalExporterOk" + "." + "external_exporter") } return err } @@ -348,6 +459,11 @@ func (o *AddExternalExporterOKBodyExternalExporter) Validate(formats strfmt.Regi return nil } +// ContextValidate validates this add external exporter OK body external exporter based on context it is used +func (o *AddExternalExporterOKBodyExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddExternalExporterOKBodyExternalExporter) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_mongo_db_exporter_parameters.go b/api/inventorypb/json/client/agents/add_mongo_db_exporter_parameters.go index ca4a28af72..007715475c 100644 --- a/api/inventorypb/json/client/agents/add_mongo_db_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/add_mongo_db_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddMongoDBExporterParams creates a new AddMongoDBExporterParams object -// with the default values initialized. +// NewAddMongoDBExporterParams creates a new AddMongoDBExporterParams 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 NewAddMongoDBExporterParams() *AddMongoDBExporterParams { - var () return &AddMongoDBExporterParams{ - timeout: cr.DefaultTimeout, } } // NewAddMongoDBExporterParamsWithTimeout creates a new AddMongoDBExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddMongoDBExporterParamsWithTimeout(timeout time.Duration) *AddMongoDBExporterParams { - var () return &AddMongoDBExporterParams{ - timeout: timeout, } } // NewAddMongoDBExporterParamsWithContext creates a new AddMongoDBExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddMongoDBExporterParamsWithContext(ctx context.Context) *AddMongoDBExporterParams { - var () return &AddMongoDBExporterParams{ - Context: ctx, } } // NewAddMongoDBExporterParamsWithHTTPClient creates a new AddMongoDBExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddMongoDBExporterParamsWithHTTPClient(client *http.Client) *AddMongoDBExporterParams { - var () return &AddMongoDBExporterParams{ HTTPClient: client, } } -/*AddMongoDBExporterParams contains all the parameters to send to the API endpoint -for the add mongo DB exporter operation typically these are written to a http.Request +/* AddMongoDBExporterParams contains all the parameters to send to the API endpoint + for the add mongo DB exporter operation. + + Typically these are written to a http.Request. */ type AddMongoDBExporterParams struct { - /*Body*/ + // Body. Body AddMongoDBExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type AddMongoDBExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add mongo DB exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMongoDBExporterParams) WithDefaults() *AddMongoDBExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add mongo DB exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMongoDBExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add mongo DB exporter params func (o *AddMongoDBExporterParams) WithTimeout(timeout time.Duration) *AddMongoDBExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddMongoDBExporterParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_mongo_db_exporter_responses.go b/api/inventorypb/json/client/agents/add_mongo_db_exporter_responses.go index c97ffd49be..e3361755af 100644 --- a/api/inventorypb/json/client/agents/add_mongo_db_exporter_responses.go +++ b/api/inventorypb/json/client/agents/add_mongo_db_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddMongoDBExporterOK() *AddMongoDBExporterOK { return &AddMongoDBExporterOK{} } -/*AddMongoDBExporterOK handles this case with default header values. +/* AddMongoDBExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddMongoDBExporterOK struct { func (o *AddMongoDBExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddMongoDBExporter][%d] addMongoDbExporterOk %+v", 200, o.Payload) } - func (o *AddMongoDBExporterOK) GetPayload() *AddMongoDBExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddMongoDBExporterDefault(code int) *AddMongoDBExporterDefault { } } -/*AddMongoDBExporterDefault handles this case with default header values. +/* AddMongoDBExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddMongoDBExporterDefault) Code() int { func (o *AddMongoDBExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddMongoDBExporter][%d] AddMongoDBExporter default %+v", o._statusCode, o.Payload) } - func (o *AddMongoDBExporterDefault) GetPayload() *AddMongoDBExporterDefaultBody { return o.Payload } @@ -187,6 +186,11 @@ func (o *AddMongoDBExporterBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add mongo DB exporter body based on context it is used +func (o *AddMongoDBExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMongoDBExporterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -220,7 +224,7 @@ type AddMongoDBExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddMongoDBExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add mongo DB exporter default body @@ -238,7 +242,6 @@ func (o *AddMongoDBExporterDefaultBody) Validate(formats strfmt.Registry) error } func (o *AddMongoDBExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -252,6 +255,42 @@ func (o *AddMongoDBExporterDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddMongoDBExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMongoDBExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add mongo DB exporter default body based on the context it is used +func (o *AddMongoDBExporterDefaultBody) 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 *AddMongoDBExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddMongoDBExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMongoDBExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -280,6 +319,47 @@ func (o *AddMongoDBExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddMongoDBExporterDefaultBodyDetailsItems0 add mongo DB exporter default body details items0 +swagger:model AddMongoDBExporterDefaultBodyDetailsItems0 +*/ +type AddMongoDBExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add mongo DB exporter default body details items0 +func (o *AddMongoDBExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add mongo DB exporter default body details items0 based on context it is used +func (o *AddMongoDBExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddMongoDBExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddMongoDBExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddMongoDBExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddMongoDBExporterOKBody add mongo DB exporter OK body swagger:model AddMongoDBExporterOKBody */ @@ -304,7 +384,6 @@ func (o *AddMongoDBExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *AddMongoDBExporterOKBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required return nil } @@ -313,6 +392,38 @@ func (o *AddMongoDBExporterOKBody) validateMongodbExporter(formats strfmt.Regist if err := o.MongodbExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMongoDbExporterOk" + "." + "mongodb_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMongoDbExporterOk" + "." + "mongodb_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add mongo DB exporter OK body based on the context it is used +func (o *AddMongoDBExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMongodbExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddMongoDBExporterOKBody) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.MongodbExporter != nil { + if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMongoDbExporterOk" + "." + "mongodb_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMongoDbExporterOk" + "." + "mongodb_exporter") } return err } @@ -374,17 +485,6 @@ type AddMongoDBExporterOKBodyMongodbExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -397,6 +497,17 @@ type AddMongoDBExporterOKBodyMongodbExporter struct { // Enable All collectors. EnableAllCollectors bool `json:"enable_all_collectors,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,omitempty"` } // Validate validates this add mongo DB exporter OK body mongodb exporter @@ -458,7 +569,6 @@ func (o *AddMongoDBExporterOKBodyMongodbExporter) validateStatusEnum(path, locat } func (o *AddMongoDBExporterOKBodyMongodbExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -471,6 +581,11 @@ func (o *AddMongoDBExporterOKBodyMongodbExporter) validateStatus(formats strfmt. return nil } +// ContextValidate validates this add mongo DB exporter OK body mongodb exporter based on context it is used +func (o *AddMongoDBExporterOKBodyMongodbExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMongoDBExporterOKBodyMongodbExporter) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_parameters.go b/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_parameters.go index 13da1793fd..ee03aa6445 100644 --- a/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddMySQLdExporterParams creates a new AddMySQLdExporterParams object -// with the default values initialized. +// NewAddMySQLdExporterParams creates a new AddMySQLdExporterParams 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 NewAddMySQLdExporterParams() *AddMySQLdExporterParams { - var () return &AddMySQLdExporterParams{ - timeout: cr.DefaultTimeout, } } // NewAddMySQLdExporterParamsWithTimeout creates a new AddMySQLdExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddMySQLdExporterParamsWithTimeout(timeout time.Duration) *AddMySQLdExporterParams { - var () return &AddMySQLdExporterParams{ - timeout: timeout, } } // NewAddMySQLdExporterParamsWithContext creates a new AddMySQLdExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddMySQLdExporterParamsWithContext(ctx context.Context) *AddMySQLdExporterParams { - var () return &AddMySQLdExporterParams{ - Context: ctx, } } // NewAddMySQLdExporterParamsWithHTTPClient creates a new AddMySQLdExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddMySQLdExporterParamsWithHTTPClient(client *http.Client) *AddMySQLdExporterParams { - var () return &AddMySQLdExporterParams{ HTTPClient: client, } } -/*AddMySQLdExporterParams contains all the parameters to send to the API endpoint -for the add my s q ld exporter operation typically these are written to a http.Request +/* AddMySQLdExporterParams contains all the parameters to send to the API endpoint + for the add my s q ld exporter operation. + + Typically these are written to a http.Request. */ type AddMySQLdExporterParams struct { - /*Body*/ + // Body. Body AddMySQLdExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type AddMySQLdExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add my s q ld exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMySQLdExporterParams) WithDefaults() *AddMySQLdExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add my s q ld exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMySQLdExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add my s q ld exporter params func (o *AddMySQLdExporterParams) WithTimeout(timeout time.Duration) *AddMySQLdExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddMySQLdExporterParams) WriteToRequest(r runtime.ClientRequest, reg st return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_responses.go b/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_responses.go index 3b2b5fe86b..8d195314a9 100644 --- a/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_responses.go +++ b/api/inventorypb/json/client/agents/add_my_s_q_ld_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddMySQLdExporterOK() *AddMySQLdExporterOK { return &AddMySQLdExporterOK{} } -/*AddMySQLdExporterOK handles this case with default header values. +/* AddMySQLdExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddMySQLdExporterOK struct { func (o *AddMySQLdExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddMySQLdExporter][%d] addMySQLdExporterOk %+v", 200, o.Payload) } - func (o *AddMySQLdExporterOK) GetPayload() *AddMySQLdExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddMySQLdExporterDefault(code int) *AddMySQLdExporterDefault { } } -/*AddMySQLdExporterDefault handles this case with default header values. +/* AddMySQLdExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddMySQLdExporterDefault) Code() int { func (o *AddMySQLdExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddMySQLdExporter][%d] AddMySQLdExporter default %+v", o._statusCode, o.Payload) } - func (o *AddMySQLdExporterDefault) GetPayload() *AddMySQLdExporterDefaultBody { return o.Payload } @@ -177,6 +176,11 @@ func (o *AddMySQLdExporterBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add my s q ld exporter body based on context it is used +func (o *AddMySQLdExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMySQLdExporterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -210,7 +214,7 @@ type AddMySQLdExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddMySQLdExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add my s q ld exporter default body @@ -228,7 +232,6 @@ func (o *AddMySQLdExporterDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddMySQLdExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -242,6 +245,42 @@ func (o *AddMySQLdExporterDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddMySQLdExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMySQLdExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add my s q ld exporter default body based on the context it is used +func (o *AddMySQLdExporterDefaultBody) 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 *AddMySQLdExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddMySQLdExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMySQLdExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -270,6 +309,47 @@ func (o *AddMySQLdExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddMySQLdExporterDefaultBodyDetailsItems0 add my s q ld exporter default body details items0 +swagger:model AddMySQLdExporterDefaultBodyDetailsItems0 +*/ +type AddMySQLdExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add my s q ld exporter default body details items0 +func (o *AddMySQLdExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add my s q ld exporter default body details items0 based on context it is used +func (o *AddMySQLdExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddMySQLdExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddMySQLdExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddMySQLdExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddMySQLdExporterOKBody add my s q ld exporter OK body swagger:model AddMySQLdExporterOKBody */ @@ -297,7 +377,6 @@ func (o *AddMySQLdExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *AddMySQLdExporterOKBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required return nil } @@ -306,6 +385,38 @@ func (o *AddMySQLdExporterOKBody) validateMysqldExporter(formats strfmt.Registry if err := o.MysqldExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMySQLdExporterOk" + "." + "mysqld_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySQLdExporterOk" + "." + "mysqld_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add my s q ld exporter OK body based on the context it is used +func (o *AddMySQLdExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMysqldExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddMySQLdExporterOKBody) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.MysqldExporter != nil { + if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMySQLdExporterOk" + "." + "mysqld_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySQLdExporterOk" + "." + "mysqld_exporter") } return err } @@ -381,6 +492,12 @@ type AddMySQLdExporterOKBodyMysqldExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // 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"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -391,12 +508,6 @@ type AddMySQLdExporterOKBodyMysqldExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` } // Validate validates this add my s q ld exporter OK body mysqld exporter @@ -458,7 +569,6 @@ func (o *AddMySQLdExporterOKBodyMysqldExporter) validateStatusEnum(path, locatio } func (o *AddMySQLdExporterOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -471,6 +581,11 @@ func (o *AddMySQLdExporterOKBodyMysqldExporter) validateStatus(formats strfmt.Re return nil } +// ContextValidate validates this add my s q ld exporter OK body mysqld exporter based on context it is used +func (o *AddMySQLdExporterOKBodyMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMySQLdExporterOKBodyMysqldExporter) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_node_exporter_parameters.go b/api/inventorypb/json/client/agents/add_node_exporter_parameters.go index 9cf61def97..6b9743f407 100644 --- a/api/inventorypb/json/client/agents/add_node_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/add_node_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddNodeExporterParams creates a new AddNodeExporterParams object -// with the default values initialized. +// NewAddNodeExporterParams creates a new AddNodeExporterParams 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 NewAddNodeExporterParams() *AddNodeExporterParams { - var () return &AddNodeExporterParams{ - timeout: cr.DefaultTimeout, } } // NewAddNodeExporterParamsWithTimeout creates a new AddNodeExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddNodeExporterParamsWithTimeout(timeout time.Duration) *AddNodeExporterParams { - var () return &AddNodeExporterParams{ - timeout: timeout, } } // NewAddNodeExporterParamsWithContext creates a new AddNodeExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddNodeExporterParamsWithContext(ctx context.Context) *AddNodeExporterParams { - var () return &AddNodeExporterParams{ - Context: ctx, } } // NewAddNodeExporterParamsWithHTTPClient creates a new AddNodeExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddNodeExporterParamsWithHTTPClient(client *http.Client) *AddNodeExporterParams { - var () return &AddNodeExporterParams{ HTTPClient: client, } } -/*AddNodeExporterParams contains all the parameters to send to the API endpoint -for the add node exporter operation typically these are written to a http.Request +/* AddNodeExporterParams contains all the parameters to send to the API endpoint + for the add node exporter operation. + + Typically these are written to a http.Request. */ type AddNodeExporterParams struct { - /*Body*/ + // Body. Body AddNodeExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type AddNodeExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add node exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddNodeExporterParams) WithDefaults() *AddNodeExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add node exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddNodeExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add node exporter params func (o *AddNodeExporterParams) WithTimeout(timeout time.Duration) *AddNodeExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddNodeExporterParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_node_exporter_responses.go b/api/inventorypb/json/client/agents/add_node_exporter_responses.go index 0fc108b96f..11f1b92057 100644 --- a/api/inventorypb/json/client/agents/add_node_exporter_responses.go +++ b/api/inventorypb/json/client/agents/add_node_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddNodeExporterOK() *AddNodeExporterOK { return &AddNodeExporterOK{} } -/*AddNodeExporterOK handles this case with default header values. +/* AddNodeExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddNodeExporterOK struct { func (o *AddNodeExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddNodeExporter][%d] addNodeExporterOk %+v", 200, o.Payload) } - func (o *AddNodeExporterOK) GetPayload() *AddNodeExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddNodeExporterDefault(code int) *AddNodeExporterDefault { } } -/*AddNodeExporterDefault handles this case with default header values. +/* AddNodeExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddNodeExporterDefault) Code() int { func (o *AddNodeExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddNodeExporter][%d] AddNodeExporter default %+v", o._statusCode, o.Payload) } - func (o *AddNodeExporterDefault) GetPayload() *AddNodeExporterDefaultBody { return o.Payload } @@ -142,6 +141,11 @@ func (o *AddNodeExporterBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add node exporter body based on context it is used +func (o *AddNodeExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddNodeExporterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -175,7 +179,7 @@ type AddNodeExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddNodeExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add node exporter default body @@ -193,7 +197,6 @@ func (o *AddNodeExporterDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddNodeExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -207,6 +210,42 @@ func (o *AddNodeExporterDefaultBody) validateDetails(formats strfmt.Registry) er if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddNodeExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddNodeExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add node exporter default body based on the context it is used +func (o *AddNodeExporterDefaultBody) 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 *AddNodeExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddNodeExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddNodeExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -235,6 +274,47 @@ func (o *AddNodeExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddNodeExporterDefaultBodyDetailsItems0 add node exporter default body details items0 +swagger:model AddNodeExporterDefaultBodyDetailsItems0 +*/ +type AddNodeExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add node exporter default body details items0 +func (o *AddNodeExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node exporter default body details items0 based on context it is used +func (o *AddNodeExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddNodeExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddNodeExporterOKBody add node exporter OK body swagger:model AddNodeExporterOKBody */ @@ -259,7 +339,6 @@ func (o *AddNodeExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *AddNodeExporterOKBody) validateNodeExporter(formats strfmt.Registry) error { - if swag.IsZero(o.NodeExporter) { // not required return nil } @@ -268,6 +347,38 @@ func (o *AddNodeExporterOKBody) validateNodeExporter(formats strfmt.Registry) er if err := o.NodeExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addNodeExporterOk" + "." + "node_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeExporterOk" + "." + "node_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add node exporter OK body based on the context it is used +func (o *AddNodeExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateNodeExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeExporterOKBody) contextValidateNodeExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.NodeExporter != nil { + if err := o.NodeExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeExporterOk" + "." + "node_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeExporterOk" + "." + "node_exporter") } return err } @@ -317,6 +428,9 @@ type AddNodeExporterOKBodyNodeExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -327,9 +441,6 @@ type AddNodeExporterOKBodyNodeExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this add node exporter OK body node exporter @@ -391,7 +502,6 @@ func (o *AddNodeExporterOKBodyNodeExporter) validateStatusEnum(path, location st } func (o *AddNodeExporterOKBodyNodeExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -404,6 +514,11 @@ func (o *AddNodeExporterOKBodyNodeExporter) validateStatus(formats strfmt.Regist return nil } +// ContextValidate validates this add node exporter OK body node exporter based on context it is used +func (o *AddNodeExporterOKBodyNodeExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddNodeExporterOKBodyNodeExporter) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_pmm_agent_parameters.go b/api/inventorypb/json/client/agents/add_pmm_agent_parameters.go index 4124b09c78..3c70af7990 100644 --- a/api/inventorypb/json/client/agents/add_pmm_agent_parameters.go +++ b/api/inventorypb/json/client/agents/add_pmm_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddPMMAgentParams creates a new AddPMMAgentParams object -// with the default values initialized. +// NewAddPMMAgentParams creates a new AddPMMAgentParams 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 NewAddPMMAgentParams() *AddPMMAgentParams { - var () return &AddPMMAgentParams{ - timeout: cr.DefaultTimeout, } } // NewAddPMMAgentParamsWithTimeout creates a new AddPMMAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddPMMAgentParamsWithTimeout(timeout time.Duration) *AddPMMAgentParams { - var () return &AddPMMAgentParams{ - timeout: timeout, } } // NewAddPMMAgentParamsWithContext creates a new AddPMMAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddPMMAgentParamsWithContext(ctx context.Context) *AddPMMAgentParams { - var () return &AddPMMAgentParams{ - Context: ctx, } } // NewAddPMMAgentParamsWithHTTPClient creates a new AddPMMAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddPMMAgentParamsWithHTTPClient(client *http.Client) *AddPMMAgentParams { - var () return &AddPMMAgentParams{ HTTPClient: client, } } -/*AddPMMAgentParams contains all the parameters to send to the API endpoint -for the add PMM agent operation typically these are written to a http.Request +/* AddPMMAgentParams contains all the parameters to send to the API endpoint + for the add PMM agent operation. + + Typically these are written to a http.Request. */ type AddPMMAgentParams struct { - /*Body*/ + // Body. Body AddPMMAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type AddPMMAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add PMM agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddPMMAgentParams) WithDefaults() *AddPMMAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add PMM agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddPMMAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add PMM agent params func (o *AddPMMAgentParams) WithTimeout(timeout time.Duration) *AddPMMAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddPMMAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_pmm_agent_responses.go b/api/inventorypb/json/client/agents/add_pmm_agent_responses.go index 18ef4cfebd..41632dbb4c 100644 --- a/api/inventorypb/json/client/agents/add_pmm_agent_responses.go +++ b/api/inventorypb/json/client/agents/add_pmm_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddPMMAgentOK() *AddPMMAgentOK { return &AddPMMAgentOK{} } -/*AddPMMAgentOK handles this case with default header values. +/* AddPMMAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddPMMAgentOK struct { func (o *AddPMMAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddPMMAgent][%d] addPmmAgentOk %+v", 200, o.Payload) } - func (o *AddPMMAgentOK) GetPayload() *AddPMMAgentOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddPMMAgentDefault(code int) *AddPMMAgentDefault { } } -/*AddPMMAgentDefault handles this case with default header values. +/* AddPMMAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddPMMAgentDefault) Code() int { func (o *AddPMMAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddPMMAgent][%d] AddPMMAgent default %+v", o._statusCode, o.Payload) } - func (o *AddPMMAgentDefault) GetPayload() *AddPMMAgentDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ func (o *AddPMMAgentBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add PMM agent body based on context it is used +func (o *AddPMMAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddPMMAgentBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -167,7 +171,7 @@ type AddPMMAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddPMMAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add PMM agent default body @@ -185,7 +189,6 @@ func (o *AddPMMAgentDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddPMMAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *AddPMMAgentDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddPMMAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddPMMAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add PMM agent default body based on the context it is used +func (o *AddPMMAgentDefaultBody) 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 *AddPMMAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddPMMAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddPMMAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,6 +266,47 @@ func (o *AddPMMAgentDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddPMMAgentDefaultBodyDetailsItems0 add PMM agent default body details items0 +swagger:model AddPMMAgentDefaultBodyDetailsItems0 +*/ +type AddPMMAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add PMM agent default body details items0 +func (o *AddPMMAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add PMM agent default body details items0 based on context it is used +func (o *AddPMMAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddPMMAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddPMMAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddPMMAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddPMMAgentOKBody add PMM agent OK body swagger:model AddPMMAgentOKBody */ @@ -251,7 +331,6 @@ func (o *AddPMMAgentOKBody) Validate(formats strfmt.Registry) error { } func (o *AddPMMAgentOKBody) validatePMMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.PMMAgent) { // not required return nil } @@ -260,6 +339,38 @@ func (o *AddPMMAgentOKBody) validatePMMAgent(formats strfmt.Registry) error { if err := o.PMMAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addPmmAgentOk" + "." + "pmm_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPmmAgentOk" + "." + "pmm_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add PMM agent OK body based on the context it is used +func (o *AddPMMAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePMMAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddPMMAgentOKBody) contextValidatePMMAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.PMMAgent != nil { + if err := o.PMMAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addPmmAgentOk" + "." + "pmm_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPmmAgentOk" + "." + "pmm_agent") } return err } @@ -309,6 +420,11 @@ func (o *AddPMMAgentOKBodyPMMAgent) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add PMM agent OK body PMM agent based on context it is used +func (o *AddPMMAgentOKBodyPMMAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddPMMAgentOKBodyPMMAgent) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_postgres_exporter_parameters.go b/api/inventorypb/json/client/agents/add_postgres_exporter_parameters.go index a8fc09b0b6..9fe280cf84 100644 --- a/api/inventorypb/json/client/agents/add_postgres_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/add_postgres_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddPostgresExporterParams creates a new AddPostgresExporterParams object -// with the default values initialized. +// NewAddPostgresExporterParams creates a new AddPostgresExporterParams 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 NewAddPostgresExporterParams() *AddPostgresExporterParams { - var () return &AddPostgresExporterParams{ - timeout: cr.DefaultTimeout, } } // NewAddPostgresExporterParamsWithTimeout creates a new AddPostgresExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddPostgresExporterParamsWithTimeout(timeout time.Duration) *AddPostgresExporterParams { - var () return &AddPostgresExporterParams{ - timeout: timeout, } } // NewAddPostgresExporterParamsWithContext creates a new AddPostgresExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddPostgresExporterParamsWithContext(ctx context.Context) *AddPostgresExporterParams { - var () return &AddPostgresExporterParams{ - Context: ctx, } } // NewAddPostgresExporterParamsWithHTTPClient creates a new AddPostgresExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddPostgresExporterParamsWithHTTPClient(client *http.Client) *AddPostgresExporterParams { - var () return &AddPostgresExporterParams{ HTTPClient: client, } } -/*AddPostgresExporterParams contains all the parameters to send to the API endpoint -for the add postgres exporter operation typically these are written to a http.Request +/* AddPostgresExporterParams contains all the parameters to send to the API endpoint + for the add postgres exporter operation. + + Typically these are written to a http.Request. */ type AddPostgresExporterParams struct { - /*Body*/ + // Body. Body AddPostgresExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type AddPostgresExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add postgres exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddPostgresExporterParams) WithDefaults() *AddPostgresExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add postgres exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddPostgresExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add postgres exporter params func (o *AddPostgresExporterParams) WithTimeout(timeout time.Duration) *AddPostgresExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddPostgresExporterParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_postgres_exporter_responses.go b/api/inventorypb/json/client/agents/add_postgres_exporter_responses.go index 9c88621e12..e238685468 100644 --- a/api/inventorypb/json/client/agents/add_postgres_exporter_responses.go +++ b/api/inventorypb/json/client/agents/add_postgres_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddPostgresExporterOK() *AddPostgresExporterOK { return &AddPostgresExporterOK{} } -/*AddPostgresExporterOK handles this case with default header values. +/* AddPostgresExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddPostgresExporterOK struct { func (o *AddPostgresExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddPostgresExporter][%d] addPostgresExporterOk %+v", 200, o.Payload) } - func (o *AddPostgresExporterOK) GetPayload() *AddPostgresExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddPostgresExporterDefault(code int) *AddPostgresExporterDefault { } } -/*AddPostgresExporterDefault handles this case with default header values. +/* AddPostgresExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddPostgresExporterDefault) Code() int { func (o *AddPostgresExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddPostgresExporter][%d] AddPostgresExporter default %+v", o._statusCode, o.Payload) } - func (o *AddPostgresExporterDefault) GetPayload() *AddPostgresExporterDefaultBody { return o.Payload } @@ -172,6 +171,11 @@ func (o *AddPostgresExporterBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add postgres exporter body based on context it is used +func (o *AddPostgresExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddPostgresExporterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -205,7 +209,7 @@ type AddPostgresExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddPostgresExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add postgres exporter default body @@ -223,7 +227,6 @@ func (o *AddPostgresExporterDefaultBody) Validate(formats strfmt.Registry) error } func (o *AddPostgresExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -237,6 +240,42 @@ func (o *AddPostgresExporterDefaultBody) validateDetails(formats strfmt.Registry if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddPostgresExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddPostgresExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add postgres exporter default body based on the context it is used +func (o *AddPostgresExporterDefaultBody) 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 *AddPostgresExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddPostgresExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddPostgresExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -265,6 +304,47 @@ func (o *AddPostgresExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddPostgresExporterDefaultBodyDetailsItems0 add postgres exporter default body details items0 +swagger:model AddPostgresExporterDefaultBodyDetailsItems0 +*/ +type AddPostgresExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add postgres exporter default body details items0 +func (o *AddPostgresExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add postgres exporter default body details items0 based on context it is used +func (o *AddPostgresExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddPostgresExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddPostgresExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddPostgresExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddPostgresExporterOKBody add postgres exporter OK body swagger:model AddPostgresExporterOKBody */ @@ -289,7 +369,6 @@ func (o *AddPostgresExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *AddPostgresExporterOKBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required return nil } @@ -298,6 +377,38 @@ func (o *AddPostgresExporterOKBody) validatePostgresExporter(formats strfmt.Regi if err := o.PostgresExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addPostgresExporterOk" + "." + "postgres_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgresExporterOk" + "." + "postgres_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add postgres exporter OK body based on the context it is used +func (o *AddPostgresExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePostgresExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddPostgresExporterOKBody) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.PostgresExporter != nil { + if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addPostgresExporterOk" + "." + "postgres_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgresExporterOk" + "." + "postgres_exporter") } return err } @@ -359,6 +470,9 @@ type AddPostgresExporterOKBodyPostgresExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -369,9 +483,6 @@ type AddPostgresExporterOKBodyPostgresExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this add postgres exporter OK body postgres exporter @@ -433,7 +544,6 @@ func (o *AddPostgresExporterOKBodyPostgresExporter) validateStatusEnum(path, loc } func (o *AddPostgresExporterOKBodyPostgresExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -446,6 +556,11 @@ func (o *AddPostgresExporterOKBodyPostgresExporter) validateStatus(formats strfm return nil } +// ContextValidate validates this add postgres exporter OK body postgres exporter based on context it is used +func (o *AddPostgresExporterOKBodyPostgresExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddPostgresExporterOKBodyPostgresExporter) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_proxy_sql_exporter_parameters.go b/api/inventorypb/json/client/agents/add_proxy_sql_exporter_parameters.go index e09ce2b4b7..e083bbf61f 100644 --- a/api/inventorypb/json/client/agents/add_proxy_sql_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/add_proxy_sql_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddProxySQLExporterParams creates a new AddProxySQLExporterParams object -// with the default values initialized. +// NewAddProxySQLExporterParams creates a new AddProxySQLExporterParams 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 NewAddProxySQLExporterParams() *AddProxySQLExporterParams { - var () return &AddProxySQLExporterParams{ - timeout: cr.DefaultTimeout, } } // NewAddProxySQLExporterParamsWithTimeout creates a new AddProxySQLExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddProxySQLExporterParamsWithTimeout(timeout time.Duration) *AddProxySQLExporterParams { - var () return &AddProxySQLExporterParams{ - timeout: timeout, } } // NewAddProxySQLExporterParamsWithContext creates a new AddProxySQLExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddProxySQLExporterParamsWithContext(ctx context.Context) *AddProxySQLExporterParams { - var () return &AddProxySQLExporterParams{ - Context: ctx, } } // NewAddProxySQLExporterParamsWithHTTPClient creates a new AddProxySQLExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddProxySQLExporterParamsWithHTTPClient(client *http.Client) *AddProxySQLExporterParams { - var () return &AddProxySQLExporterParams{ HTTPClient: client, } } -/*AddProxySQLExporterParams contains all the parameters to send to the API endpoint -for the add proxy SQL exporter operation typically these are written to a http.Request +/* AddProxySQLExporterParams contains all the parameters to send to the API endpoint + for the add proxy SQL exporter operation. + + Typically these are written to a http.Request. */ type AddProxySQLExporterParams struct { - /*Body*/ + // Body. Body AddProxySQLExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type AddProxySQLExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add proxy SQL exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddProxySQLExporterParams) WithDefaults() *AddProxySQLExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add proxy SQL exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddProxySQLExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add proxy SQL exporter params func (o *AddProxySQLExporterParams) WithTimeout(timeout time.Duration) *AddProxySQLExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddProxySQLExporterParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_proxy_sql_exporter_responses.go b/api/inventorypb/json/client/agents/add_proxy_sql_exporter_responses.go index ecf4ee47ef..335f4ef5d3 100644 --- a/api/inventorypb/json/client/agents/add_proxy_sql_exporter_responses.go +++ b/api/inventorypb/json/client/agents/add_proxy_sql_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddProxySQLExporterOK() *AddProxySQLExporterOK { return &AddProxySQLExporterOK{} } -/*AddProxySQLExporterOK handles this case with default header values. +/* AddProxySQLExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddProxySQLExporterOK struct { func (o *AddProxySQLExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddProxySQLExporter][%d] addProxySqlExporterOk %+v", 200, o.Payload) } - func (o *AddProxySQLExporterOK) GetPayload() *AddProxySQLExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddProxySQLExporterDefault(code int) *AddProxySQLExporterDefault { } } -/*AddProxySQLExporterDefault handles this case with default header values. +/* AddProxySQLExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddProxySQLExporterDefault) Code() int { func (o *AddProxySQLExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddProxySQLExporter][%d] AddProxySQLExporter default %+v", o._statusCode, o.Payload) } - func (o *AddProxySQLExporterDefault) GetPayload() *AddProxySQLExporterDefaultBody { return o.Payload } @@ -163,6 +162,11 @@ func (o *AddProxySQLExporterBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add proxy SQL exporter body based on context it is used +func (o *AddProxySQLExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddProxySQLExporterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -196,7 +200,7 @@ type AddProxySQLExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddProxySQLExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add proxy SQL exporter default body @@ -214,7 +218,6 @@ func (o *AddProxySQLExporterDefaultBody) Validate(formats strfmt.Registry) error } func (o *AddProxySQLExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +231,42 @@ func (o *AddProxySQLExporterDefaultBody) validateDetails(formats strfmt.Registry if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddProxySQLExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddProxySQLExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add proxy SQL exporter default body based on the context it is used +func (o *AddProxySQLExporterDefaultBody) 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 *AddProxySQLExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddProxySQLExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddProxySQLExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +295,47 @@ func (o *AddProxySQLExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddProxySQLExporterDefaultBodyDetailsItems0 add proxy SQL exporter default body details items0 +swagger:model AddProxySQLExporterDefaultBodyDetailsItems0 +*/ +type AddProxySQLExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add proxy SQL exporter default body details items0 +func (o *AddProxySQLExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add proxy SQL exporter default body details items0 based on context it is used +func (o *AddProxySQLExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddProxySQLExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddProxySQLExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddProxySQLExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddProxySQLExporterOKBody add proxy SQL exporter OK body swagger:model AddProxySQLExporterOKBody */ @@ -280,7 +360,6 @@ func (o *AddProxySQLExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *AddProxySQLExporterOKBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required return nil } @@ -289,6 +368,38 @@ func (o *AddProxySQLExporterOKBody) validateProxysqlExporter(formats strfmt.Regi if err := o.ProxysqlExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addProxySqlExporterOk" + "." + "proxysql_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addProxySqlExporterOk" + "." + "proxysql_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add proxy SQL exporter OK body based on the context it is used +func (o *AddProxySQLExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateProxysqlExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddProxySQLExporterOKBody) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.ProxysqlExporter != nil { + if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addProxySqlExporterOk" + "." + "proxysql_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addProxySqlExporterOk" + "." + "proxysql_exporter") } return err } @@ -350,6 +461,9 @@ type AddProxySQLExporterOKBodyProxysqlExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -360,9 +474,6 @@ type AddProxySQLExporterOKBodyProxysqlExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this add proxy SQL exporter OK body proxysql exporter @@ -424,7 +535,6 @@ func (o *AddProxySQLExporterOKBodyProxysqlExporter) validateStatusEnum(path, loc } func (o *AddProxySQLExporterOKBodyProxysqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -437,6 +547,11 @@ func (o *AddProxySQLExporterOKBodyProxysqlExporter) validateStatus(formats strfm return nil } +// ContextValidate validates this add proxy SQL exporter OK body proxysql exporter based on context it is used +func (o *AddProxySQLExporterOKBodyProxysqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddProxySQLExporterOKBodyProxysqlExporter) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_qan_mongo_db_profiler_agent_parameters.go b/api/inventorypb/json/client/agents/add_qan_mongo_db_profiler_agent_parameters.go index f4e50b2ca0..cb29cc7b8c 100644 --- a/api/inventorypb/json/client/agents/add_qan_mongo_db_profiler_agent_parameters.go +++ b/api/inventorypb/json/client/agents/add_qan_mongo_db_profiler_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddQANMongoDBProfilerAgentParams creates a new AddQANMongoDBProfilerAgentParams object -// with the default values initialized. +// NewAddQANMongoDBProfilerAgentParams creates a new AddQANMongoDBProfilerAgentParams 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 NewAddQANMongoDBProfilerAgentParams() *AddQANMongoDBProfilerAgentParams { - var () return &AddQANMongoDBProfilerAgentParams{ - timeout: cr.DefaultTimeout, } } // NewAddQANMongoDBProfilerAgentParamsWithTimeout creates a new AddQANMongoDBProfilerAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddQANMongoDBProfilerAgentParamsWithTimeout(timeout time.Duration) *AddQANMongoDBProfilerAgentParams { - var () return &AddQANMongoDBProfilerAgentParams{ - timeout: timeout, } } // NewAddQANMongoDBProfilerAgentParamsWithContext creates a new AddQANMongoDBProfilerAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddQANMongoDBProfilerAgentParamsWithContext(ctx context.Context) *AddQANMongoDBProfilerAgentParams { - var () return &AddQANMongoDBProfilerAgentParams{ - Context: ctx, } } // NewAddQANMongoDBProfilerAgentParamsWithHTTPClient creates a new AddQANMongoDBProfilerAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddQANMongoDBProfilerAgentParamsWithHTTPClient(client *http.Client) *AddQANMongoDBProfilerAgentParams { - var () return &AddQANMongoDBProfilerAgentParams{ HTTPClient: client, } } -/*AddQANMongoDBProfilerAgentParams contains all the parameters to send to the API endpoint -for the add QAN mongo DB profiler agent operation typically these are written to a http.Request +/* AddQANMongoDBProfilerAgentParams contains all the parameters to send to the API endpoint + for the add QAN mongo DB profiler agent operation. + + Typically these are written to a http.Request. */ type AddQANMongoDBProfilerAgentParams struct { - /*Body*/ + // Body. Body AddQANMongoDBProfilerAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type AddQANMongoDBProfilerAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add QAN mongo DB profiler agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddQANMongoDBProfilerAgentParams) WithDefaults() *AddQANMongoDBProfilerAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add QAN mongo DB profiler agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddQANMongoDBProfilerAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add QAN mongo DB profiler agent params func (o *AddQANMongoDBProfilerAgentParams) WithTimeout(timeout time.Duration) *AddQANMongoDBProfilerAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddQANMongoDBProfilerAgentParams) WriteToRequest(r runtime.ClientReques return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_qan_mongo_db_profiler_agent_responses.go b/api/inventorypb/json/client/agents/add_qan_mongo_db_profiler_agent_responses.go index bdf9b438ab..7e3c243321 100644 --- a/api/inventorypb/json/client/agents/add_qan_mongo_db_profiler_agent_responses.go +++ b/api/inventorypb/json/client/agents/add_qan_mongo_db_profiler_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddQANMongoDBProfilerAgentOK() *AddQANMongoDBProfilerAgentOK { return &AddQANMongoDBProfilerAgentOK{} } -/*AddQANMongoDBProfilerAgentOK handles this case with default header values. +/* AddQANMongoDBProfilerAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddQANMongoDBProfilerAgentOK struct { func (o *AddQANMongoDBProfilerAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddQANMongoDBProfilerAgent][%d] addQanMongoDbProfilerAgentOk %+v", 200, o.Payload) } - func (o *AddQANMongoDBProfilerAgentOK) GetPayload() *AddQANMongoDBProfilerAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddQANMongoDBProfilerAgentDefault(code int) *AddQANMongoDBProfilerAgentD } } -/*AddQANMongoDBProfilerAgentDefault handles this case with default header values. +/* AddQANMongoDBProfilerAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddQANMongoDBProfilerAgentDefault) Code() int { func (o *AddQANMongoDBProfilerAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddQANMongoDBProfilerAgent][%d] AddQANMongoDBProfilerAgent default %+v", o._statusCode, o.Payload) } - func (o *AddQANMongoDBProfilerAgentDefault) GetPayload() *AddQANMongoDBProfilerAgentDefaultBody { return o.Payload } @@ -171,6 +170,11 @@ func (o *AddQANMongoDBProfilerAgentBody) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this add QAN mongo DB profiler agent body based on context it is used +func (o *AddQANMongoDBProfilerAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddQANMongoDBProfilerAgentBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -204,7 +208,7 @@ type AddQANMongoDBProfilerAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddQANMongoDBProfilerAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add QAN mongo DB profiler agent default body @@ -222,7 +226,6 @@ func (o *AddQANMongoDBProfilerAgentDefaultBody) Validate(formats strfmt.Registry } func (o *AddQANMongoDBProfilerAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -236,6 +239,42 @@ func (o *AddQANMongoDBProfilerAgentDefaultBody) validateDetails(formats strfmt.R if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddQANMongoDBProfilerAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddQANMongoDBProfilerAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add QAN mongo DB profiler agent default body based on the context it is used +func (o *AddQANMongoDBProfilerAgentDefaultBody) 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 *AddQANMongoDBProfilerAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddQANMongoDBProfilerAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddQANMongoDBProfilerAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -264,6 +303,47 @@ func (o *AddQANMongoDBProfilerAgentDefaultBody) UnmarshalBinary(b []byte) error return nil } +/*AddQANMongoDBProfilerAgentDefaultBodyDetailsItems0 add QAN mongo DB profiler agent default body details items0 +swagger:model AddQANMongoDBProfilerAgentDefaultBodyDetailsItems0 +*/ +type AddQANMongoDBProfilerAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add QAN mongo DB profiler agent default body details items0 +func (o *AddQANMongoDBProfilerAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add QAN mongo DB profiler agent default body details items0 based on context it is used +func (o *AddQANMongoDBProfilerAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddQANMongoDBProfilerAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddQANMongoDBProfilerAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddQANMongoDBProfilerAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddQANMongoDBProfilerAgentOKBody add QAN mongo DB profiler agent OK body swagger:model AddQANMongoDBProfilerAgentOKBody */ @@ -288,7 +368,6 @@ func (o *AddQANMongoDBProfilerAgentOKBody) Validate(formats strfmt.Registry) err } func (o *AddQANMongoDBProfilerAgentOKBody) validateQANMongodbProfilerAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required return nil } @@ -297,6 +376,38 @@ func (o *AddQANMongoDBProfilerAgentOKBody) validateQANMongodbProfilerAgent(forma if err := o.QANMongodbProfilerAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addQanMongoDbProfilerAgentOk" + "." + "qan_mongodb_profiler_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addQanMongoDbProfilerAgentOk" + "." + "qan_mongodb_profiler_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add QAN mongo DB profiler agent OK body based on the context it is used +func (o *AddQANMongoDBProfilerAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateQANMongodbProfilerAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddQANMongoDBProfilerAgentOKBody) contextValidateQANMongodbProfilerAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMongodbProfilerAgent != nil { + if err := o.QANMongodbProfilerAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addQanMongoDbProfilerAgentOk" + "." + "qan_mongodb_profiler_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addQanMongoDbProfilerAgentOk" + "." + "qan_mongodb_profiler_agent") } return err } @@ -423,7 +534,6 @@ func (o *AddQANMongoDBProfilerAgentOKBodyQANMongodbProfilerAgent) validateStatus } func (o *AddQANMongoDBProfilerAgentOKBodyQANMongodbProfilerAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -436,6 +546,11 @@ func (o *AddQANMongoDBProfilerAgentOKBodyQANMongodbProfilerAgent) validateStatus return nil } +// ContextValidate validates this add QAN mongo DB profiler agent OK body QAN mongodb profiler agent based on context it is used +func (o *AddQANMongoDBProfilerAgentOKBodyQANMongodbProfilerAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddQANMongoDBProfilerAgentOKBodyQANMongodbProfilerAgent) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_qan_my_sql_perf_schema_agent_parameters.go b/api/inventorypb/json/client/agents/add_qan_my_sql_perf_schema_agent_parameters.go index cf5f13e871..0e8ed487d9 100644 --- a/api/inventorypb/json/client/agents/add_qan_my_sql_perf_schema_agent_parameters.go +++ b/api/inventorypb/json/client/agents/add_qan_my_sql_perf_schema_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddQANMySQLPerfSchemaAgentParams creates a new AddQANMySQLPerfSchemaAgentParams object -// with the default values initialized. +// NewAddQANMySQLPerfSchemaAgentParams creates a new AddQANMySQLPerfSchemaAgentParams 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 NewAddQANMySQLPerfSchemaAgentParams() *AddQANMySQLPerfSchemaAgentParams { - var () return &AddQANMySQLPerfSchemaAgentParams{ - timeout: cr.DefaultTimeout, } } // NewAddQANMySQLPerfSchemaAgentParamsWithTimeout creates a new AddQANMySQLPerfSchemaAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddQANMySQLPerfSchemaAgentParamsWithTimeout(timeout time.Duration) *AddQANMySQLPerfSchemaAgentParams { - var () return &AddQANMySQLPerfSchemaAgentParams{ - timeout: timeout, } } // NewAddQANMySQLPerfSchemaAgentParamsWithContext creates a new AddQANMySQLPerfSchemaAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddQANMySQLPerfSchemaAgentParamsWithContext(ctx context.Context) *AddQANMySQLPerfSchemaAgentParams { - var () return &AddQANMySQLPerfSchemaAgentParams{ - Context: ctx, } } // NewAddQANMySQLPerfSchemaAgentParamsWithHTTPClient creates a new AddQANMySQLPerfSchemaAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddQANMySQLPerfSchemaAgentParamsWithHTTPClient(client *http.Client) *AddQANMySQLPerfSchemaAgentParams { - var () return &AddQANMySQLPerfSchemaAgentParams{ HTTPClient: client, } } -/*AddQANMySQLPerfSchemaAgentParams contains all the parameters to send to the API endpoint -for the add QAN my SQL perf schema agent operation typically these are written to a http.Request +/* AddQANMySQLPerfSchemaAgentParams contains all the parameters to send to the API endpoint + for the add QAN my SQL perf schema agent operation. + + Typically these are written to a http.Request. */ type AddQANMySQLPerfSchemaAgentParams struct { - /*Body*/ + // Body. Body AddQANMySQLPerfSchemaAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type AddQANMySQLPerfSchemaAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add QAN my SQL perf schema agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddQANMySQLPerfSchemaAgentParams) WithDefaults() *AddQANMySQLPerfSchemaAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add QAN my SQL perf schema agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddQANMySQLPerfSchemaAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add QAN my SQL perf schema agent params func (o *AddQANMySQLPerfSchemaAgentParams) WithTimeout(timeout time.Duration) *AddQANMySQLPerfSchemaAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddQANMySQLPerfSchemaAgentParams) WriteToRequest(r runtime.ClientReques return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_qan_my_sql_perf_schema_agent_responses.go b/api/inventorypb/json/client/agents/add_qan_my_sql_perf_schema_agent_responses.go index 0d6638f1be..c839314534 100644 --- a/api/inventorypb/json/client/agents/add_qan_my_sql_perf_schema_agent_responses.go +++ b/api/inventorypb/json/client/agents/add_qan_my_sql_perf_schema_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddQANMySQLPerfSchemaAgentOK() *AddQANMySQLPerfSchemaAgentOK { return &AddQANMySQLPerfSchemaAgentOK{} } -/*AddQANMySQLPerfSchemaAgentOK handles this case with default header values. +/* AddQANMySQLPerfSchemaAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddQANMySQLPerfSchemaAgentOK struct { func (o *AddQANMySQLPerfSchemaAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddQANMySQLPerfSchemaAgent][%d] addQanMySqlPerfSchemaAgentOk %+v", 200, o.Payload) } - func (o *AddQANMySQLPerfSchemaAgentOK) GetPayload() *AddQANMySQLPerfSchemaAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddQANMySQLPerfSchemaAgentDefault(code int) *AddQANMySQLPerfSchemaAgentD } } -/*AddQANMySQLPerfSchemaAgentDefault handles this case with default header values. +/* AddQANMySQLPerfSchemaAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddQANMySQLPerfSchemaAgentDefault) Code() int { func (o *AddQANMySQLPerfSchemaAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddQANMySQLPerfSchemaAgent][%d] AddQANMySQLPerfSchemaAgent default %+v", o._statusCode, o.Payload) } - func (o *AddQANMySQLPerfSchemaAgentDefault) GetPayload() *AddQANMySQLPerfSchemaAgentDefaultBody { return o.Payload } @@ -166,6 +165,11 @@ func (o *AddQANMySQLPerfSchemaAgentBody) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this add QAN my SQL perf schema agent body based on context it is used +func (o *AddQANMySQLPerfSchemaAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddQANMySQLPerfSchemaAgentBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -199,7 +203,7 @@ type AddQANMySQLPerfSchemaAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add QAN my SQL perf schema agent default body @@ -217,7 +221,6 @@ func (o *AddQANMySQLPerfSchemaAgentDefaultBody) Validate(formats strfmt.Registry } func (o *AddQANMySQLPerfSchemaAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -231,6 +234,42 @@ func (o *AddQANMySQLPerfSchemaAgentDefaultBody) validateDetails(formats strfmt.R if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddQANMySQLPerfSchemaAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddQANMySQLPerfSchemaAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add QAN my SQL perf schema agent default body based on the context it is used +func (o *AddQANMySQLPerfSchemaAgentDefaultBody) 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 *AddQANMySQLPerfSchemaAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddQANMySQLPerfSchemaAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddQANMySQLPerfSchemaAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -259,6 +298,47 @@ func (o *AddQANMySQLPerfSchemaAgentDefaultBody) UnmarshalBinary(b []byte) error return nil } +/*AddQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0 add QAN my SQL perf schema agent default body details items0 +swagger:model AddQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0 +*/ +type AddQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add QAN my SQL perf schema agent default body details items0 +func (o *AddQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add QAN my SQL perf schema agent default body details items0 based on context it is used +func (o *AddQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddQANMySQLPerfSchemaAgentOKBody add QAN my SQL perf schema agent OK body swagger:model AddQANMySQLPerfSchemaAgentOKBody */ @@ -283,7 +363,6 @@ func (o *AddQANMySQLPerfSchemaAgentOKBody) Validate(formats strfmt.Registry) err } func (o *AddQANMySQLPerfSchemaAgentOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required return nil } @@ -292,6 +371,38 @@ func (o *AddQANMySQLPerfSchemaAgentOKBody) validateQANMysqlPerfschemaAgent(forma if err := o.QANMysqlPerfschemaAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addQanMySqlPerfSchemaAgentOk" + "." + "qan_mysql_perfschema_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addQanMySqlPerfSchemaAgentOk" + "." + "qan_mysql_perfschema_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add QAN my SQL perf schema agent OK body based on the context it is used +func (o *AddQANMySQLPerfSchemaAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateQANMysqlPerfschemaAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddQANMySQLPerfSchemaAgentOKBody) contextValidateQANMysqlPerfschemaAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMysqlPerfschemaAgent != nil { + if err := o.QANMysqlPerfschemaAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addQanMySqlPerfSchemaAgentOk" + "." + "qan_mysql_perfschema_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addQanMySqlPerfSchemaAgentOk" + "." + "qan_mysql_perfschema_agent") } return err } @@ -430,7 +541,6 @@ func (o *AddQANMySQLPerfSchemaAgentOKBodyQANMysqlPerfschemaAgent) validateStatus } func (o *AddQANMySQLPerfSchemaAgentOKBodyQANMysqlPerfschemaAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -443,6 +553,11 @@ func (o *AddQANMySQLPerfSchemaAgentOKBodyQANMysqlPerfschemaAgent) validateStatus return nil } +// ContextValidate validates this add QAN my SQL perf schema agent OK body QAN mysql perfschema agent based on context it is used +func (o *AddQANMySQLPerfSchemaAgentOKBodyQANMysqlPerfschemaAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddQANMySQLPerfSchemaAgentOKBodyQANMysqlPerfschemaAgent) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_qan_my_sql_slowlog_agent_parameters.go b/api/inventorypb/json/client/agents/add_qan_my_sql_slowlog_agent_parameters.go index 6999b02ae9..4879f9cc23 100644 --- a/api/inventorypb/json/client/agents/add_qan_my_sql_slowlog_agent_parameters.go +++ b/api/inventorypb/json/client/agents/add_qan_my_sql_slowlog_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddQANMySQLSlowlogAgentParams creates a new AddQANMySQLSlowlogAgentParams object -// with the default values initialized. +// NewAddQANMySQLSlowlogAgentParams creates a new AddQANMySQLSlowlogAgentParams 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 NewAddQANMySQLSlowlogAgentParams() *AddQANMySQLSlowlogAgentParams { - var () return &AddQANMySQLSlowlogAgentParams{ - timeout: cr.DefaultTimeout, } } // NewAddQANMySQLSlowlogAgentParamsWithTimeout creates a new AddQANMySQLSlowlogAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddQANMySQLSlowlogAgentParamsWithTimeout(timeout time.Duration) *AddQANMySQLSlowlogAgentParams { - var () return &AddQANMySQLSlowlogAgentParams{ - timeout: timeout, } } // NewAddQANMySQLSlowlogAgentParamsWithContext creates a new AddQANMySQLSlowlogAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddQANMySQLSlowlogAgentParamsWithContext(ctx context.Context) *AddQANMySQLSlowlogAgentParams { - var () return &AddQANMySQLSlowlogAgentParams{ - Context: ctx, } } // NewAddQANMySQLSlowlogAgentParamsWithHTTPClient creates a new AddQANMySQLSlowlogAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddQANMySQLSlowlogAgentParamsWithHTTPClient(client *http.Client) *AddQANMySQLSlowlogAgentParams { - var () return &AddQANMySQLSlowlogAgentParams{ HTTPClient: client, } } -/*AddQANMySQLSlowlogAgentParams contains all the parameters to send to the API endpoint -for the add QAN my SQL slowlog agent operation typically these are written to a http.Request +/* AddQANMySQLSlowlogAgentParams contains all the parameters to send to the API endpoint + for the add QAN my SQL slowlog agent operation. + + Typically these are written to a http.Request. */ type AddQANMySQLSlowlogAgentParams struct { - /*Body*/ + // Body. Body AddQANMySQLSlowlogAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type AddQANMySQLSlowlogAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add QAN my SQL slowlog agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddQANMySQLSlowlogAgentParams) WithDefaults() *AddQANMySQLSlowlogAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add QAN my SQL slowlog agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddQANMySQLSlowlogAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add QAN my SQL slowlog agent params func (o *AddQANMySQLSlowlogAgentParams) WithTimeout(timeout time.Duration) *AddQANMySQLSlowlogAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddQANMySQLSlowlogAgentParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_qan_my_sql_slowlog_agent_responses.go b/api/inventorypb/json/client/agents/add_qan_my_sql_slowlog_agent_responses.go index 02c8b659ae..8ada192a9d 100644 --- a/api/inventorypb/json/client/agents/add_qan_my_sql_slowlog_agent_responses.go +++ b/api/inventorypb/json/client/agents/add_qan_my_sql_slowlog_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddQANMySQLSlowlogAgentOK() *AddQANMySQLSlowlogAgentOK { return &AddQANMySQLSlowlogAgentOK{} } -/*AddQANMySQLSlowlogAgentOK handles this case with default header values. +/* AddQANMySQLSlowlogAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddQANMySQLSlowlogAgentOK struct { func (o *AddQANMySQLSlowlogAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddQANMySQLSlowlogAgent][%d] addQanMySqlSlowlogAgentOk %+v", 200, o.Payload) } - func (o *AddQANMySQLSlowlogAgentOK) GetPayload() *AddQANMySQLSlowlogAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddQANMySQLSlowlogAgentDefault(code int) *AddQANMySQLSlowlogAgentDefault } } -/*AddQANMySQLSlowlogAgentDefault handles this case with default header values. +/* AddQANMySQLSlowlogAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddQANMySQLSlowlogAgentDefault) Code() int { func (o *AddQANMySQLSlowlogAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddQANMySQLSlowlogAgent][%d] AddQANMySQLSlowlogAgent default %+v", o._statusCode, o.Payload) } - func (o *AddQANMySQLSlowlogAgentDefault) GetPayload() *AddQANMySQLSlowlogAgentDefaultBody { return o.Payload } @@ -170,6 +169,11 @@ func (o *AddQANMySQLSlowlogAgentBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add QAN my SQL slowlog agent body based on context it is used +func (o *AddQANMySQLSlowlogAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddQANMySQLSlowlogAgentBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -203,7 +207,7 @@ type AddQANMySQLSlowlogAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddQANMySQLSlowlogAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add QAN my SQL slowlog agent default body @@ -221,7 +225,6 @@ func (o *AddQANMySQLSlowlogAgentDefaultBody) Validate(formats strfmt.Registry) e } func (o *AddQANMySQLSlowlogAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -235,6 +238,42 @@ func (o *AddQANMySQLSlowlogAgentDefaultBody) validateDetails(formats strfmt.Regi if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddQANMySQLSlowlogAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddQANMySQLSlowlogAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add QAN my SQL slowlog agent default body based on the context it is used +func (o *AddQANMySQLSlowlogAgentDefaultBody) 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 *AddQANMySQLSlowlogAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddQANMySQLSlowlogAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddQANMySQLSlowlogAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -263,6 +302,47 @@ func (o *AddQANMySQLSlowlogAgentDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddQANMySQLSlowlogAgentDefaultBodyDetailsItems0 add QAN my SQL slowlog agent default body details items0 +swagger:model AddQANMySQLSlowlogAgentDefaultBodyDetailsItems0 +*/ +type AddQANMySQLSlowlogAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add QAN my SQL slowlog agent default body details items0 +func (o *AddQANMySQLSlowlogAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add QAN my SQL slowlog agent default body details items0 based on context it is used +func (o *AddQANMySQLSlowlogAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddQANMySQLSlowlogAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddQANMySQLSlowlogAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddQANMySQLSlowlogAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddQANMySQLSlowlogAgentOKBody add QAN my SQL slowlog agent OK body swagger:model AddQANMySQLSlowlogAgentOKBody */ @@ -287,7 +367,6 @@ func (o *AddQANMySQLSlowlogAgentOKBody) Validate(formats strfmt.Registry) error } func (o *AddQANMySQLSlowlogAgentOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required return nil } @@ -296,6 +375,38 @@ func (o *AddQANMySQLSlowlogAgentOKBody) validateQANMysqlSlowlogAgent(formats str if err := o.QANMysqlSlowlogAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addQanMySqlSlowlogAgentOk" + "." + "qan_mysql_slowlog_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addQanMySqlSlowlogAgentOk" + "." + "qan_mysql_slowlog_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add QAN my SQL slowlog agent OK body based on the context it is used +func (o *AddQANMySQLSlowlogAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateQANMysqlSlowlogAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddQANMySQLSlowlogAgentOKBody) contextValidateQANMysqlSlowlogAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMysqlSlowlogAgent != nil { + if err := o.QANMysqlSlowlogAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addQanMySqlSlowlogAgentOk" + "." + "qan_mysql_slowlog_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addQanMySqlSlowlogAgentOk" + "." + "qan_mysql_slowlog_agent") } return err } @@ -437,7 +548,6 @@ func (o *AddQANMySQLSlowlogAgentOKBodyQANMysqlSlowlogAgent) validateStatusEnum(p } func (o *AddQANMySQLSlowlogAgentOKBodyQANMysqlSlowlogAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -450,6 +560,11 @@ func (o *AddQANMySQLSlowlogAgentOKBodyQANMysqlSlowlogAgent) validateStatus(forma return nil } +// ContextValidate validates this add QAN my SQL slowlog agent OK body QAN mysql slowlog agent based on context it is used +func (o *AddQANMySQLSlowlogAgentOKBodyQANMysqlSlowlogAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddQANMySQLSlowlogAgentOKBodyQANMysqlSlowlogAgent) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_stat_monitor_agent_parameters.go b/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_stat_monitor_agent_parameters.go index 8221570613..6209ce4203 100644 --- a/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_stat_monitor_agent_parameters.go +++ b/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_stat_monitor_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddQANPostgreSQLPgStatMonitorAgentParams creates a new AddQANPostgreSQLPgStatMonitorAgentParams object -// with the default values initialized. +// NewAddQANPostgreSQLPgStatMonitorAgentParams creates a new AddQANPostgreSQLPgStatMonitorAgentParams 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 NewAddQANPostgreSQLPgStatMonitorAgentParams() *AddQANPostgreSQLPgStatMonitorAgentParams { - var () return &AddQANPostgreSQLPgStatMonitorAgentParams{ - timeout: cr.DefaultTimeout, } } // NewAddQANPostgreSQLPgStatMonitorAgentParamsWithTimeout creates a new AddQANPostgreSQLPgStatMonitorAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddQANPostgreSQLPgStatMonitorAgentParamsWithTimeout(timeout time.Duration) *AddQANPostgreSQLPgStatMonitorAgentParams { - var () return &AddQANPostgreSQLPgStatMonitorAgentParams{ - timeout: timeout, } } // NewAddQANPostgreSQLPgStatMonitorAgentParamsWithContext creates a new AddQANPostgreSQLPgStatMonitorAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddQANPostgreSQLPgStatMonitorAgentParamsWithContext(ctx context.Context) *AddQANPostgreSQLPgStatMonitorAgentParams { - var () return &AddQANPostgreSQLPgStatMonitorAgentParams{ - Context: ctx, } } // NewAddQANPostgreSQLPgStatMonitorAgentParamsWithHTTPClient creates a new AddQANPostgreSQLPgStatMonitorAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddQANPostgreSQLPgStatMonitorAgentParamsWithHTTPClient(client *http.Client) *AddQANPostgreSQLPgStatMonitorAgentParams { - var () return &AddQANPostgreSQLPgStatMonitorAgentParams{ HTTPClient: client, } } -/*AddQANPostgreSQLPgStatMonitorAgentParams contains all the parameters to send to the API endpoint -for the add QAN postgre SQL pg stat monitor agent operation typically these are written to a http.Request +/* AddQANPostgreSQLPgStatMonitorAgentParams contains all the parameters to send to the API endpoint + for the add QAN postgre SQL pg stat monitor agent operation. + + Typically these are written to a http.Request. */ type AddQANPostgreSQLPgStatMonitorAgentParams struct { - /*Body*/ + // Body. Body AddQANPostgreSQLPgStatMonitorAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type AddQANPostgreSQLPgStatMonitorAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add QAN postgre SQL pg stat monitor agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddQANPostgreSQLPgStatMonitorAgentParams) WithDefaults() *AddQANPostgreSQLPgStatMonitorAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add QAN postgre SQL pg stat monitor agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddQANPostgreSQLPgStatMonitorAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add QAN postgre SQL pg stat monitor agent params func (o *AddQANPostgreSQLPgStatMonitorAgentParams) WithTimeout(timeout time.Duration) *AddQANPostgreSQLPgStatMonitorAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddQANPostgreSQLPgStatMonitorAgentParams) WriteToRequest(r runtime.Clie return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_stat_monitor_agent_responses.go b/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_stat_monitor_agent_responses.go index ffb3292783..1f328ea233 100644 --- a/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_stat_monitor_agent_responses.go +++ b/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_stat_monitor_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddQANPostgreSQLPgStatMonitorAgentOK() *AddQANPostgreSQLPgStatMonitorAge return &AddQANPostgreSQLPgStatMonitorAgentOK{} } -/*AddQANPostgreSQLPgStatMonitorAgentOK handles this case with default header values. +/* AddQANPostgreSQLPgStatMonitorAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddQANPostgreSQLPgStatMonitorAgentOK struct { func (o *AddQANPostgreSQLPgStatMonitorAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddQANPostgreSQLPgStatMonitorAgent][%d] addQanPostgreSqlPgStatMonitorAgentOk %+v", 200, o.Payload) } - func (o *AddQANPostgreSQLPgStatMonitorAgentOK) GetPayload() *AddQANPostgreSQLPgStatMonitorAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddQANPostgreSQLPgStatMonitorAgentDefault(code int) *AddQANPostgreSQLPgS } } -/*AddQANPostgreSQLPgStatMonitorAgentDefault handles this case with default header values. +/* AddQANPostgreSQLPgStatMonitorAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddQANPostgreSQLPgStatMonitorAgentDefault) Code() int { func (o *AddQANPostgreSQLPgStatMonitorAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddQANPostgreSQLPgStatMonitorAgent][%d] AddQANPostgreSQLPgStatMonitorAgent default %+v", o._statusCode, o.Payload) } - func (o *AddQANPostgreSQLPgStatMonitorAgentDefault) GetPayload() *AddQANPostgreSQLPgStatMonitorAgentDefaultBody { return o.Payload } @@ -166,6 +165,11 @@ func (o *AddQANPostgreSQLPgStatMonitorAgentBody) Validate(formats strfmt.Registr return nil } +// ContextValidate validates this add QAN postgre SQL pg stat monitor agent body based on context it is used +func (o *AddQANPostgreSQLPgStatMonitorAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddQANPostgreSQLPgStatMonitorAgentBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -199,7 +203,7 @@ type AddQANPostgreSQLPgStatMonitorAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add QAN postgre SQL pg stat monitor agent default body @@ -217,7 +221,6 @@ func (o *AddQANPostgreSQLPgStatMonitorAgentDefaultBody) Validate(formats strfmt. } func (o *AddQANPostgreSQLPgStatMonitorAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -231,6 +234,42 @@ func (o *AddQANPostgreSQLPgStatMonitorAgentDefaultBody) validateDetails(formats if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddQANPostgreSQLPgStatMonitorAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddQANPostgreSQLPgStatMonitorAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add QAN postgre SQL pg stat monitor agent default body based on the context it is used +func (o *AddQANPostgreSQLPgStatMonitorAgentDefaultBody) 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 *AddQANPostgreSQLPgStatMonitorAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddQANPostgreSQLPgStatMonitorAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddQANPostgreSQLPgStatMonitorAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -259,6 +298,47 @@ func (o *AddQANPostgreSQLPgStatMonitorAgentDefaultBody) UnmarshalBinary(b []byte return nil } +/*AddQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0 add QAN postgre SQL pg stat monitor agent default body details items0 +swagger:model AddQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0 +*/ +type AddQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add QAN postgre SQL pg stat monitor agent default body details items0 +func (o *AddQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add QAN postgre SQL pg stat monitor agent default body details items0 based on context it is used +func (o *AddQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddQANPostgreSQLPgStatMonitorAgentOKBody add QAN postgre SQL pg stat monitor agent OK body swagger:model AddQANPostgreSQLPgStatMonitorAgentOKBody */ @@ -283,7 +363,6 @@ func (o *AddQANPostgreSQLPgStatMonitorAgentOKBody) Validate(formats strfmt.Regis } func (o *AddQANPostgreSQLPgStatMonitorAgentOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required return nil } @@ -292,6 +371,38 @@ func (o *AddQANPostgreSQLPgStatMonitorAgentOKBody) validateQANPostgresqlPgstatmo if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addQanPostgreSqlPgStatMonitorAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addQanPostgreSqlPgStatMonitorAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add QAN postgre SQL pg stat monitor agent OK body based on the context it is used +func (o *AddQANPostgreSQLPgStatMonitorAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateQANPostgresqlPgstatmonitorAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddQANPostgreSQLPgStatMonitorAgentOKBody) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANPostgresqlPgstatmonitorAgent != nil { + if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addQanPostgreSqlPgStatMonitorAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addQanPostgreSqlPgStatMonitorAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") } return err } @@ -421,7 +532,6 @@ func (o *AddQANPostgreSQLPgStatMonitorAgentOKBodyQANPostgresqlPgstatmonitorAgent } func (o *AddQANPostgreSQLPgStatMonitorAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -434,6 +544,11 @@ func (o *AddQANPostgreSQLPgStatMonitorAgentOKBodyQANPostgresqlPgstatmonitorAgent return nil } +// ContextValidate validates this add QAN postgre SQL pg stat monitor agent OK body QAN postgresql pgstatmonitor agent based on context it is used +func (o *AddQANPostgreSQLPgStatMonitorAgentOKBodyQANPostgresqlPgstatmonitorAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddQANPostgreSQLPgStatMonitorAgentOKBodyQANPostgresqlPgstatmonitorAgent) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_statements_agent_parameters.go b/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_statements_agent_parameters.go index 0c08fe277c..e7b7496279 100644 --- a/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_statements_agent_parameters.go +++ b/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_statements_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddQANPostgreSQLPgStatementsAgentParams creates a new AddQANPostgreSQLPgStatementsAgentParams object -// with the default values initialized. +// NewAddQANPostgreSQLPgStatementsAgentParams creates a new AddQANPostgreSQLPgStatementsAgentParams 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 NewAddQANPostgreSQLPgStatementsAgentParams() *AddQANPostgreSQLPgStatementsAgentParams { - var () return &AddQANPostgreSQLPgStatementsAgentParams{ - timeout: cr.DefaultTimeout, } } // NewAddQANPostgreSQLPgStatementsAgentParamsWithTimeout creates a new AddQANPostgreSQLPgStatementsAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddQANPostgreSQLPgStatementsAgentParamsWithTimeout(timeout time.Duration) *AddQANPostgreSQLPgStatementsAgentParams { - var () return &AddQANPostgreSQLPgStatementsAgentParams{ - timeout: timeout, } } // NewAddQANPostgreSQLPgStatementsAgentParamsWithContext creates a new AddQANPostgreSQLPgStatementsAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddQANPostgreSQLPgStatementsAgentParamsWithContext(ctx context.Context) *AddQANPostgreSQLPgStatementsAgentParams { - var () return &AddQANPostgreSQLPgStatementsAgentParams{ - Context: ctx, } } // NewAddQANPostgreSQLPgStatementsAgentParamsWithHTTPClient creates a new AddQANPostgreSQLPgStatementsAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddQANPostgreSQLPgStatementsAgentParamsWithHTTPClient(client *http.Client) *AddQANPostgreSQLPgStatementsAgentParams { - var () return &AddQANPostgreSQLPgStatementsAgentParams{ HTTPClient: client, } } -/*AddQANPostgreSQLPgStatementsAgentParams contains all the parameters to send to the API endpoint -for the add QAN postgre SQL pg statements agent operation typically these are written to a http.Request +/* AddQANPostgreSQLPgStatementsAgentParams contains all the parameters to send to the API endpoint + for the add QAN postgre SQL pg statements agent operation. + + Typically these are written to a http.Request. */ type AddQANPostgreSQLPgStatementsAgentParams struct { - /*Body*/ + // Body. Body AddQANPostgreSQLPgStatementsAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type AddQANPostgreSQLPgStatementsAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add QAN postgre SQL pg statements agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddQANPostgreSQLPgStatementsAgentParams) WithDefaults() *AddQANPostgreSQLPgStatementsAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add QAN postgre SQL pg statements agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddQANPostgreSQLPgStatementsAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add QAN postgre SQL pg statements agent params func (o *AddQANPostgreSQLPgStatementsAgentParams) WithTimeout(timeout time.Duration) *AddQANPostgreSQLPgStatementsAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddQANPostgreSQLPgStatementsAgentParams) WriteToRequest(r runtime.Clien return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_statements_agent_responses.go b/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_statements_agent_responses.go index 798c1b9681..6e585176f7 100644 --- a/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_statements_agent_responses.go +++ b/api/inventorypb/json/client/agents/add_qan_postgre_sql_pg_statements_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddQANPostgreSQLPgStatementsAgentOK() *AddQANPostgreSQLPgStatementsAgent return &AddQANPostgreSQLPgStatementsAgentOK{} } -/*AddQANPostgreSQLPgStatementsAgentOK handles this case with default header values. +/* AddQANPostgreSQLPgStatementsAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddQANPostgreSQLPgStatementsAgentOK struct { func (o *AddQANPostgreSQLPgStatementsAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddQANPostgreSQLPgStatementsAgent][%d] addQanPostgreSqlPgStatementsAgentOk %+v", 200, o.Payload) } - func (o *AddQANPostgreSQLPgStatementsAgentOK) GetPayload() *AddQANPostgreSQLPgStatementsAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddQANPostgreSQLPgStatementsAgentDefault(code int) *AddQANPostgreSQLPgSt } } -/*AddQANPostgreSQLPgStatementsAgentDefault handles this case with default header values. +/* AddQANPostgreSQLPgStatementsAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddQANPostgreSQLPgStatementsAgentDefault) Code() int { func (o *AddQANPostgreSQLPgStatementsAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddQANPostgreSQLPgStatementsAgent][%d] AddQANPostgreSQLPgStatementsAgent default %+v", o._statusCode, o.Payload) } - func (o *AddQANPostgreSQLPgStatementsAgentDefault) GetPayload() *AddQANPostgreSQLPgStatementsAgentDefaultBody { return o.Payload } @@ -163,6 +162,11 @@ func (o *AddQANPostgreSQLPgStatementsAgentBody) Validate(formats strfmt.Registry return nil } +// ContextValidate validates this add QAN postgre SQL pg statements agent body based on context it is used +func (o *AddQANPostgreSQLPgStatementsAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddQANPostgreSQLPgStatementsAgentBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -196,7 +200,7 @@ type AddQANPostgreSQLPgStatementsAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add QAN postgre SQL pg statements agent default body @@ -214,7 +218,6 @@ func (o *AddQANPostgreSQLPgStatementsAgentDefaultBody) Validate(formats strfmt.R } func (o *AddQANPostgreSQLPgStatementsAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +231,42 @@ func (o *AddQANPostgreSQLPgStatementsAgentDefaultBody) validateDetails(formats s if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddQANPostgreSQLPgStatementsAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddQANPostgreSQLPgStatementsAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add QAN postgre SQL pg statements agent default body based on the context it is used +func (o *AddQANPostgreSQLPgStatementsAgentDefaultBody) 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 *AddQANPostgreSQLPgStatementsAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddQANPostgreSQLPgStatementsAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddQANPostgreSQLPgStatementsAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +295,47 @@ func (o *AddQANPostgreSQLPgStatementsAgentDefaultBody) UnmarshalBinary(b []byte) return nil } +/*AddQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0 add QAN postgre SQL pg statements agent default body details items0 +swagger:model AddQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0 +*/ +type AddQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add QAN postgre SQL pg statements agent default body details items0 +func (o *AddQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add QAN postgre SQL pg statements agent default body details items0 based on context it is used +func (o *AddQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddQANPostgreSQLPgStatementsAgentOKBody add QAN postgre SQL pg statements agent OK body swagger:model AddQANPostgreSQLPgStatementsAgentOKBody */ @@ -280,7 +360,6 @@ func (o *AddQANPostgreSQLPgStatementsAgentOKBody) Validate(formats strfmt.Regist } func (o *AddQANPostgreSQLPgStatementsAgentOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required return nil } @@ -289,6 +368,38 @@ func (o *AddQANPostgreSQLPgStatementsAgentOKBody) validateQANPostgresqlPgstateme if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addQanPostgreSqlPgStatementsAgentOk" + "." + "qan_postgresql_pgstatements_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addQanPostgreSqlPgStatementsAgentOk" + "." + "qan_postgresql_pgstatements_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add QAN postgre SQL pg statements agent OK body based on the context it is used +func (o *AddQANPostgreSQLPgStatementsAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateQANPostgresqlPgstatementsAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddQANPostgreSQLPgStatementsAgentOKBody) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANPostgresqlPgstatementsAgent != nil { + if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addQanPostgreSqlPgStatementsAgentOk" + "." + "qan_postgresql_pgstatements_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addQanPostgreSqlPgStatementsAgentOk" + "." + "qan_postgresql_pgstatements_agent") } return err } @@ -415,7 +526,6 @@ func (o *AddQANPostgreSQLPgStatementsAgentOKBodyQANPostgresqlPgstatementsAgent) } func (o *AddQANPostgreSQLPgStatementsAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -428,6 +538,11 @@ func (o *AddQANPostgreSQLPgStatementsAgentOKBodyQANPostgresqlPgstatementsAgent) return nil } +// ContextValidate validates this add QAN postgre SQL pg statements agent OK body QAN postgresql pgstatements agent based on context it is used +func (o *AddQANPostgreSQLPgStatementsAgentOKBodyQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddQANPostgreSQLPgStatementsAgentOKBodyQANPostgresqlPgstatementsAgent) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/add_rds_exporter_parameters.go b/api/inventorypb/json/client/agents/add_rds_exporter_parameters.go index 962fff831a..59b9dda2eb 100644 --- a/api/inventorypb/json/client/agents/add_rds_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/add_rds_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddRDSExporterParams creates a new AddRDSExporterParams object -// with the default values initialized. +// NewAddRDSExporterParams creates a new AddRDSExporterParams 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 NewAddRDSExporterParams() *AddRDSExporterParams { - var () return &AddRDSExporterParams{ - timeout: cr.DefaultTimeout, } } // NewAddRDSExporterParamsWithTimeout creates a new AddRDSExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddRDSExporterParamsWithTimeout(timeout time.Duration) *AddRDSExporterParams { - var () return &AddRDSExporterParams{ - timeout: timeout, } } // NewAddRDSExporterParamsWithContext creates a new AddRDSExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddRDSExporterParamsWithContext(ctx context.Context) *AddRDSExporterParams { - var () return &AddRDSExporterParams{ - Context: ctx, } } // NewAddRDSExporterParamsWithHTTPClient creates a new AddRDSExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddRDSExporterParamsWithHTTPClient(client *http.Client) *AddRDSExporterParams { - var () return &AddRDSExporterParams{ HTTPClient: client, } } -/*AddRDSExporterParams contains all the parameters to send to the API endpoint -for the add RDS exporter operation typically these are written to a http.Request +/* AddRDSExporterParams contains all the parameters to send to the API endpoint + for the add RDS exporter operation. + + Typically these are written to a http.Request. */ type AddRDSExporterParams struct { - /*Body*/ + // Body. Body AddRDSExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type AddRDSExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add RDS exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRDSExporterParams) WithDefaults() *AddRDSExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add RDS exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRDSExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add RDS exporter params func (o *AddRDSExporterParams) WithTimeout(timeout time.Duration) *AddRDSExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddRDSExporterParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/add_rds_exporter_responses.go b/api/inventorypb/json/client/agents/add_rds_exporter_responses.go index 3cb77bc89c..dd94d6b5e3 100644 --- a/api/inventorypb/json/client/agents/add_rds_exporter_responses.go +++ b/api/inventorypb/json/client/agents/add_rds_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddRDSExporterOK() *AddRDSExporterOK { return &AddRDSExporterOK{} } -/*AddRDSExporterOK handles this case with default header values. +/* AddRDSExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddRDSExporterOK struct { func (o *AddRDSExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddRDSExporter][%d] addRdsExporterOk %+v", 200, o.Payload) } - func (o *AddRDSExporterOK) GetPayload() *AddRDSExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddRDSExporterDefault(code int) *AddRDSExporterDefault { } } -/*AddRDSExporterDefault handles this case with default header values. +/* AddRDSExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddRDSExporterDefault) Code() int { func (o *AddRDSExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/AddRDSExporter][%d] AddRDSExporter default %+v", o._statusCode, o.Payload) } - func (o *AddRDSExporterDefault) GetPayload() *AddRDSExporterDefaultBody { return o.Payload } @@ -157,6 +156,11 @@ func (o *AddRDSExporterBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add RDS exporter body based on context it is used +func (o *AddRDSExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRDSExporterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -190,7 +194,7 @@ type AddRDSExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddRDSExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add RDS exporter default body @@ -208,7 +212,6 @@ func (o *AddRDSExporterDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddRDSExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -222,6 +225,42 @@ func (o *AddRDSExporterDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddRDSExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddRDSExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add RDS exporter default body based on the context it is used +func (o *AddRDSExporterDefaultBody) 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 *AddRDSExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddRDSExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddRDSExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -250,6 +289,47 @@ func (o *AddRDSExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddRDSExporterDefaultBodyDetailsItems0 add RDS exporter default body details items0 +swagger:model AddRDSExporterDefaultBodyDetailsItems0 +*/ +type AddRDSExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add RDS exporter default body details items0 +func (o *AddRDSExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add RDS exporter default body details items0 based on context it is used +func (o *AddRDSExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddRDSExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddRDSExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddRDSExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddRDSExporterOKBody add RDS exporter OK body swagger:model AddRDSExporterOKBody */ @@ -274,7 +354,6 @@ func (o *AddRDSExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *AddRDSExporterOKBody) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required return nil } @@ -283,6 +362,38 @@ func (o *AddRDSExporterOKBody) validateRDSExporter(formats strfmt.Registry) erro if err := o.RDSExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRdsExporterOk" + "." + "rds_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsExporterOk" + "." + "rds_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add RDS exporter OK body based on the context it is used +func (o *AddRDSExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateRDSExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddRDSExporterOKBody) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.RDSExporter != nil { + if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRdsExporterOk" + "." + "rds_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsExporterOk" + "." + "rds_exporter") } return err } @@ -332,17 +443,6 @@ type AddRDSExporterOKBodyRDSExporter struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics (the same for several configurations). ListenPort int64 `json:"listen_port,omitempty"` @@ -354,6 +454,17 @@ type AddRDSExporterOKBodyRDSExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,omitempty"` } // Validate validates this add RDS exporter OK body RDS exporter @@ -415,7 +526,6 @@ func (o *AddRDSExporterOKBodyRDSExporter) validateStatusEnum(path, location stri } func (o *AddRDSExporterOKBodyRDSExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -428,6 +538,11 @@ func (o *AddRDSExporterOKBodyRDSExporter) validateStatus(formats strfmt.Registry return nil } +// ContextValidate validates this add RDS exporter OK body RDS exporter based on context it is used +func (o *AddRDSExporterOKBodyRDSExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRDSExporterOKBodyRDSExporter) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/agents_client.go b/api/inventorypb/json/client/agents/agents_client.go index 22960fe0cd..0ff0d5e8e6 100644 --- a/api/inventorypb/json/client/agents/agents_client.go +++ b/api/inventorypb/json/client/agents/agents_client.go @@ -23,67 +23,70 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddAzureDatabaseExporter(params *AddAzureDatabaseExporterParams) (*AddAzureDatabaseExporterOK, error) + AddAzureDatabaseExporter(params *AddAzureDatabaseExporterParams, opts ...ClientOption) (*AddAzureDatabaseExporterOK, error) - AddExternalExporter(params *AddExternalExporterParams) (*AddExternalExporterOK, error) + AddExternalExporter(params *AddExternalExporterParams, opts ...ClientOption) (*AddExternalExporterOK, error) - AddMongoDBExporter(params *AddMongoDBExporterParams) (*AddMongoDBExporterOK, error) + AddMongoDBExporter(params *AddMongoDBExporterParams, opts ...ClientOption) (*AddMongoDBExporterOK, error) - AddMySQLdExporter(params *AddMySQLdExporterParams) (*AddMySQLdExporterOK, error) + AddMySQLdExporter(params *AddMySQLdExporterParams, opts ...ClientOption) (*AddMySQLdExporterOK, error) - AddNodeExporter(params *AddNodeExporterParams) (*AddNodeExporterOK, error) + AddNodeExporter(params *AddNodeExporterParams, opts ...ClientOption) (*AddNodeExporterOK, error) - AddPMMAgent(params *AddPMMAgentParams) (*AddPMMAgentOK, error) + AddPMMAgent(params *AddPMMAgentParams, opts ...ClientOption) (*AddPMMAgentOK, error) - AddPostgresExporter(params *AddPostgresExporterParams) (*AddPostgresExporterOK, error) + AddPostgresExporter(params *AddPostgresExporterParams, opts ...ClientOption) (*AddPostgresExporterOK, error) - AddProxySQLExporter(params *AddProxySQLExporterParams) (*AddProxySQLExporterOK, error) + AddProxySQLExporter(params *AddProxySQLExporterParams, opts ...ClientOption) (*AddProxySQLExporterOK, error) - AddQANMongoDBProfilerAgent(params *AddQANMongoDBProfilerAgentParams) (*AddQANMongoDBProfilerAgentOK, error) + AddQANMongoDBProfilerAgent(params *AddQANMongoDBProfilerAgentParams, opts ...ClientOption) (*AddQANMongoDBProfilerAgentOK, error) - AddQANMySQLPerfSchemaAgent(params *AddQANMySQLPerfSchemaAgentParams) (*AddQANMySQLPerfSchemaAgentOK, error) + AddQANMySQLPerfSchemaAgent(params *AddQANMySQLPerfSchemaAgentParams, opts ...ClientOption) (*AddQANMySQLPerfSchemaAgentOK, error) - AddQANMySQLSlowlogAgent(params *AddQANMySQLSlowlogAgentParams) (*AddQANMySQLSlowlogAgentOK, error) + AddQANMySQLSlowlogAgent(params *AddQANMySQLSlowlogAgentParams, opts ...ClientOption) (*AddQANMySQLSlowlogAgentOK, error) - AddQANPostgreSQLPgStatMonitorAgent(params *AddQANPostgreSQLPgStatMonitorAgentParams) (*AddQANPostgreSQLPgStatMonitorAgentOK, error) + AddQANPostgreSQLPgStatMonitorAgent(params *AddQANPostgreSQLPgStatMonitorAgentParams, opts ...ClientOption) (*AddQANPostgreSQLPgStatMonitorAgentOK, error) - AddQANPostgreSQLPgStatementsAgent(params *AddQANPostgreSQLPgStatementsAgentParams) (*AddQANPostgreSQLPgStatementsAgentOK, error) + AddQANPostgreSQLPgStatementsAgent(params *AddQANPostgreSQLPgStatementsAgentParams, opts ...ClientOption) (*AddQANPostgreSQLPgStatementsAgentOK, error) - AddRDSExporter(params *AddRDSExporterParams) (*AddRDSExporterOK, error) + AddRDSExporter(params *AddRDSExporterParams, opts ...ClientOption) (*AddRDSExporterOK, error) - ChangeAzureDatabaseExporter(params *ChangeAzureDatabaseExporterParams) (*ChangeAzureDatabaseExporterOK, error) + ChangeAzureDatabaseExporter(params *ChangeAzureDatabaseExporterParams, opts ...ClientOption) (*ChangeAzureDatabaseExporterOK, error) - ChangeExternalExporter(params *ChangeExternalExporterParams) (*ChangeExternalExporterOK, error) + ChangeExternalExporter(params *ChangeExternalExporterParams, opts ...ClientOption) (*ChangeExternalExporterOK, error) - ChangeMongoDBExporter(params *ChangeMongoDBExporterParams) (*ChangeMongoDBExporterOK, error) + ChangeMongoDBExporter(params *ChangeMongoDBExporterParams, opts ...ClientOption) (*ChangeMongoDBExporterOK, error) - ChangeMySQLdExporter(params *ChangeMySQLdExporterParams) (*ChangeMySQLdExporterOK, error) + ChangeMySQLdExporter(params *ChangeMySQLdExporterParams, opts ...ClientOption) (*ChangeMySQLdExporterOK, error) - ChangeNodeExporter(params *ChangeNodeExporterParams) (*ChangeNodeExporterOK, error) + ChangeNodeExporter(params *ChangeNodeExporterParams, opts ...ClientOption) (*ChangeNodeExporterOK, error) - ChangePostgresExporter(params *ChangePostgresExporterParams) (*ChangePostgresExporterOK, error) + ChangePostgresExporter(params *ChangePostgresExporterParams, opts ...ClientOption) (*ChangePostgresExporterOK, error) - ChangeProxySQLExporter(params *ChangeProxySQLExporterParams) (*ChangeProxySQLExporterOK, error) + ChangeProxySQLExporter(params *ChangeProxySQLExporterParams, opts ...ClientOption) (*ChangeProxySQLExporterOK, error) - ChangeQANMongoDBProfilerAgent(params *ChangeQANMongoDBProfilerAgentParams) (*ChangeQANMongoDBProfilerAgentOK, error) + ChangeQANMongoDBProfilerAgent(params *ChangeQANMongoDBProfilerAgentParams, opts ...ClientOption) (*ChangeQANMongoDBProfilerAgentOK, error) - ChangeQANMySQLPerfSchemaAgent(params *ChangeQANMySQLPerfSchemaAgentParams) (*ChangeQANMySQLPerfSchemaAgentOK, error) + ChangeQANMySQLPerfSchemaAgent(params *ChangeQANMySQLPerfSchemaAgentParams, opts ...ClientOption) (*ChangeQANMySQLPerfSchemaAgentOK, error) - ChangeQANMySQLSlowlogAgent(params *ChangeQANMySQLSlowlogAgentParams) (*ChangeQANMySQLSlowlogAgentOK, error) + ChangeQANMySQLSlowlogAgent(params *ChangeQANMySQLSlowlogAgentParams, opts ...ClientOption) (*ChangeQANMySQLSlowlogAgentOK, error) - ChangeQANPostgreSQLPgStatMonitorAgent(params *ChangeQANPostgreSQLPgStatMonitorAgentParams) (*ChangeQANPostgreSQLPgStatMonitorAgentOK, error) + ChangeQANPostgreSQLPgStatMonitorAgent(params *ChangeQANPostgreSQLPgStatMonitorAgentParams, opts ...ClientOption) (*ChangeQANPostgreSQLPgStatMonitorAgentOK, error) - ChangeQANPostgreSQLPgStatementsAgent(params *ChangeQANPostgreSQLPgStatementsAgentParams) (*ChangeQANPostgreSQLPgStatementsAgentOK, error) + ChangeQANPostgreSQLPgStatementsAgent(params *ChangeQANPostgreSQLPgStatementsAgentParams, opts ...ClientOption) (*ChangeQANPostgreSQLPgStatementsAgentOK, error) - ChangeRDSExporter(params *ChangeRDSExporterParams) (*ChangeRDSExporterOK, error) + ChangeRDSExporter(params *ChangeRDSExporterParams, opts ...ClientOption) (*ChangeRDSExporterOK, error) - GetAgent(params *GetAgentParams) (*GetAgentOK, error) + GetAgent(params *GetAgentParams, opts ...ClientOption) (*GetAgentOK, error) - ListAgents(params *ListAgentsParams) (*ListAgentsOK, error) + ListAgents(params *ListAgentsParams, opts ...ClientOption) (*ListAgentsOK, error) - RemoveAgent(params *RemoveAgentParams) (*RemoveAgentOK, error) + RemoveAgent(params *RemoveAgentParams, opts ...ClientOption) (*RemoveAgentOK, error) SetTransport(transport runtime.ClientTransport) } @@ -93,13 +96,12 @@ type ClientService interface { Adds azure_database_exporter Agent. */ -func (a *Client) AddAzureDatabaseExporter(params *AddAzureDatabaseExporterParams) (*AddAzureDatabaseExporterOK, error) { +func (a *Client) AddAzureDatabaseExporter(params *AddAzureDatabaseExporterParams, opts ...ClientOption) (*AddAzureDatabaseExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddAzureDatabaseExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddAzureDatabaseExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/AddAzureDatabaseExporter", @@ -110,7 +112,12 @@ func (a *Client) AddAzureDatabaseExporter(params *AddAzureDatabaseExporterParams Reader: &AddAzureDatabaseExporterReader{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 } @@ -128,13 +135,12 @@ func (a *Client) AddAzureDatabaseExporter(params *AddAzureDatabaseExporterParams Adds external_exporter Agent. */ -func (a *Client) AddExternalExporter(params *AddExternalExporterParams) (*AddExternalExporterOK, error) { +func (a *Client) AddExternalExporter(params *AddExternalExporterParams, opts ...ClientOption) (*AddExternalExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddExternalExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddExternalExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/AddExternalExporter", @@ -145,7 +151,12 @@ func (a *Client) AddExternalExporter(params *AddExternalExporterParams) (*AddExt Reader: &AddExternalExporterReader{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 } @@ -163,13 +174,12 @@ func (a *Client) AddExternalExporter(params *AddExternalExporterParams) (*AddExt Adds mongodb_exporter Agent. */ -func (a *Client) AddMongoDBExporter(params *AddMongoDBExporterParams) (*AddMongoDBExporterOK, error) { +func (a *Client) AddMongoDBExporter(params *AddMongoDBExporterParams, opts ...ClientOption) (*AddMongoDBExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddMongoDBExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddMongoDBExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/AddMongoDBExporter", @@ -180,7 +190,12 @@ func (a *Client) AddMongoDBExporter(params *AddMongoDBExporterParams) (*AddMongo Reader: &AddMongoDBExporterReader{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 } @@ -198,13 +213,12 @@ func (a *Client) AddMongoDBExporter(params *AddMongoDBExporterParams) (*AddMongo Adds mysqld_exporter Agent. */ -func (a *Client) AddMySQLdExporter(params *AddMySQLdExporterParams) (*AddMySQLdExporterOK, error) { +func (a *Client) AddMySQLdExporter(params *AddMySQLdExporterParams, opts ...ClientOption) (*AddMySQLdExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddMySQLdExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddMySQLdExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/AddMySQLdExporter", @@ -215,7 +229,12 @@ func (a *Client) AddMySQLdExporter(params *AddMySQLdExporterParams) (*AddMySQLdE Reader: &AddMySQLdExporterReader{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 } @@ -233,13 +252,12 @@ func (a *Client) AddMySQLdExporter(params *AddMySQLdExporterParams) (*AddMySQLdE Adds node_exporter Agent. */ -func (a *Client) AddNodeExporter(params *AddNodeExporterParams) (*AddNodeExporterOK, error) { +func (a *Client) AddNodeExporter(params *AddNodeExporterParams, opts ...ClientOption) (*AddNodeExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddNodeExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddNodeExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/AddNodeExporter", @@ -250,7 +268,12 @@ func (a *Client) AddNodeExporter(params *AddNodeExporterParams) (*AddNodeExporte Reader: &AddNodeExporterReader{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 } @@ -268,13 +291,12 @@ func (a *Client) AddNodeExporter(params *AddNodeExporterParams) (*AddNodeExporte Adds PMM Agent. */ -func (a *Client) AddPMMAgent(params *AddPMMAgentParams) (*AddPMMAgentOK, error) { +func (a *Client) AddPMMAgent(params *AddPMMAgentParams, opts ...ClientOption) (*AddPMMAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddPMMAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddPMMAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/AddPMMAgent", @@ -285,7 +307,12 @@ func (a *Client) AddPMMAgent(params *AddPMMAgentParams) (*AddPMMAgentOK, error) Reader: &AddPMMAgentReader{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 } @@ -303,13 +330,12 @@ func (a *Client) AddPMMAgent(params *AddPMMAgentParams) (*AddPMMAgentOK, error) Adds postgres_exporter Agent. */ -func (a *Client) AddPostgresExporter(params *AddPostgresExporterParams) (*AddPostgresExporterOK, error) { +func (a *Client) AddPostgresExporter(params *AddPostgresExporterParams, opts ...ClientOption) (*AddPostgresExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddPostgresExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddPostgresExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/AddPostgresExporter", @@ -320,7 +346,12 @@ func (a *Client) AddPostgresExporter(params *AddPostgresExporterParams) (*AddPos Reader: &AddPostgresExporterReader{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 } @@ -338,13 +369,12 @@ func (a *Client) AddPostgresExporter(params *AddPostgresExporterParams) (*AddPos Adds proxysql_exporter Agent. */ -func (a *Client) AddProxySQLExporter(params *AddProxySQLExporterParams) (*AddProxySQLExporterOK, error) { +func (a *Client) AddProxySQLExporter(params *AddProxySQLExporterParams, opts ...ClientOption) (*AddProxySQLExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddProxySQLExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddProxySQLExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/AddProxySQLExporter", @@ -355,7 +385,12 @@ func (a *Client) AddProxySQLExporter(params *AddProxySQLExporterParams) (*AddPro Reader: &AddProxySQLExporterReader{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 } @@ -373,13 +408,12 @@ func (a *Client) AddProxySQLExporter(params *AddProxySQLExporterParams) (*AddPro Adds 'Query Analytics MongoDB Profiler' Agent. */ -func (a *Client) AddQANMongoDBProfilerAgent(params *AddQANMongoDBProfilerAgentParams) (*AddQANMongoDBProfilerAgentOK, error) { +func (a *Client) AddQANMongoDBProfilerAgent(params *AddQANMongoDBProfilerAgentParams, opts ...ClientOption) (*AddQANMongoDBProfilerAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddQANMongoDBProfilerAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddQANMongoDBProfilerAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/AddQANMongoDBProfilerAgent", @@ -390,7 +424,12 @@ func (a *Client) AddQANMongoDBProfilerAgent(params *AddQANMongoDBProfilerAgentPa Reader: &AddQANMongoDBProfilerAgentReader{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 } @@ -408,13 +447,12 @@ func (a *Client) AddQANMongoDBProfilerAgent(params *AddQANMongoDBProfilerAgentPa Adds 'Query Analytics MySQL PerfSchema' Agent. */ -func (a *Client) AddQANMySQLPerfSchemaAgent(params *AddQANMySQLPerfSchemaAgentParams) (*AddQANMySQLPerfSchemaAgentOK, error) { +func (a *Client) AddQANMySQLPerfSchemaAgent(params *AddQANMySQLPerfSchemaAgentParams, opts ...ClientOption) (*AddQANMySQLPerfSchemaAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddQANMySQLPerfSchemaAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddQANMySQLPerfSchemaAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/AddQANMySQLPerfSchemaAgent", @@ -425,7 +463,12 @@ func (a *Client) AddQANMySQLPerfSchemaAgent(params *AddQANMySQLPerfSchemaAgentPa Reader: &AddQANMySQLPerfSchemaAgentReader{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 } @@ -443,13 +486,12 @@ func (a *Client) AddQANMySQLPerfSchemaAgent(params *AddQANMySQLPerfSchemaAgentPa Adds 'Query Analytics MySQL Slowlog' Agent. */ -func (a *Client) AddQANMySQLSlowlogAgent(params *AddQANMySQLSlowlogAgentParams) (*AddQANMySQLSlowlogAgentOK, error) { +func (a *Client) AddQANMySQLSlowlogAgent(params *AddQANMySQLSlowlogAgentParams, opts ...ClientOption) (*AddQANMySQLSlowlogAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddQANMySQLSlowlogAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddQANMySQLSlowlogAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/AddQANMySQLSlowlogAgent", @@ -460,7 +502,12 @@ func (a *Client) AddQANMySQLSlowlogAgent(params *AddQANMySQLSlowlogAgentParams) Reader: &AddQANMySQLSlowlogAgentReader{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 } @@ -478,13 +525,12 @@ func (a *Client) AddQANMySQLSlowlogAgent(params *AddQANMySQLSlowlogAgentParams) Adds 'Query Analytics PostgreSQL pg_stat_monitor' Agent. */ -func (a *Client) AddQANPostgreSQLPgStatMonitorAgent(params *AddQANPostgreSQLPgStatMonitorAgentParams) (*AddQANPostgreSQLPgStatMonitorAgentOK, error) { +func (a *Client) AddQANPostgreSQLPgStatMonitorAgent(params *AddQANPostgreSQLPgStatMonitorAgentParams, opts ...ClientOption) (*AddQANPostgreSQLPgStatMonitorAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddQANPostgreSQLPgStatMonitorAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddQANPostgreSQLPgStatMonitorAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/AddQANPostgreSQLPgStatMonitorAgent", @@ -495,7 +541,12 @@ func (a *Client) AddQANPostgreSQLPgStatMonitorAgent(params *AddQANPostgreSQLPgSt Reader: &AddQANPostgreSQLPgStatMonitorAgentReader{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 } @@ -513,13 +564,12 @@ func (a *Client) AddQANPostgreSQLPgStatMonitorAgent(params *AddQANPostgreSQLPgSt Adds 'Query Analytics PostgreSQL pg_stat_statements' Agent. */ -func (a *Client) AddQANPostgreSQLPgStatementsAgent(params *AddQANPostgreSQLPgStatementsAgentParams) (*AddQANPostgreSQLPgStatementsAgentOK, error) { +func (a *Client) AddQANPostgreSQLPgStatementsAgent(params *AddQANPostgreSQLPgStatementsAgentParams, opts ...ClientOption) (*AddQANPostgreSQLPgStatementsAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddQANPostgreSQLPgStatementsAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddQANPostgreSQLPgStatementsAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/AddQANPostgreSQLPgStatementsAgent", @@ -530,7 +580,12 @@ func (a *Client) AddQANPostgreSQLPgStatementsAgent(params *AddQANPostgreSQLPgSta Reader: &AddQANPostgreSQLPgStatementsAgentReader{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 } @@ -548,13 +603,12 @@ func (a *Client) AddQANPostgreSQLPgStatementsAgent(params *AddQANPostgreSQLPgSta Adds rds_exporter Agent. */ -func (a *Client) AddRDSExporter(params *AddRDSExporterParams) (*AddRDSExporterOK, error) { +func (a *Client) AddRDSExporter(params *AddRDSExporterParams, opts ...ClientOption) (*AddRDSExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddRDSExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddRDSExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/AddRDSExporter", @@ -565,7 +619,12 @@ func (a *Client) AddRDSExporter(params *AddRDSExporterParams) (*AddRDSExporterOK Reader: &AddRDSExporterReader{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 } @@ -583,13 +642,12 @@ func (a *Client) AddRDSExporter(params *AddRDSExporterParams) (*AddRDSExporterOK Changes azure_database_exporter Agent. */ -func (a *Client) ChangeAzureDatabaseExporter(params *ChangeAzureDatabaseExporterParams) (*ChangeAzureDatabaseExporterOK, error) { +func (a *Client) ChangeAzureDatabaseExporter(params *ChangeAzureDatabaseExporterParams, opts ...ClientOption) (*ChangeAzureDatabaseExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeAzureDatabaseExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeAzureDatabaseExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeAzureDatabaseExporter", @@ -600,7 +658,12 @@ func (a *Client) ChangeAzureDatabaseExporter(params *ChangeAzureDatabaseExporter Reader: &ChangeAzureDatabaseExporterReader{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 } @@ -618,13 +681,12 @@ func (a *Client) ChangeAzureDatabaseExporter(params *ChangeAzureDatabaseExporter Changes external_exporter Agent. */ -func (a *Client) ChangeExternalExporter(params *ChangeExternalExporterParams) (*ChangeExternalExporterOK, error) { +func (a *Client) ChangeExternalExporter(params *ChangeExternalExporterParams, opts ...ClientOption) (*ChangeExternalExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeExternalExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeExternalExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeExternalExporter", @@ -635,7 +697,12 @@ func (a *Client) ChangeExternalExporter(params *ChangeExternalExporterParams) (* Reader: &ChangeExternalExporterReader{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 } @@ -653,13 +720,12 @@ func (a *Client) ChangeExternalExporter(params *ChangeExternalExporterParams) (* Changes mongodb_exporter Agent. */ -func (a *Client) ChangeMongoDBExporter(params *ChangeMongoDBExporterParams) (*ChangeMongoDBExporterOK, error) { +func (a *Client) ChangeMongoDBExporter(params *ChangeMongoDBExporterParams, opts ...ClientOption) (*ChangeMongoDBExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeMongoDBExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeMongoDBExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeMongoDBExporter", @@ -670,7 +736,12 @@ func (a *Client) ChangeMongoDBExporter(params *ChangeMongoDBExporterParams) (*Ch Reader: &ChangeMongoDBExporterReader{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 } @@ -688,13 +759,12 @@ func (a *Client) ChangeMongoDBExporter(params *ChangeMongoDBExporterParams) (*Ch Changes mysqld_exporter Agent. */ -func (a *Client) ChangeMySQLdExporter(params *ChangeMySQLdExporterParams) (*ChangeMySQLdExporterOK, error) { +func (a *Client) ChangeMySQLdExporter(params *ChangeMySQLdExporterParams, opts ...ClientOption) (*ChangeMySQLdExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeMySQLdExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeMySQLdExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeMySQLdExporter", @@ -705,7 +775,12 @@ func (a *Client) ChangeMySQLdExporter(params *ChangeMySQLdExporterParams) (*Chan Reader: &ChangeMySQLdExporterReader{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 } @@ -723,13 +798,12 @@ func (a *Client) ChangeMySQLdExporter(params *ChangeMySQLdExporterParams) (*Chan Changes node_exporter Agent. */ -func (a *Client) ChangeNodeExporter(params *ChangeNodeExporterParams) (*ChangeNodeExporterOK, error) { +func (a *Client) ChangeNodeExporter(params *ChangeNodeExporterParams, opts ...ClientOption) (*ChangeNodeExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeNodeExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeNodeExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeNodeExporter", @@ -740,7 +814,12 @@ func (a *Client) ChangeNodeExporter(params *ChangeNodeExporterParams) (*ChangeNo Reader: &ChangeNodeExporterReader{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 } @@ -758,13 +837,12 @@ func (a *Client) ChangeNodeExporter(params *ChangeNodeExporterParams) (*ChangeNo Changes postgres_exporter Agent. */ -func (a *Client) ChangePostgresExporter(params *ChangePostgresExporterParams) (*ChangePostgresExporterOK, error) { +func (a *Client) ChangePostgresExporter(params *ChangePostgresExporterParams, opts ...ClientOption) (*ChangePostgresExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangePostgresExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangePostgresExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangePostgresExporter", @@ -775,7 +853,12 @@ func (a *Client) ChangePostgresExporter(params *ChangePostgresExporterParams) (* Reader: &ChangePostgresExporterReader{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 } @@ -793,13 +876,12 @@ func (a *Client) ChangePostgresExporter(params *ChangePostgresExporterParams) (* Changes proxysql_exporter Agent. */ -func (a *Client) ChangeProxySQLExporter(params *ChangeProxySQLExporterParams) (*ChangeProxySQLExporterOK, error) { +func (a *Client) ChangeProxySQLExporter(params *ChangeProxySQLExporterParams, opts ...ClientOption) (*ChangeProxySQLExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeProxySQLExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeProxySQLExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeProxySQLExporter", @@ -810,7 +892,12 @@ func (a *Client) ChangeProxySQLExporter(params *ChangeProxySQLExporterParams) (* Reader: &ChangeProxySQLExporterReader{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 } @@ -828,13 +915,12 @@ func (a *Client) ChangeProxySQLExporter(params *ChangeProxySQLExporterParams) (* Changes 'Query Analytics MongoDB Profiler' Agent. */ -func (a *Client) ChangeQANMongoDBProfilerAgent(params *ChangeQANMongoDBProfilerAgentParams) (*ChangeQANMongoDBProfilerAgentOK, error) { +func (a *Client) ChangeQANMongoDBProfilerAgent(params *ChangeQANMongoDBProfilerAgentParams, opts ...ClientOption) (*ChangeQANMongoDBProfilerAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeQANMongoDBProfilerAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeQANMongoDBProfilerAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeQANMongoDBProfilerAgent", @@ -845,7 +931,12 @@ func (a *Client) ChangeQANMongoDBProfilerAgent(params *ChangeQANMongoDBProfilerA Reader: &ChangeQANMongoDBProfilerAgentReader{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 } @@ -863,13 +954,12 @@ func (a *Client) ChangeQANMongoDBProfilerAgent(params *ChangeQANMongoDBProfilerA Changes 'Query Analytics MySQL PerfSchema' Agent. */ -func (a *Client) ChangeQANMySQLPerfSchemaAgent(params *ChangeQANMySQLPerfSchemaAgentParams) (*ChangeQANMySQLPerfSchemaAgentOK, error) { +func (a *Client) ChangeQANMySQLPerfSchemaAgent(params *ChangeQANMySQLPerfSchemaAgentParams, opts ...ClientOption) (*ChangeQANMySQLPerfSchemaAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeQANMySQLPerfSchemaAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeQANMySQLPerfSchemaAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeQANMySQLPerfSchemaAgent", @@ -880,7 +970,12 @@ func (a *Client) ChangeQANMySQLPerfSchemaAgent(params *ChangeQANMySQLPerfSchemaA Reader: &ChangeQANMySQLPerfSchemaAgentReader{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 } @@ -898,13 +993,12 @@ func (a *Client) ChangeQANMySQLPerfSchemaAgent(params *ChangeQANMySQLPerfSchemaA Changes 'Query Analytics MySQL Slowlog' Agent. */ -func (a *Client) ChangeQANMySQLSlowlogAgent(params *ChangeQANMySQLSlowlogAgentParams) (*ChangeQANMySQLSlowlogAgentOK, error) { +func (a *Client) ChangeQANMySQLSlowlogAgent(params *ChangeQANMySQLSlowlogAgentParams, opts ...ClientOption) (*ChangeQANMySQLSlowlogAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeQANMySQLSlowlogAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeQANMySQLSlowlogAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeQANMySQLSlowlogAgent", @@ -915,7 +1009,12 @@ func (a *Client) ChangeQANMySQLSlowlogAgent(params *ChangeQANMySQLSlowlogAgentPa Reader: &ChangeQANMySQLSlowlogAgentReader{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 } @@ -933,13 +1032,12 @@ func (a *Client) ChangeQANMySQLSlowlogAgent(params *ChangeQANMySQLSlowlogAgentPa Changes 'Query Analytics PostgreSQL pg_stat_monitor' Agent. */ -func (a *Client) ChangeQANPostgreSQLPgStatMonitorAgent(params *ChangeQANPostgreSQLPgStatMonitorAgentParams) (*ChangeQANPostgreSQLPgStatMonitorAgentOK, error) { +func (a *Client) ChangeQANPostgreSQLPgStatMonitorAgent(params *ChangeQANPostgreSQLPgStatMonitorAgentParams, opts ...ClientOption) (*ChangeQANPostgreSQLPgStatMonitorAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeQANPostgreSQLPgStatMonitorAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeQANPostgreSQLPgStatMonitorAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeQANPostgreSQLPgStatMonitorAgent", @@ -950,7 +1048,12 @@ func (a *Client) ChangeQANPostgreSQLPgStatMonitorAgent(params *ChangeQANPostgreS Reader: &ChangeQANPostgreSQLPgStatMonitorAgentReader{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 } @@ -968,13 +1071,12 @@ func (a *Client) ChangeQANPostgreSQLPgStatMonitorAgent(params *ChangeQANPostgreS Changes 'Query Analytics PostgreSQL pg_stat_statements' Agent. */ -func (a *Client) ChangeQANPostgreSQLPgStatementsAgent(params *ChangeQANPostgreSQLPgStatementsAgentParams) (*ChangeQANPostgreSQLPgStatementsAgentOK, error) { +func (a *Client) ChangeQANPostgreSQLPgStatementsAgent(params *ChangeQANPostgreSQLPgStatementsAgentParams, opts ...ClientOption) (*ChangeQANPostgreSQLPgStatementsAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeQANPostgreSQLPgStatementsAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeQANPostgreSQLPgStatementsAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeQANPostgreSQLPgStatementsAgent", @@ -985,7 +1087,12 @@ func (a *Client) ChangeQANPostgreSQLPgStatementsAgent(params *ChangeQANPostgreSQ Reader: &ChangeQANPostgreSQLPgStatementsAgentReader{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 } @@ -1003,13 +1110,12 @@ func (a *Client) ChangeQANPostgreSQLPgStatementsAgent(params *ChangeQANPostgreSQ Changes rds_exporter Agent. */ -func (a *Client) ChangeRDSExporter(params *ChangeRDSExporterParams) (*ChangeRDSExporterOK, error) { +func (a *Client) ChangeRDSExporter(params *ChangeRDSExporterParams, opts ...ClientOption) (*ChangeRDSExporterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeRDSExporterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeRDSExporter", Method: "POST", PathPattern: "/v1/inventory/Agents/ChangeRDSExporter", @@ -1020,7 +1126,12 @@ func (a *Client) ChangeRDSExporter(params *ChangeRDSExporterParams) (*ChangeRDSE Reader: &ChangeRDSExporterReader{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 } @@ -1038,13 +1149,12 @@ func (a *Client) ChangeRDSExporter(params *ChangeRDSExporterParams) (*ChangeRDSE Returns a single Agent by ID. */ -func (a *Client) GetAgent(params *GetAgentParams) (*GetAgentOK, error) { +func (a *Client) GetAgent(params *GetAgentParams, opts ...ClientOption) (*GetAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/Get", @@ -1055,7 +1165,12 @@ func (a *Client) GetAgent(params *GetAgentParams) (*GetAgentOK, error) { 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 } @@ -1073,13 +1188,12 @@ func (a *Client) GetAgent(params *GetAgentParams) (*GetAgentOK, error) { Returns a list of all Agents. */ -func (a *Client) ListAgents(params *ListAgentsParams) (*ListAgentsOK, error) { +func (a *Client) ListAgents(params *ListAgentsParams, opts ...ClientOption) (*ListAgentsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListAgentsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListAgents", Method: "POST", PathPattern: "/v1/inventory/Agents/List", @@ -1090,7 +1204,12 @@ func (a *Client) ListAgents(params *ListAgentsParams) (*ListAgentsOK, error) { 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 } @@ -1108,13 +1227,12 @@ func (a *Client) ListAgents(params *ListAgentsParams) (*ListAgentsOK, error) { Removes Agent. */ -func (a *Client) RemoveAgent(params *RemoveAgentParams) (*RemoveAgentOK, error) { +func (a *Client) RemoveAgent(params *RemoveAgentParams, opts ...ClientOption) (*RemoveAgentOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRemoveAgentParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RemoveAgent", Method: "POST", PathPattern: "/v1/inventory/Agents/Remove", @@ -1125,7 +1243,12 @@ func (a *Client) RemoveAgent(params *RemoveAgentParams) (*RemoveAgentOK, error) 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 } diff --git a/api/inventorypb/json/client/agents/change_azure_database_exporter_parameters.go b/api/inventorypb/json/client/agents/change_azure_database_exporter_parameters.go index 0a14a58b8d..818d3173fc 100644 --- a/api/inventorypb/json/client/agents/change_azure_database_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/change_azure_database_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeAzureDatabaseExporterParams creates a new ChangeAzureDatabaseExporterParams object -// with the default values initialized. +// NewChangeAzureDatabaseExporterParams creates a new ChangeAzureDatabaseExporterParams 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 NewChangeAzureDatabaseExporterParams() *ChangeAzureDatabaseExporterParams { - var () return &ChangeAzureDatabaseExporterParams{ - timeout: cr.DefaultTimeout, } } // NewChangeAzureDatabaseExporterParamsWithTimeout creates a new ChangeAzureDatabaseExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeAzureDatabaseExporterParamsWithTimeout(timeout time.Duration) *ChangeAzureDatabaseExporterParams { - var () return &ChangeAzureDatabaseExporterParams{ - timeout: timeout, } } // NewChangeAzureDatabaseExporterParamsWithContext creates a new ChangeAzureDatabaseExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeAzureDatabaseExporterParamsWithContext(ctx context.Context) *ChangeAzureDatabaseExporterParams { - var () return &ChangeAzureDatabaseExporterParams{ - Context: ctx, } } // NewChangeAzureDatabaseExporterParamsWithHTTPClient creates a new ChangeAzureDatabaseExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeAzureDatabaseExporterParamsWithHTTPClient(client *http.Client) *ChangeAzureDatabaseExporterParams { - var () return &ChangeAzureDatabaseExporterParams{ HTTPClient: client, } } -/*ChangeAzureDatabaseExporterParams contains all the parameters to send to the API endpoint -for the change azure database exporter operation typically these are written to a http.Request +/* ChangeAzureDatabaseExporterParams contains all the parameters to send to the API endpoint + for the change azure database exporter operation. + + Typically these are written to a http.Request. */ type ChangeAzureDatabaseExporterParams struct { - /*Body*/ + // Body. Body ChangeAzureDatabaseExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeAzureDatabaseExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change azure database exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeAzureDatabaseExporterParams) WithDefaults() *ChangeAzureDatabaseExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change azure database exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeAzureDatabaseExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change azure database exporter params func (o *ChangeAzureDatabaseExporterParams) WithTimeout(timeout time.Duration) *ChangeAzureDatabaseExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeAzureDatabaseExporterParams) WriteToRequest(r runtime.ClientReque return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_azure_database_exporter_responses.go b/api/inventorypb/json/client/agents/change_azure_database_exporter_responses.go index 43b036b725..2cee7456a0 100644 --- a/api/inventorypb/json/client/agents/change_azure_database_exporter_responses.go +++ b/api/inventorypb/json/client/agents/change_azure_database_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeAzureDatabaseExporterOK() *ChangeAzureDatabaseExporterOK { return &ChangeAzureDatabaseExporterOK{} } -/*ChangeAzureDatabaseExporterOK handles this case with default header values. +/* ChangeAzureDatabaseExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeAzureDatabaseExporterOK struct { func (o *ChangeAzureDatabaseExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeAzureDatabaseExporter][%d] changeAzureDatabaseExporterOk %+v", 200, o.Payload) } - func (o *ChangeAzureDatabaseExporterOK) GetPayload() *ChangeAzureDatabaseExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeAzureDatabaseExporterDefault(code int) *ChangeAzureDatabaseExporte } } -/*ChangeAzureDatabaseExporterDefault handles this case with default header values. +/* ChangeAzureDatabaseExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeAzureDatabaseExporterDefault) Code() int { func (o *ChangeAzureDatabaseExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeAzureDatabaseExporter][%d] ChangeAzureDatabaseExporter default %+v", o._statusCode, o.Payload) } - func (o *ChangeAzureDatabaseExporterDefault) GetPayload() *ChangeAzureDatabaseExporterDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeAzureDatabaseExporterBody) Validate(formats strfmt.Registry) erro } func (o *ChangeAzureDatabaseExporterBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeAzureDatabaseExporterBody) validateCommon(formats strfmt.Registry if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change azure database exporter body based on the context it is used +func (o *ChangeAzureDatabaseExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeAzureDatabaseExporterBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeAzureDatabaseExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeAzureDatabaseExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change azure database exporter default body @@ -214,7 +244,6 @@ func (o *ChangeAzureDatabaseExporterDefaultBody) Validate(formats strfmt.Registr } func (o *ChangeAzureDatabaseExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeAzureDatabaseExporterDefaultBody) validateDetails(formats strfmt. if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeAzureDatabaseExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeAzureDatabaseExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change azure database exporter default body based on the context it is used +func (o *ChangeAzureDatabaseExporterDefaultBody) 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 *ChangeAzureDatabaseExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeAzureDatabaseExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeAzureDatabaseExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeAzureDatabaseExporterDefaultBody) UnmarshalBinary(b []byte) error return nil } +/*ChangeAzureDatabaseExporterDefaultBodyDetailsItems0 change azure database exporter default body details items0 +swagger:model ChangeAzureDatabaseExporterDefaultBodyDetailsItems0 +*/ +type ChangeAzureDatabaseExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change azure database exporter default body details items0 +func (o *ChangeAzureDatabaseExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change azure database exporter default body details items0 based on context it is used +func (o *ChangeAzureDatabaseExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeAzureDatabaseExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeAzureDatabaseExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeAzureDatabaseExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeAzureDatabaseExporterOKBody change azure database exporter OK body swagger:model ChangeAzureDatabaseExporterOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeAzureDatabaseExporterOKBody) Validate(formats strfmt.Registry) er } func (o *ChangeAzureDatabaseExporterOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseExporter) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeAzureDatabaseExporterOKBody) validateAzureDatabaseExporter(format if err := o.AzureDatabaseExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeAzureDatabaseExporterOk" + "." + "azure_database_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeAzureDatabaseExporterOk" + "." + "azure_database_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change azure database exporter OK body based on the context it is used +func (o *ChangeAzureDatabaseExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateAzureDatabaseExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeAzureDatabaseExporterOKBody) contextValidateAzureDatabaseExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.AzureDatabaseExporter != nil { + if err := o.AzureDatabaseExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeAzureDatabaseExporterOk" + "." + "azure_database_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeAzureDatabaseExporterOk" + "." + "azure_database_exporter") } return err } @@ -341,6 +478,12 @@ type ChangeAzureDatabaseExporterOKBodyAzureDatabaseExporter struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,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"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -351,12 +494,6 @@ type ChangeAzureDatabaseExporterOKBodyAzureDatabaseExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` } // Validate validates this change azure database exporter OK body azure database exporter @@ -418,7 +555,6 @@ func (o *ChangeAzureDatabaseExporterOKBodyAzureDatabaseExporter) validateStatusE } func (o *ChangeAzureDatabaseExporterOKBodyAzureDatabaseExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -431,6 +567,11 @@ func (o *ChangeAzureDatabaseExporterOKBodyAzureDatabaseExporter) validateStatus( return nil } +// ContextValidate validates this change azure database exporter OK body azure database exporter based on context it is used +func (o *ChangeAzureDatabaseExporterOKBodyAzureDatabaseExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeAzureDatabaseExporterOKBodyAzureDatabaseExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -479,6 +620,11 @@ func (o *ChangeAzureDatabaseExporterParamsBodyCommon) Validate(formats strfmt.Re return nil } +// ContextValidate validates this change azure database exporter params body common based on context it is used +func (o *ChangeAzureDatabaseExporterParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeAzureDatabaseExporterParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_external_exporter_parameters.go b/api/inventorypb/json/client/agents/change_external_exporter_parameters.go index a3a14b5f6e..3b13818acc 100644 --- a/api/inventorypb/json/client/agents/change_external_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/change_external_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeExternalExporterParams creates a new ChangeExternalExporterParams object -// with the default values initialized. +// NewChangeExternalExporterParams creates a new ChangeExternalExporterParams 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 NewChangeExternalExporterParams() *ChangeExternalExporterParams { - var () return &ChangeExternalExporterParams{ - timeout: cr.DefaultTimeout, } } // NewChangeExternalExporterParamsWithTimeout creates a new ChangeExternalExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeExternalExporterParamsWithTimeout(timeout time.Duration) *ChangeExternalExporterParams { - var () return &ChangeExternalExporterParams{ - timeout: timeout, } } // NewChangeExternalExporterParamsWithContext creates a new ChangeExternalExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeExternalExporterParamsWithContext(ctx context.Context) *ChangeExternalExporterParams { - var () return &ChangeExternalExporterParams{ - Context: ctx, } } // NewChangeExternalExporterParamsWithHTTPClient creates a new ChangeExternalExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeExternalExporterParamsWithHTTPClient(client *http.Client) *ChangeExternalExporterParams { - var () return &ChangeExternalExporterParams{ HTTPClient: client, } } -/*ChangeExternalExporterParams contains all the parameters to send to the API endpoint -for the change external exporter operation typically these are written to a http.Request +/* ChangeExternalExporterParams contains all the parameters to send to the API endpoint + for the change external exporter operation. + + Typically these are written to a http.Request. */ type ChangeExternalExporterParams struct { - /*Body*/ + // Body. Body ChangeExternalExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeExternalExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change external exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeExternalExporterParams) WithDefaults() *ChangeExternalExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change external exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeExternalExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change external exporter params func (o *ChangeExternalExporterParams) WithTimeout(timeout time.Duration) *ChangeExternalExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeExternalExporterParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_external_exporter_responses.go b/api/inventorypb/json/client/agents/change_external_exporter_responses.go index e908c461a8..11c10f5c15 100644 --- a/api/inventorypb/json/client/agents/change_external_exporter_responses.go +++ b/api/inventorypb/json/client/agents/change_external_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewChangeExternalExporterOK() *ChangeExternalExporterOK { return &ChangeExternalExporterOK{} } -/*ChangeExternalExporterOK handles this case with default header values. +/* ChangeExternalExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ChangeExternalExporterOK struct { func (o *ChangeExternalExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeExternalExporter][%d] changeExternalExporterOk %+v", 200, o.Payload) } - func (o *ChangeExternalExporterOK) GetPayload() *ChangeExternalExporterOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewChangeExternalExporterDefault(code int) *ChangeExternalExporterDefault { } } -/*ChangeExternalExporterDefault handles this case with default header values. +/* ChangeExternalExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *ChangeExternalExporterDefault) Code() int { func (o *ChangeExternalExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeExternalExporter][%d] ChangeExternalExporter default %+v", o._statusCode, o.Payload) } - func (o *ChangeExternalExporterDefault) GetPayload() *ChangeExternalExporterDefaultBody { return o.Payload } @@ -144,7 +143,6 @@ func (o *ChangeExternalExporterBody) Validate(formats strfmt.Registry) error { } func (o *ChangeExternalExporterBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -153,6 +151,38 @@ func (o *ChangeExternalExporterBody) validateCommon(formats strfmt.Registry) err if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change external exporter body based on the context it is used +func (o *ChangeExternalExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeExternalExporterBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -194,7 +224,7 @@ type ChangeExternalExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeExternalExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change external exporter default body @@ -212,7 +242,6 @@ func (o *ChangeExternalExporterDefaultBody) Validate(formats strfmt.Registry) er } func (o *ChangeExternalExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -226,6 +255,42 @@ func (o *ChangeExternalExporterDefaultBody) validateDetails(formats strfmt.Regis if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeExternalExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeExternalExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change external exporter default body based on the context it is used +func (o *ChangeExternalExporterDefaultBody) 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 *ChangeExternalExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeExternalExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeExternalExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -254,6 +319,47 @@ func (o *ChangeExternalExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangeExternalExporterDefaultBodyDetailsItems0 change external exporter default body details items0 +swagger:model ChangeExternalExporterDefaultBodyDetailsItems0 +*/ +type ChangeExternalExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change external exporter default body details items0 +func (o *ChangeExternalExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change external exporter default body details items0 based on context it is used +func (o *ChangeExternalExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeExternalExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeExternalExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeExternalExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeExternalExporterOKBody change external exporter OK body swagger:model ChangeExternalExporterOKBody */ @@ -278,7 +384,6 @@ func (o *ChangeExternalExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *ChangeExternalExporterOKBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required return nil } @@ -287,6 +392,38 @@ func (o *ChangeExternalExporterOKBody) validateExternalExporter(formats strfmt.R if err := o.ExternalExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeExternalExporterOk" + "." + "external_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeExternalExporterOk" + "." + "external_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change external exporter OK body based on the context it is used +func (o *ChangeExternalExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateExternalExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeExternalExporterOKBody) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.ExternalExporter != nil { + if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeExternalExporterOk" + "." + "external_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeExternalExporterOk" + "." + "external_exporter") } return err } @@ -354,6 +491,11 @@ func (o *ChangeExternalExporterOKBodyExternalExporter) Validate(formats strfmt.R return nil } +// ContextValidate validates this change external exporter OK body external exporter based on context it is used +func (o *ChangeExternalExporterOKBodyExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeExternalExporterOKBodyExternalExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -402,6 +544,11 @@ func (o *ChangeExternalExporterParamsBodyCommon) Validate(formats strfmt.Registr return nil } +// ContextValidate validates this change external exporter params body common based on context it is used +func (o *ChangeExternalExporterParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeExternalExporterParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_mongo_db_exporter_parameters.go b/api/inventorypb/json/client/agents/change_mongo_db_exporter_parameters.go index c949c6affc..9eed875c05 100644 --- a/api/inventorypb/json/client/agents/change_mongo_db_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/change_mongo_db_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeMongoDBExporterParams creates a new ChangeMongoDBExporterParams object -// with the default values initialized. +// NewChangeMongoDBExporterParams creates a new ChangeMongoDBExporterParams 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 NewChangeMongoDBExporterParams() *ChangeMongoDBExporterParams { - var () return &ChangeMongoDBExporterParams{ - timeout: cr.DefaultTimeout, } } // NewChangeMongoDBExporterParamsWithTimeout creates a new ChangeMongoDBExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeMongoDBExporterParamsWithTimeout(timeout time.Duration) *ChangeMongoDBExporterParams { - var () return &ChangeMongoDBExporterParams{ - timeout: timeout, } } // NewChangeMongoDBExporterParamsWithContext creates a new ChangeMongoDBExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeMongoDBExporterParamsWithContext(ctx context.Context) *ChangeMongoDBExporterParams { - var () return &ChangeMongoDBExporterParams{ - Context: ctx, } } // NewChangeMongoDBExporterParamsWithHTTPClient creates a new ChangeMongoDBExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeMongoDBExporterParamsWithHTTPClient(client *http.Client) *ChangeMongoDBExporterParams { - var () return &ChangeMongoDBExporterParams{ HTTPClient: client, } } -/*ChangeMongoDBExporterParams contains all the parameters to send to the API endpoint -for the change mongo DB exporter operation typically these are written to a http.Request +/* ChangeMongoDBExporterParams contains all the parameters to send to the API endpoint + for the change mongo DB exporter operation. + + Typically these are written to a http.Request. */ type ChangeMongoDBExporterParams struct { - /*Body*/ + // Body. Body ChangeMongoDBExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeMongoDBExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change mongo DB exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeMongoDBExporterParams) WithDefaults() *ChangeMongoDBExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change mongo DB exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeMongoDBExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change mongo DB exporter params func (o *ChangeMongoDBExporterParams) WithTimeout(timeout time.Duration) *ChangeMongoDBExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeMongoDBExporterParams) WriteToRequest(r runtime.ClientRequest, re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_mongo_db_exporter_responses.go b/api/inventorypb/json/client/agents/change_mongo_db_exporter_responses.go index bae1905d0c..98dc075f1d 100644 --- a/api/inventorypb/json/client/agents/change_mongo_db_exporter_responses.go +++ b/api/inventorypb/json/client/agents/change_mongo_db_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeMongoDBExporterOK() *ChangeMongoDBExporterOK { return &ChangeMongoDBExporterOK{} } -/*ChangeMongoDBExporterOK handles this case with default header values. +/* ChangeMongoDBExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeMongoDBExporterOK struct { func (o *ChangeMongoDBExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeMongoDBExporter][%d] changeMongoDbExporterOk %+v", 200, o.Payload) } - func (o *ChangeMongoDBExporterOK) GetPayload() *ChangeMongoDBExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeMongoDBExporterDefault(code int) *ChangeMongoDBExporterDefault { } } -/*ChangeMongoDBExporterDefault handles this case with default header values. +/* ChangeMongoDBExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeMongoDBExporterDefault) Code() int { func (o *ChangeMongoDBExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeMongoDBExporter][%d] ChangeMongoDBExporter default %+v", o._statusCode, o.Payload) } - func (o *ChangeMongoDBExporterDefault) GetPayload() *ChangeMongoDBExporterDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeMongoDBExporterBody) Validate(formats strfmt.Registry) error { } func (o *ChangeMongoDBExporterBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeMongoDBExporterBody) validateCommon(formats strfmt.Registry) erro if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change mongo DB exporter body based on the context it is used +func (o *ChangeMongoDBExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeMongoDBExporterBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeMongoDBExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeMongoDBExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change mongo DB exporter default body @@ -214,7 +244,6 @@ func (o *ChangeMongoDBExporterDefaultBody) Validate(formats strfmt.Registry) err } func (o *ChangeMongoDBExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeMongoDBExporterDefaultBody) validateDetails(formats strfmt.Regist if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeMongoDBExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeMongoDBExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change mongo DB exporter default body based on the context it is used +func (o *ChangeMongoDBExporterDefaultBody) 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 *ChangeMongoDBExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeMongoDBExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeMongoDBExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeMongoDBExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangeMongoDBExporterDefaultBodyDetailsItems0 change mongo DB exporter default body details items0 +swagger:model ChangeMongoDBExporterDefaultBodyDetailsItems0 +*/ +type ChangeMongoDBExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change mongo DB exporter default body details items0 +func (o *ChangeMongoDBExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change mongo DB exporter default body details items0 based on context it is used +func (o *ChangeMongoDBExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeMongoDBExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeMongoDBExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeMongoDBExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeMongoDBExporterOKBody change mongo DB exporter OK body swagger:model ChangeMongoDBExporterOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeMongoDBExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *ChangeMongoDBExporterOKBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeMongoDBExporterOKBody) validateMongodbExporter(formats strfmt.Reg if err := o.MongodbExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeMongoDbExporterOk" + "." + "mongodb_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeMongoDbExporterOk" + "." + "mongodb_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change mongo DB exporter OK body based on the context it is used +func (o *ChangeMongoDBExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMongodbExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeMongoDBExporterOKBody) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.MongodbExporter != nil { + if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeMongoDbExporterOk" + "." + "mongodb_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeMongoDbExporterOk" + "." + "mongodb_exporter") } return err } @@ -350,17 +487,6 @@ type ChangeMongoDBExporterOKBodyMongodbExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -373,6 +499,17 @@ type ChangeMongoDBExporterOKBodyMongodbExporter struct { // Enable All collectors. EnableAllCollectors bool `json:"enable_all_collectors,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,omitempty"` } // Validate validates this change mongo DB exporter OK body mongodb exporter @@ -434,7 +571,6 @@ func (o *ChangeMongoDBExporterOKBodyMongodbExporter) validateStatusEnum(path, lo } func (o *ChangeMongoDBExporterOKBodyMongodbExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -447,6 +583,11 @@ func (o *ChangeMongoDBExporterOKBodyMongodbExporter) validateStatus(formats strf return nil } +// ContextValidate validates this change mongo DB exporter OK body mongodb exporter based on context it is used +func (o *ChangeMongoDBExporterOKBodyMongodbExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeMongoDBExporterOKBodyMongodbExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -495,6 +636,11 @@ func (o *ChangeMongoDBExporterParamsBodyCommon) Validate(formats strfmt.Registry return nil } +// ContextValidate validates this change mongo DB exporter params body common based on context it is used +func (o *ChangeMongoDBExporterParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeMongoDBExporterParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_parameters.go b/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_parameters.go index f253dcc7fb..841294429f 100644 --- a/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeMySQLdExporterParams creates a new ChangeMySQLdExporterParams object -// with the default values initialized. +// NewChangeMySQLdExporterParams creates a new ChangeMySQLdExporterParams 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 NewChangeMySQLdExporterParams() *ChangeMySQLdExporterParams { - var () return &ChangeMySQLdExporterParams{ - timeout: cr.DefaultTimeout, } } // NewChangeMySQLdExporterParamsWithTimeout creates a new ChangeMySQLdExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeMySQLdExporterParamsWithTimeout(timeout time.Duration) *ChangeMySQLdExporterParams { - var () return &ChangeMySQLdExporterParams{ - timeout: timeout, } } // NewChangeMySQLdExporterParamsWithContext creates a new ChangeMySQLdExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeMySQLdExporterParamsWithContext(ctx context.Context) *ChangeMySQLdExporterParams { - var () return &ChangeMySQLdExporterParams{ - Context: ctx, } } // NewChangeMySQLdExporterParamsWithHTTPClient creates a new ChangeMySQLdExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeMySQLdExporterParamsWithHTTPClient(client *http.Client) *ChangeMySQLdExporterParams { - var () return &ChangeMySQLdExporterParams{ HTTPClient: client, } } -/*ChangeMySQLdExporterParams contains all the parameters to send to the API endpoint -for the change my s q ld exporter operation typically these are written to a http.Request +/* ChangeMySQLdExporterParams contains all the parameters to send to the API endpoint + for the change my s q ld exporter operation. + + Typically these are written to a http.Request. */ type ChangeMySQLdExporterParams struct { - /*Body*/ + // Body. Body ChangeMySQLdExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeMySQLdExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change my s q ld exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeMySQLdExporterParams) WithDefaults() *ChangeMySQLdExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change my s q ld exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeMySQLdExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change my s q ld exporter params func (o *ChangeMySQLdExporterParams) WithTimeout(timeout time.Duration) *ChangeMySQLdExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeMySQLdExporterParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_responses.go b/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_responses.go index 2801d17c94..9477402d96 100644 --- a/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_responses.go +++ b/api/inventorypb/json/client/agents/change_my_s_q_ld_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeMySQLdExporterOK() *ChangeMySQLdExporterOK { return &ChangeMySQLdExporterOK{} } -/*ChangeMySQLdExporterOK handles this case with default header values. +/* ChangeMySQLdExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeMySQLdExporterOK struct { func (o *ChangeMySQLdExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeMySQLdExporter][%d] changeMySQLdExporterOk %+v", 200, o.Payload) } - func (o *ChangeMySQLdExporterOK) GetPayload() *ChangeMySQLdExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeMySQLdExporterDefault(code int) *ChangeMySQLdExporterDefault { } } -/*ChangeMySQLdExporterDefault handles this case with default header values. +/* ChangeMySQLdExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeMySQLdExporterDefault) Code() int { func (o *ChangeMySQLdExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeMySQLdExporter][%d] ChangeMySQLdExporter default %+v", o._statusCode, o.Payload) } - func (o *ChangeMySQLdExporterDefault) GetPayload() *ChangeMySQLdExporterDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeMySQLdExporterBody) Validate(formats strfmt.Registry) error { } func (o *ChangeMySQLdExporterBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeMySQLdExporterBody) validateCommon(formats strfmt.Registry) error if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change my s q ld exporter body based on the context it is used +func (o *ChangeMySQLdExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeMySQLdExporterBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeMySQLdExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeMySQLdExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change my s q ld exporter default body @@ -214,7 +244,6 @@ func (o *ChangeMySQLdExporterDefaultBody) Validate(formats strfmt.Registry) erro } func (o *ChangeMySQLdExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeMySQLdExporterDefaultBody) validateDetails(formats strfmt.Registr if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeMySQLdExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeMySQLdExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change my s q ld exporter default body based on the context it is used +func (o *ChangeMySQLdExporterDefaultBody) 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 *ChangeMySQLdExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeMySQLdExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeMySQLdExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeMySQLdExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangeMySQLdExporterDefaultBodyDetailsItems0 change my s q ld exporter default body details items0 +swagger:model ChangeMySQLdExporterDefaultBodyDetailsItems0 +*/ +type ChangeMySQLdExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change my s q ld exporter default body details items0 +func (o *ChangeMySQLdExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change my s q ld exporter default body details items0 based on context it is used +func (o *ChangeMySQLdExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeMySQLdExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeMySQLdExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeMySQLdExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeMySQLdExporterOKBody change my s q ld exporter OK body swagger:model ChangeMySQLdExporterOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeMySQLdExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *ChangeMySQLdExporterOKBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeMySQLdExporterOKBody) validateMysqldExporter(formats strfmt.Regis if err := o.MysqldExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeMySQLdExporterOk" + "." + "mysqld_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeMySQLdExporterOk" + "." + "mysqld_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change my s q ld exporter OK body based on the context it is used +func (o *ChangeMySQLdExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMysqldExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeMySQLdExporterOKBody) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.MysqldExporter != nil { + if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeMySQLdExporterOk" + "." + "mysqld_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeMySQLdExporterOk" + "." + "mysqld_exporter") } return err } @@ -364,6 +501,12 @@ type ChangeMySQLdExporterOKBodyMysqldExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // 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"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -374,12 +517,6 @@ type ChangeMySQLdExporterOKBodyMysqldExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` } // Validate validates this change my s q ld exporter OK body mysqld exporter @@ -441,7 +578,6 @@ func (o *ChangeMySQLdExporterOKBodyMysqldExporter) validateStatusEnum(path, loca } func (o *ChangeMySQLdExporterOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -454,6 +590,11 @@ func (o *ChangeMySQLdExporterOKBodyMysqldExporter) validateStatus(formats strfmt return nil } +// ContextValidate validates this change my s q ld exporter OK body mysqld exporter based on context it is used +func (o *ChangeMySQLdExporterOKBodyMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeMySQLdExporterOKBodyMysqldExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -502,6 +643,11 @@ func (o *ChangeMySQLdExporterParamsBodyCommon) Validate(formats strfmt.Registry) return nil } +// ContextValidate validates this change my s q ld exporter params body common based on context it is used +func (o *ChangeMySQLdExporterParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeMySQLdExporterParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_node_exporter_parameters.go b/api/inventorypb/json/client/agents/change_node_exporter_parameters.go index da33e9d994..c78f15e03a 100644 --- a/api/inventorypb/json/client/agents/change_node_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/change_node_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeNodeExporterParams creates a new ChangeNodeExporterParams object -// with the default values initialized. +// NewChangeNodeExporterParams creates a new ChangeNodeExporterParams 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 NewChangeNodeExporterParams() *ChangeNodeExporterParams { - var () return &ChangeNodeExporterParams{ - timeout: cr.DefaultTimeout, } } // NewChangeNodeExporterParamsWithTimeout creates a new ChangeNodeExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeNodeExporterParamsWithTimeout(timeout time.Duration) *ChangeNodeExporterParams { - var () return &ChangeNodeExporterParams{ - timeout: timeout, } } // NewChangeNodeExporterParamsWithContext creates a new ChangeNodeExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeNodeExporterParamsWithContext(ctx context.Context) *ChangeNodeExporterParams { - var () return &ChangeNodeExporterParams{ - Context: ctx, } } // NewChangeNodeExporterParamsWithHTTPClient creates a new ChangeNodeExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeNodeExporterParamsWithHTTPClient(client *http.Client) *ChangeNodeExporterParams { - var () return &ChangeNodeExporterParams{ HTTPClient: client, } } -/*ChangeNodeExporterParams contains all the parameters to send to the API endpoint -for the change node exporter operation typically these are written to a http.Request +/* ChangeNodeExporterParams contains all the parameters to send to the API endpoint + for the change node exporter operation. + + Typically these are written to a http.Request. */ type ChangeNodeExporterParams struct { - /*Body*/ + // Body. Body ChangeNodeExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeNodeExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change node exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeNodeExporterParams) WithDefaults() *ChangeNodeExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change node exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeNodeExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change node exporter params func (o *ChangeNodeExporterParams) WithTimeout(timeout time.Duration) *ChangeNodeExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeNodeExporterParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_node_exporter_responses.go b/api/inventorypb/json/client/agents/change_node_exporter_responses.go index 3d57ab3ff9..7fae40bb8b 100644 --- a/api/inventorypb/json/client/agents/change_node_exporter_responses.go +++ b/api/inventorypb/json/client/agents/change_node_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeNodeExporterOK() *ChangeNodeExporterOK { return &ChangeNodeExporterOK{} } -/*ChangeNodeExporterOK handles this case with default header values. +/* ChangeNodeExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeNodeExporterOK struct { func (o *ChangeNodeExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeNodeExporter][%d] changeNodeExporterOk %+v", 200, o.Payload) } - func (o *ChangeNodeExporterOK) GetPayload() *ChangeNodeExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeNodeExporterDefault(code int) *ChangeNodeExporterDefault { } } -/*ChangeNodeExporterDefault handles this case with default header values. +/* ChangeNodeExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeNodeExporterDefault) Code() int { func (o *ChangeNodeExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeNodeExporter][%d] ChangeNodeExporter default %+v", o._statusCode, o.Payload) } - func (o *ChangeNodeExporterDefault) GetPayload() *ChangeNodeExporterDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeNodeExporterBody) Validate(formats strfmt.Registry) error { } func (o *ChangeNodeExporterBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeNodeExporterBody) validateCommon(formats strfmt.Registry) error { if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change node exporter body based on the context it is used +func (o *ChangeNodeExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeNodeExporterBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeNodeExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeNodeExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change node exporter default body @@ -214,7 +244,6 @@ func (o *ChangeNodeExporterDefaultBody) Validate(formats strfmt.Registry) error } func (o *ChangeNodeExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeNodeExporterDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeNodeExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeNodeExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change node exporter default body based on the context it is used +func (o *ChangeNodeExporterDefaultBody) 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 *ChangeNodeExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeNodeExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeNodeExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeNodeExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangeNodeExporterDefaultBodyDetailsItems0 change node exporter default body details items0 +swagger:model ChangeNodeExporterDefaultBodyDetailsItems0 +*/ +type ChangeNodeExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change node exporter default body details items0 +func (o *ChangeNodeExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change node exporter default body details items0 based on context it is used +func (o *ChangeNodeExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeNodeExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeNodeExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeNodeExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeNodeExporterOKBody change node exporter OK body swagger:model ChangeNodeExporterOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeNodeExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *ChangeNodeExporterOKBody) validateNodeExporter(formats strfmt.Registry) error { - if swag.IsZero(o.NodeExporter) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeNodeExporterOKBody) validateNodeExporter(formats strfmt.Registry) if err := o.NodeExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeNodeExporterOk" + "." + "node_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeNodeExporterOk" + "." + "node_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change node exporter OK body based on the context it is used +func (o *ChangeNodeExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateNodeExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeNodeExporterOKBody) contextValidateNodeExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.NodeExporter != nil { + if err := o.NodeExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeNodeExporterOk" + "." + "node_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeNodeExporterOk" + "." + "node_exporter") } return err } @@ -338,6 +475,9 @@ type ChangeNodeExporterOKBodyNodeExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -348,9 +488,6 @@ type ChangeNodeExporterOKBodyNodeExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this change node exporter OK body node exporter @@ -412,7 +549,6 @@ func (o *ChangeNodeExporterOKBodyNodeExporter) validateStatusEnum(path, location } func (o *ChangeNodeExporterOKBodyNodeExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -425,6 +561,11 @@ func (o *ChangeNodeExporterOKBodyNodeExporter) validateStatus(formats strfmt.Reg return nil } +// ContextValidate validates this change node exporter OK body node exporter based on context it is used +func (o *ChangeNodeExporterOKBodyNodeExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeNodeExporterOKBodyNodeExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -473,6 +614,11 @@ func (o *ChangeNodeExporterParamsBodyCommon) Validate(formats strfmt.Registry) e return nil } +// ContextValidate validates this change node exporter params body common based on context it is used +func (o *ChangeNodeExporterParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeNodeExporterParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_postgres_exporter_parameters.go b/api/inventorypb/json/client/agents/change_postgres_exporter_parameters.go index a90b56a409..0545d2dcb2 100644 --- a/api/inventorypb/json/client/agents/change_postgres_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/change_postgres_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangePostgresExporterParams creates a new ChangePostgresExporterParams object -// with the default values initialized. +// NewChangePostgresExporterParams creates a new ChangePostgresExporterParams 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 NewChangePostgresExporterParams() *ChangePostgresExporterParams { - var () return &ChangePostgresExporterParams{ - timeout: cr.DefaultTimeout, } } // NewChangePostgresExporterParamsWithTimeout creates a new ChangePostgresExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangePostgresExporterParamsWithTimeout(timeout time.Duration) *ChangePostgresExporterParams { - var () return &ChangePostgresExporterParams{ - timeout: timeout, } } // NewChangePostgresExporterParamsWithContext creates a new ChangePostgresExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangePostgresExporterParamsWithContext(ctx context.Context) *ChangePostgresExporterParams { - var () return &ChangePostgresExporterParams{ - Context: ctx, } } // NewChangePostgresExporterParamsWithHTTPClient creates a new ChangePostgresExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangePostgresExporterParamsWithHTTPClient(client *http.Client) *ChangePostgresExporterParams { - var () return &ChangePostgresExporterParams{ HTTPClient: client, } } -/*ChangePostgresExporterParams contains all the parameters to send to the API endpoint -for the change postgres exporter operation typically these are written to a http.Request +/* ChangePostgresExporterParams contains all the parameters to send to the API endpoint + for the change postgres exporter operation. + + Typically these are written to a http.Request. */ type ChangePostgresExporterParams struct { - /*Body*/ + // Body. Body ChangePostgresExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangePostgresExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change postgres exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangePostgresExporterParams) WithDefaults() *ChangePostgresExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change postgres exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangePostgresExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change postgres exporter params func (o *ChangePostgresExporterParams) WithTimeout(timeout time.Duration) *ChangePostgresExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangePostgresExporterParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_postgres_exporter_responses.go b/api/inventorypb/json/client/agents/change_postgres_exporter_responses.go index 82bf2422e8..3be4725caf 100644 --- a/api/inventorypb/json/client/agents/change_postgres_exporter_responses.go +++ b/api/inventorypb/json/client/agents/change_postgres_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangePostgresExporterOK() *ChangePostgresExporterOK { return &ChangePostgresExporterOK{} } -/*ChangePostgresExporterOK handles this case with default header values. +/* ChangePostgresExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangePostgresExporterOK struct { func (o *ChangePostgresExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangePostgresExporter][%d] changePostgresExporterOk %+v", 200, o.Payload) } - func (o *ChangePostgresExporterOK) GetPayload() *ChangePostgresExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangePostgresExporterDefault(code int) *ChangePostgresExporterDefault { } } -/*ChangePostgresExporterDefault handles this case with default header values. +/* ChangePostgresExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangePostgresExporterDefault) Code() int { func (o *ChangePostgresExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangePostgresExporter][%d] ChangePostgresExporter default %+v", o._statusCode, o.Payload) } - func (o *ChangePostgresExporterDefault) GetPayload() *ChangePostgresExporterDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangePostgresExporterBody) Validate(formats strfmt.Registry) error { } func (o *ChangePostgresExporterBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangePostgresExporterBody) validateCommon(formats strfmt.Registry) err if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change postgres exporter body based on the context it is used +func (o *ChangePostgresExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangePostgresExporterBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangePostgresExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangePostgresExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change postgres exporter default body @@ -214,7 +244,6 @@ func (o *ChangePostgresExporterDefaultBody) Validate(formats strfmt.Registry) er } func (o *ChangePostgresExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangePostgresExporterDefaultBody) validateDetails(formats strfmt.Regis if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangePostgresExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangePostgresExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change postgres exporter default body based on the context it is used +func (o *ChangePostgresExporterDefaultBody) 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 *ChangePostgresExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangePostgresExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangePostgresExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangePostgresExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangePostgresExporterDefaultBodyDetailsItems0 change postgres exporter default body details items0 +swagger:model ChangePostgresExporterDefaultBodyDetailsItems0 +*/ +type ChangePostgresExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change postgres exporter default body details items0 +func (o *ChangePostgresExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change postgres exporter default body details items0 based on context it is used +func (o *ChangePostgresExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangePostgresExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangePostgresExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangePostgresExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangePostgresExporterOKBody change postgres exporter OK body swagger:model ChangePostgresExporterOKBody */ @@ -280,7 +386,6 @@ func (o *ChangePostgresExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *ChangePostgresExporterOKBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangePostgresExporterOKBody) validatePostgresExporter(formats strfmt.R if err := o.PostgresExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changePostgresExporterOk" + "." + "postgres_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changePostgresExporterOk" + "." + "postgres_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change postgres exporter OK body based on the context it is used +func (o *ChangePostgresExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePostgresExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangePostgresExporterOKBody) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.PostgresExporter != nil { + if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changePostgresExporterOk" + "." + "postgres_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changePostgresExporterOk" + "." + "postgres_exporter") } return err } @@ -350,6 +487,9 @@ type ChangePostgresExporterOKBodyPostgresExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -360,9 +500,6 @@ type ChangePostgresExporterOKBodyPostgresExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this change postgres exporter OK body postgres exporter @@ -424,7 +561,6 @@ func (o *ChangePostgresExporterOKBodyPostgresExporter) validateStatusEnum(path, } func (o *ChangePostgresExporterOKBodyPostgresExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -437,6 +573,11 @@ func (o *ChangePostgresExporterOKBodyPostgresExporter) validateStatus(formats st return nil } +// ContextValidate validates this change postgres exporter OK body postgres exporter based on context it is used +func (o *ChangePostgresExporterOKBodyPostgresExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangePostgresExporterOKBodyPostgresExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -485,6 +626,11 @@ func (o *ChangePostgresExporterParamsBodyCommon) Validate(formats strfmt.Registr return nil } +// ContextValidate validates this change postgres exporter params body common based on context it is used +func (o *ChangePostgresExporterParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangePostgresExporterParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_proxy_sql_exporter_parameters.go b/api/inventorypb/json/client/agents/change_proxy_sql_exporter_parameters.go index 734d8635ec..78febd029d 100644 --- a/api/inventorypb/json/client/agents/change_proxy_sql_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/change_proxy_sql_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeProxySQLExporterParams creates a new ChangeProxySQLExporterParams object -// with the default values initialized. +// NewChangeProxySQLExporterParams creates a new ChangeProxySQLExporterParams 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 NewChangeProxySQLExporterParams() *ChangeProxySQLExporterParams { - var () return &ChangeProxySQLExporterParams{ - timeout: cr.DefaultTimeout, } } // NewChangeProxySQLExporterParamsWithTimeout creates a new ChangeProxySQLExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeProxySQLExporterParamsWithTimeout(timeout time.Duration) *ChangeProxySQLExporterParams { - var () return &ChangeProxySQLExporterParams{ - timeout: timeout, } } // NewChangeProxySQLExporterParamsWithContext creates a new ChangeProxySQLExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeProxySQLExporterParamsWithContext(ctx context.Context) *ChangeProxySQLExporterParams { - var () return &ChangeProxySQLExporterParams{ - Context: ctx, } } // NewChangeProxySQLExporterParamsWithHTTPClient creates a new ChangeProxySQLExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeProxySQLExporterParamsWithHTTPClient(client *http.Client) *ChangeProxySQLExporterParams { - var () return &ChangeProxySQLExporterParams{ HTTPClient: client, } } -/*ChangeProxySQLExporterParams contains all the parameters to send to the API endpoint -for the change proxy SQL exporter operation typically these are written to a http.Request +/* ChangeProxySQLExporterParams contains all the parameters to send to the API endpoint + for the change proxy SQL exporter operation. + + Typically these are written to a http.Request. */ type ChangeProxySQLExporterParams struct { - /*Body*/ + // Body. Body ChangeProxySQLExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeProxySQLExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change proxy SQL exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeProxySQLExporterParams) WithDefaults() *ChangeProxySQLExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change proxy SQL exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeProxySQLExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change proxy SQL exporter params func (o *ChangeProxySQLExporterParams) WithTimeout(timeout time.Duration) *ChangeProxySQLExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeProxySQLExporterParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_proxy_sql_exporter_responses.go b/api/inventorypb/json/client/agents/change_proxy_sql_exporter_responses.go index a7276bf5a5..eace10dba7 100644 --- a/api/inventorypb/json/client/agents/change_proxy_sql_exporter_responses.go +++ b/api/inventorypb/json/client/agents/change_proxy_sql_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeProxySQLExporterOK() *ChangeProxySQLExporterOK { return &ChangeProxySQLExporterOK{} } -/*ChangeProxySQLExporterOK handles this case with default header values. +/* ChangeProxySQLExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeProxySQLExporterOK struct { func (o *ChangeProxySQLExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeProxySQLExporter][%d] changeProxySqlExporterOk %+v", 200, o.Payload) } - func (o *ChangeProxySQLExporterOK) GetPayload() *ChangeProxySQLExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeProxySQLExporterDefault(code int) *ChangeProxySQLExporterDefault { } } -/*ChangeProxySQLExporterDefault handles this case with default header values. +/* ChangeProxySQLExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeProxySQLExporterDefault) Code() int { func (o *ChangeProxySQLExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeProxySQLExporter][%d] ChangeProxySQLExporter default %+v", o._statusCode, o.Payload) } - func (o *ChangeProxySQLExporterDefault) GetPayload() *ChangeProxySQLExporterDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeProxySQLExporterBody) Validate(formats strfmt.Registry) error { } func (o *ChangeProxySQLExporterBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeProxySQLExporterBody) validateCommon(formats strfmt.Registry) err if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change proxy SQL exporter body based on the context it is used +func (o *ChangeProxySQLExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeProxySQLExporterBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeProxySQLExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeProxySQLExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change proxy SQL exporter default body @@ -214,7 +244,6 @@ func (o *ChangeProxySQLExporterDefaultBody) Validate(formats strfmt.Registry) er } func (o *ChangeProxySQLExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeProxySQLExporterDefaultBody) validateDetails(formats strfmt.Regis if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeProxySQLExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeProxySQLExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change proxy SQL exporter default body based on the context it is used +func (o *ChangeProxySQLExporterDefaultBody) 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 *ChangeProxySQLExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeProxySQLExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeProxySQLExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeProxySQLExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangeProxySQLExporterDefaultBodyDetailsItems0 change proxy SQL exporter default body details items0 +swagger:model ChangeProxySQLExporterDefaultBodyDetailsItems0 +*/ +type ChangeProxySQLExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change proxy SQL exporter default body details items0 +func (o *ChangeProxySQLExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change proxy SQL exporter default body details items0 based on context it is used +func (o *ChangeProxySQLExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeProxySQLExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeProxySQLExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeProxySQLExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeProxySQLExporterOKBody change proxy SQL exporter OK body swagger:model ChangeProxySQLExporterOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeProxySQLExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *ChangeProxySQLExporterOKBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeProxySQLExporterOKBody) validateProxysqlExporter(formats strfmt.R if err := o.ProxysqlExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeProxySqlExporterOk" + "." + "proxysql_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeProxySqlExporterOk" + "." + "proxysql_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change proxy SQL exporter OK body based on the context it is used +func (o *ChangeProxySQLExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateProxysqlExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeProxySQLExporterOKBody) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.ProxysqlExporter != nil { + if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeProxySqlExporterOk" + "." + "proxysql_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeProxySqlExporterOk" + "." + "proxysql_exporter") } return err } @@ -350,6 +487,9 @@ type ChangeProxySQLExporterOKBodyProxysqlExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -360,9 +500,6 @@ type ChangeProxySQLExporterOKBodyProxysqlExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this change proxy SQL exporter OK body proxysql exporter @@ -424,7 +561,6 @@ func (o *ChangeProxySQLExporterOKBodyProxysqlExporter) validateStatusEnum(path, } func (o *ChangeProxySQLExporterOKBodyProxysqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -437,6 +573,11 @@ func (o *ChangeProxySQLExporterOKBodyProxysqlExporter) validateStatus(formats st return nil } +// ContextValidate validates this change proxy SQL exporter OK body proxysql exporter based on context it is used +func (o *ChangeProxySQLExporterOKBodyProxysqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeProxySQLExporterOKBodyProxysqlExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -485,6 +626,11 @@ func (o *ChangeProxySQLExporterParamsBodyCommon) Validate(formats strfmt.Registr return nil } +// ContextValidate validates this change proxy SQL exporter params body common based on context it is used +func (o *ChangeProxySQLExporterParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeProxySQLExporterParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_qan_mongo_db_profiler_agent_parameters.go b/api/inventorypb/json/client/agents/change_qan_mongo_db_profiler_agent_parameters.go index ec1931e444..8fcceb4b1a 100644 --- a/api/inventorypb/json/client/agents/change_qan_mongo_db_profiler_agent_parameters.go +++ b/api/inventorypb/json/client/agents/change_qan_mongo_db_profiler_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeQANMongoDBProfilerAgentParams creates a new ChangeQANMongoDBProfilerAgentParams object -// with the default values initialized. +// NewChangeQANMongoDBProfilerAgentParams creates a new ChangeQANMongoDBProfilerAgentParams 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 NewChangeQANMongoDBProfilerAgentParams() *ChangeQANMongoDBProfilerAgentParams { - var () return &ChangeQANMongoDBProfilerAgentParams{ - timeout: cr.DefaultTimeout, } } // NewChangeQANMongoDBProfilerAgentParamsWithTimeout creates a new ChangeQANMongoDBProfilerAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeQANMongoDBProfilerAgentParamsWithTimeout(timeout time.Duration) *ChangeQANMongoDBProfilerAgentParams { - var () return &ChangeQANMongoDBProfilerAgentParams{ - timeout: timeout, } } // NewChangeQANMongoDBProfilerAgentParamsWithContext creates a new ChangeQANMongoDBProfilerAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeQANMongoDBProfilerAgentParamsWithContext(ctx context.Context) *ChangeQANMongoDBProfilerAgentParams { - var () return &ChangeQANMongoDBProfilerAgentParams{ - Context: ctx, } } // NewChangeQANMongoDBProfilerAgentParamsWithHTTPClient creates a new ChangeQANMongoDBProfilerAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeQANMongoDBProfilerAgentParamsWithHTTPClient(client *http.Client) *ChangeQANMongoDBProfilerAgentParams { - var () return &ChangeQANMongoDBProfilerAgentParams{ HTTPClient: client, } } -/*ChangeQANMongoDBProfilerAgentParams contains all the parameters to send to the API endpoint -for the change QAN mongo DB profiler agent operation typically these are written to a http.Request +/* ChangeQANMongoDBProfilerAgentParams contains all the parameters to send to the API endpoint + for the change QAN mongo DB profiler agent operation. + + Typically these are written to a http.Request. */ type ChangeQANMongoDBProfilerAgentParams struct { - /*Body*/ + // Body. Body ChangeQANMongoDBProfilerAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeQANMongoDBProfilerAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change QAN mongo DB profiler agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeQANMongoDBProfilerAgentParams) WithDefaults() *ChangeQANMongoDBProfilerAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change QAN mongo DB profiler agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeQANMongoDBProfilerAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change QAN mongo DB profiler agent params func (o *ChangeQANMongoDBProfilerAgentParams) WithTimeout(timeout time.Duration) *ChangeQANMongoDBProfilerAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeQANMongoDBProfilerAgentParams) WriteToRequest(r runtime.ClientReq return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_qan_mongo_db_profiler_agent_responses.go b/api/inventorypb/json/client/agents/change_qan_mongo_db_profiler_agent_responses.go index 9b62a128d1..b9800607e3 100644 --- a/api/inventorypb/json/client/agents/change_qan_mongo_db_profiler_agent_responses.go +++ b/api/inventorypb/json/client/agents/change_qan_mongo_db_profiler_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeQANMongoDBProfilerAgentOK() *ChangeQANMongoDBProfilerAgentOK { return &ChangeQANMongoDBProfilerAgentOK{} } -/*ChangeQANMongoDBProfilerAgentOK handles this case with default header values. +/* ChangeQANMongoDBProfilerAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeQANMongoDBProfilerAgentOK struct { func (o *ChangeQANMongoDBProfilerAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeQANMongoDBProfilerAgent][%d] changeQanMongoDbProfilerAgentOk %+v", 200, o.Payload) } - func (o *ChangeQANMongoDBProfilerAgentOK) GetPayload() *ChangeQANMongoDBProfilerAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeQANMongoDBProfilerAgentDefault(code int) *ChangeQANMongoDBProfiler } } -/*ChangeQANMongoDBProfilerAgentDefault handles this case with default header values. +/* ChangeQANMongoDBProfilerAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeQANMongoDBProfilerAgentDefault) Code() int { func (o *ChangeQANMongoDBProfilerAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeQANMongoDBProfilerAgent][%d] ChangeQANMongoDBProfilerAgent default %+v", o._statusCode, o.Payload) } - func (o *ChangeQANMongoDBProfilerAgentDefault) GetPayload() *ChangeQANMongoDBProfilerAgentDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeQANMongoDBProfilerAgentBody) Validate(formats strfmt.Registry) er } func (o *ChangeQANMongoDBProfilerAgentBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeQANMongoDBProfilerAgentBody) validateCommon(formats strfmt.Regist if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change QAN mongo DB profiler agent body based on the context it is used +func (o *ChangeQANMongoDBProfilerAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeQANMongoDBProfilerAgentBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeQANMongoDBProfilerAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeQANMongoDBProfilerAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change QAN mongo DB profiler agent default body @@ -214,7 +244,6 @@ func (o *ChangeQANMongoDBProfilerAgentDefaultBody) Validate(formats strfmt.Regis } func (o *ChangeQANMongoDBProfilerAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeQANMongoDBProfilerAgentDefaultBody) validateDetails(formats strfm if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeQANMongoDBProfilerAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeQANMongoDBProfilerAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change QAN mongo DB profiler agent default body based on the context it is used +func (o *ChangeQANMongoDBProfilerAgentDefaultBody) 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 *ChangeQANMongoDBProfilerAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeQANMongoDBProfilerAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeQANMongoDBProfilerAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeQANMongoDBProfilerAgentDefaultBody) UnmarshalBinary(b []byte) err return nil } +/*ChangeQANMongoDBProfilerAgentDefaultBodyDetailsItems0 change QAN mongo DB profiler agent default body details items0 +swagger:model ChangeQANMongoDBProfilerAgentDefaultBodyDetailsItems0 +*/ +type ChangeQANMongoDBProfilerAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change QAN mongo DB profiler agent default body details items0 +func (o *ChangeQANMongoDBProfilerAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change QAN mongo DB profiler agent default body details items0 based on context it is used +func (o *ChangeQANMongoDBProfilerAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeQANMongoDBProfilerAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeQANMongoDBProfilerAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeQANMongoDBProfilerAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeQANMongoDBProfilerAgentOKBody change QAN mongo DB profiler agent OK body swagger:model ChangeQANMongoDBProfilerAgentOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeQANMongoDBProfilerAgentOKBody) Validate(formats strfmt.Registry) } func (o *ChangeQANMongoDBProfilerAgentOKBody) validateQANMongodbProfilerAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeQANMongoDBProfilerAgentOKBody) validateQANMongodbProfilerAgent(fo if err := o.QANMongodbProfilerAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeQanMongoDbProfilerAgentOk" + "." + "qan_mongodb_profiler_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeQanMongoDbProfilerAgentOk" + "." + "qan_mongodb_profiler_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change QAN mongo DB profiler agent OK body based on the context it is used +func (o *ChangeQANMongoDBProfilerAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateQANMongodbProfilerAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeQANMongoDBProfilerAgentOKBody) contextValidateQANMongodbProfilerAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMongodbProfilerAgent != nil { + if err := o.QANMongodbProfilerAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeQanMongoDbProfilerAgentOk" + "." + "qan_mongodb_profiler_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeQanMongoDbProfilerAgentOk" + "." + "qan_mongodb_profiler_agent") } return err } @@ -415,7 +552,6 @@ func (o *ChangeQANMongoDBProfilerAgentOKBodyQANMongodbProfilerAgent) validateSta } func (o *ChangeQANMongoDBProfilerAgentOKBodyQANMongodbProfilerAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -428,6 +564,11 @@ func (o *ChangeQANMongoDBProfilerAgentOKBodyQANMongodbProfilerAgent) validateSta return nil } +// ContextValidate validates this change QAN mongo DB profiler agent OK body QAN mongodb profiler agent based on context it is used +func (o *ChangeQANMongoDBProfilerAgentOKBodyQANMongodbProfilerAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeQANMongoDBProfilerAgentOKBodyQANMongodbProfilerAgent) MarshalBinary() ([]byte, error) { if o == nil { @@ -476,6 +617,11 @@ func (o *ChangeQANMongoDBProfilerAgentParamsBodyCommon) Validate(formats strfmt. return nil } +// ContextValidate validates this change QAN mongo DB profiler agent params body common based on context it is used +func (o *ChangeQANMongoDBProfilerAgentParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeQANMongoDBProfilerAgentParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_qan_my_sql_perf_schema_agent_parameters.go b/api/inventorypb/json/client/agents/change_qan_my_sql_perf_schema_agent_parameters.go index 99e6cdec0f..5b0518164e 100644 --- a/api/inventorypb/json/client/agents/change_qan_my_sql_perf_schema_agent_parameters.go +++ b/api/inventorypb/json/client/agents/change_qan_my_sql_perf_schema_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeQANMySQLPerfSchemaAgentParams creates a new ChangeQANMySQLPerfSchemaAgentParams object -// with the default values initialized. +// NewChangeQANMySQLPerfSchemaAgentParams creates a new ChangeQANMySQLPerfSchemaAgentParams 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 NewChangeQANMySQLPerfSchemaAgentParams() *ChangeQANMySQLPerfSchemaAgentParams { - var () return &ChangeQANMySQLPerfSchemaAgentParams{ - timeout: cr.DefaultTimeout, } } // NewChangeQANMySQLPerfSchemaAgentParamsWithTimeout creates a new ChangeQANMySQLPerfSchemaAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeQANMySQLPerfSchemaAgentParamsWithTimeout(timeout time.Duration) *ChangeQANMySQLPerfSchemaAgentParams { - var () return &ChangeQANMySQLPerfSchemaAgentParams{ - timeout: timeout, } } // NewChangeQANMySQLPerfSchemaAgentParamsWithContext creates a new ChangeQANMySQLPerfSchemaAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeQANMySQLPerfSchemaAgentParamsWithContext(ctx context.Context) *ChangeQANMySQLPerfSchemaAgentParams { - var () return &ChangeQANMySQLPerfSchemaAgentParams{ - Context: ctx, } } // NewChangeQANMySQLPerfSchemaAgentParamsWithHTTPClient creates a new ChangeQANMySQLPerfSchemaAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeQANMySQLPerfSchemaAgentParamsWithHTTPClient(client *http.Client) *ChangeQANMySQLPerfSchemaAgentParams { - var () return &ChangeQANMySQLPerfSchemaAgentParams{ HTTPClient: client, } } -/*ChangeQANMySQLPerfSchemaAgentParams contains all the parameters to send to the API endpoint -for the change QAN my SQL perf schema agent operation typically these are written to a http.Request +/* ChangeQANMySQLPerfSchemaAgentParams contains all the parameters to send to the API endpoint + for the change QAN my SQL perf schema agent operation. + + Typically these are written to a http.Request. */ type ChangeQANMySQLPerfSchemaAgentParams struct { - /*Body*/ + // Body. Body ChangeQANMySQLPerfSchemaAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeQANMySQLPerfSchemaAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change QAN my SQL perf schema agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeQANMySQLPerfSchemaAgentParams) WithDefaults() *ChangeQANMySQLPerfSchemaAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change QAN my SQL perf schema agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeQANMySQLPerfSchemaAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change QAN my SQL perf schema agent params func (o *ChangeQANMySQLPerfSchemaAgentParams) WithTimeout(timeout time.Duration) *ChangeQANMySQLPerfSchemaAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeQANMySQLPerfSchemaAgentParams) WriteToRequest(r runtime.ClientReq return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_qan_my_sql_perf_schema_agent_responses.go b/api/inventorypb/json/client/agents/change_qan_my_sql_perf_schema_agent_responses.go index 1ff4508756..1c7e113455 100644 --- a/api/inventorypb/json/client/agents/change_qan_my_sql_perf_schema_agent_responses.go +++ b/api/inventorypb/json/client/agents/change_qan_my_sql_perf_schema_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeQANMySQLPerfSchemaAgentOK() *ChangeQANMySQLPerfSchemaAgentOK { return &ChangeQANMySQLPerfSchemaAgentOK{} } -/*ChangeQANMySQLPerfSchemaAgentOK handles this case with default header values. +/* ChangeQANMySQLPerfSchemaAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeQANMySQLPerfSchemaAgentOK struct { func (o *ChangeQANMySQLPerfSchemaAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeQANMySQLPerfSchemaAgent][%d] changeQanMySqlPerfSchemaAgentOk %+v", 200, o.Payload) } - func (o *ChangeQANMySQLPerfSchemaAgentOK) GetPayload() *ChangeQANMySQLPerfSchemaAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeQANMySQLPerfSchemaAgentDefault(code int) *ChangeQANMySQLPerfSchema } } -/*ChangeQANMySQLPerfSchemaAgentDefault handles this case with default header values. +/* ChangeQANMySQLPerfSchemaAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeQANMySQLPerfSchemaAgentDefault) Code() int { func (o *ChangeQANMySQLPerfSchemaAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeQANMySQLPerfSchemaAgent][%d] ChangeQANMySQLPerfSchemaAgent default %+v", o._statusCode, o.Payload) } - func (o *ChangeQANMySQLPerfSchemaAgentDefault) GetPayload() *ChangeQANMySQLPerfSchemaAgentDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeQANMySQLPerfSchemaAgentBody) Validate(formats strfmt.Registry) er } func (o *ChangeQANMySQLPerfSchemaAgentBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeQANMySQLPerfSchemaAgentBody) validateCommon(formats strfmt.Regist if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change QAN my SQL perf schema agent body based on the context it is used +func (o *ChangeQANMySQLPerfSchemaAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeQANMySQLPerfSchemaAgentBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeQANMySQLPerfSchemaAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change QAN my SQL perf schema agent default body @@ -214,7 +244,6 @@ func (o *ChangeQANMySQLPerfSchemaAgentDefaultBody) Validate(formats strfmt.Regis } func (o *ChangeQANMySQLPerfSchemaAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeQANMySQLPerfSchemaAgentDefaultBody) validateDetails(formats strfm if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeQANMySQLPerfSchemaAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeQANMySQLPerfSchemaAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change QAN my SQL perf schema agent default body based on the context it is used +func (o *ChangeQANMySQLPerfSchemaAgentDefaultBody) 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 *ChangeQANMySQLPerfSchemaAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeQANMySQLPerfSchemaAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeQANMySQLPerfSchemaAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeQANMySQLPerfSchemaAgentDefaultBody) UnmarshalBinary(b []byte) err return nil } +/*ChangeQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0 change QAN my SQL perf schema agent default body details items0 +swagger:model ChangeQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0 +*/ +type ChangeQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change QAN my SQL perf schema agent default body details items0 +func (o *ChangeQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change QAN my SQL perf schema agent default body details items0 based on context it is used +func (o *ChangeQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeQANMySQLPerfSchemaAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeQANMySQLPerfSchemaAgentOKBody change QAN my SQL perf schema agent OK body swagger:model ChangeQANMySQLPerfSchemaAgentOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeQANMySQLPerfSchemaAgentOKBody) Validate(formats strfmt.Registry) } func (o *ChangeQANMySQLPerfSchemaAgentOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeQANMySQLPerfSchemaAgentOKBody) validateQANMysqlPerfschemaAgent(fo if err := o.QANMysqlPerfschemaAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeQanMySqlPerfSchemaAgentOk" + "." + "qan_mysql_perfschema_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeQanMySqlPerfSchemaAgentOk" + "." + "qan_mysql_perfschema_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change QAN my SQL perf schema agent OK body based on the context it is used +func (o *ChangeQANMySQLPerfSchemaAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateQANMysqlPerfschemaAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeQANMySQLPerfSchemaAgentOKBody) contextValidateQANMysqlPerfschemaAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMysqlPerfschemaAgent != nil { + if err := o.QANMysqlPerfschemaAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeQanMySqlPerfSchemaAgentOk" + "." + "qan_mysql_perfschema_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeQanMySqlPerfSchemaAgentOk" + "." + "qan_mysql_perfschema_agent") } return err } @@ -427,7 +564,6 @@ func (o *ChangeQANMySQLPerfSchemaAgentOKBodyQANMysqlPerfschemaAgent) validateSta } func (o *ChangeQANMySQLPerfSchemaAgentOKBodyQANMysqlPerfschemaAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -440,6 +576,11 @@ func (o *ChangeQANMySQLPerfSchemaAgentOKBodyQANMysqlPerfschemaAgent) validateSta return nil } +// ContextValidate validates this change QAN my SQL perf schema agent OK body QAN mysql perfschema agent based on context it is used +func (o *ChangeQANMySQLPerfSchemaAgentOKBodyQANMysqlPerfschemaAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeQANMySQLPerfSchemaAgentOKBodyQANMysqlPerfschemaAgent) MarshalBinary() ([]byte, error) { if o == nil { @@ -488,6 +629,11 @@ func (o *ChangeQANMySQLPerfSchemaAgentParamsBodyCommon) Validate(formats strfmt. return nil } +// ContextValidate validates this change QAN my SQL perf schema agent params body common based on context it is used +func (o *ChangeQANMySQLPerfSchemaAgentParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeQANMySQLPerfSchemaAgentParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_qan_my_sql_slowlog_agent_parameters.go b/api/inventorypb/json/client/agents/change_qan_my_sql_slowlog_agent_parameters.go index f872b2a159..4b72e8059b 100644 --- a/api/inventorypb/json/client/agents/change_qan_my_sql_slowlog_agent_parameters.go +++ b/api/inventorypb/json/client/agents/change_qan_my_sql_slowlog_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeQANMySQLSlowlogAgentParams creates a new ChangeQANMySQLSlowlogAgentParams object -// with the default values initialized. +// NewChangeQANMySQLSlowlogAgentParams creates a new ChangeQANMySQLSlowlogAgentParams 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 NewChangeQANMySQLSlowlogAgentParams() *ChangeQANMySQLSlowlogAgentParams { - var () return &ChangeQANMySQLSlowlogAgentParams{ - timeout: cr.DefaultTimeout, } } // NewChangeQANMySQLSlowlogAgentParamsWithTimeout creates a new ChangeQANMySQLSlowlogAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeQANMySQLSlowlogAgentParamsWithTimeout(timeout time.Duration) *ChangeQANMySQLSlowlogAgentParams { - var () return &ChangeQANMySQLSlowlogAgentParams{ - timeout: timeout, } } // NewChangeQANMySQLSlowlogAgentParamsWithContext creates a new ChangeQANMySQLSlowlogAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeQANMySQLSlowlogAgentParamsWithContext(ctx context.Context) *ChangeQANMySQLSlowlogAgentParams { - var () return &ChangeQANMySQLSlowlogAgentParams{ - Context: ctx, } } // NewChangeQANMySQLSlowlogAgentParamsWithHTTPClient creates a new ChangeQANMySQLSlowlogAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeQANMySQLSlowlogAgentParamsWithHTTPClient(client *http.Client) *ChangeQANMySQLSlowlogAgentParams { - var () return &ChangeQANMySQLSlowlogAgentParams{ HTTPClient: client, } } -/*ChangeQANMySQLSlowlogAgentParams contains all the parameters to send to the API endpoint -for the change QAN my SQL slowlog agent operation typically these are written to a http.Request +/* ChangeQANMySQLSlowlogAgentParams contains all the parameters to send to the API endpoint + for the change QAN my SQL slowlog agent operation. + + Typically these are written to a http.Request. */ type ChangeQANMySQLSlowlogAgentParams struct { - /*Body*/ + // Body. Body ChangeQANMySQLSlowlogAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeQANMySQLSlowlogAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change QAN my SQL slowlog agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeQANMySQLSlowlogAgentParams) WithDefaults() *ChangeQANMySQLSlowlogAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change QAN my SQL slowlog agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeQANMySQLSlowlogAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change QAN my SQL slowlog agent params func (o *ChangeQANMySQLSlowlogAgentParams) WithTimeout(timeout time.Duration) *ChangeQANMySQLSlowlogAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeQANMySQLSlowlogAgentParams) WriteToRequest(r runtime.ClientReques return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_qan_my_sql_slowlog_agent_responses.go b/api/inventorypb/json/client/agents/change_qan_my_sql_slowlog_agent_responses.go index a597737cc3..57e907dbf7 100644 --- a/api/inventorypb/json/client/agents/change_qan_my_sql_slowlog_agent_responses.go +++ b/api/inventorypb/json/client/agents/change_qan_my_sql_slowlog_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeQANMySQLSlowlogAgentOK() *ChangeQANMySQLSlowlogAgentOK { return &ChangeQANMySQLSlowlogAgentOK{} } -/*ChangeQANMySQLSlowlogAgentOK handles this case with default header values. +/* ChangeQANMySQLSlowlogAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeQANMySQLSlowlogAgentOK struct { func (o *ChangeQANMySQLSlowlogAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeQANMySQLSlowlogAgent][%d] changeQanMySqlSlowlogAgentOk %+v", 200, o.Payload) } - func (o *ChangeQANMySQLSlowlogAgentOK) GetPayload() *ChangeQANMySQLSlowlogAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeQANMySQLSlowlogAgentDefault(code int) *ChangeQANMySQLSlowlogAgentD } } -/*ChangeQANMySQLSlowlogAgentDefault handles this case with default header values. +/* ChangeQANMySQLSlowlogAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeQANMySQLSlowlogAgentDefault) Code() int { func (o *ChangeQANMySQLSlowlogAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeQANMySQLSlowlogAgent][%d] ChangeQANMySQLSlowlogAgent default %+v", o._statusCode, o.Payload) } - func (o *ChangeQANMySQLSlowlogAgentDefault) GetPayload() *ChangeQANMySQLSlowlogAgentDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeQANMySQLSlowlogAgentBody) Validate(formats strfmt.Registry) error } func (o *ChangeQANMySQLSlowlogAgentBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeQANMySQLSlowlogAgentBody) validateCommon(formats strfmt.Registry) if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change QAN my SQL slowlog agent body based on the context it is used +func (o *ChangeQANMySQLSlowlogAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeQANMySQLSlowlogAgentBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeQANMySQLSlowlogAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeQANMySQLSlowlogAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change QAN my SQL slowlog agent default body @@ -214,7 +244,6 @@ func (o *ChangeQANMySQLSlowlogAgentDefaultBody) Validate(formats strfmt.Registry } func (o *ChangeQANMySQLSlowlogAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeQANMySQLSlowlogAgentDefaultBody) validateDetails(formats strfmt.R if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeQANMySQLSlowlogAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeQANMySQLSlowlogAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change QAN my SQL slowlog agent default body based on the context it is used +func (o *ChangeQANMySQLSlowlogAgentDefaultBody) 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 *ChangeQANMySQLSlowlogAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeQANMySQLSlowlogAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeQANMySQLSlowlogAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeQANMySQLSlowlogAgentDefaultBody) UnmarshalBinary(b []byte) error return nil } +/*ChangeQANMySQLSlowlogAgentDefaultBodyDetailsItems0 change QAN my SQL slowlog agent default body details items0 +swagger:model ChangeQANMySQLSlowlogAgentDefaultBodyDetailsItems0 +*/ +type ChangeQANMySQLSlowlogAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change QAN my SQL slowlog agent default body details items0 +func (o *ChangeQANMySQLSlowlogAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change QAN my SQL slowlog agent default body details items0 based on context it is used +func (o *ChangeQANMySQLSlowlogAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeQANMySQLSlowlogAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeQANMySQLSlowlogAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeQANMySQLSlowlogAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeQANMySQLSlowlogAgentOKBody change QAN my SQL slowlog agent OK body swagger:model ChangeQANMySQLSlowlogAgentOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeQANMySQLSlowlogAgentOKBody) Validate(formats strfmt.Registry) err } func (o *ChangeQANMySQLSlowlogAgentOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeQANMySQLSlowlogAgentOKBody) validateQANMysqlSlowlogAgent(formats if err := o.QANMysqlSlowlogAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeQanMySqlSlowlogAgentOk" + "." + "qan_mysql_slowlog_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeQanMySqlSlowlogAgentOk" + "." + "qan_mysql_slowlog_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change QAN my SQL slowlog agent OK body based on the context it is used +func (o *ChangeQANMySQLSlowlogAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateQANMysqlSlowlogAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeQANMySQLSlowlogAgentOKBody) contextValidateQANMysqlSlowlogAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMysqlSlowlogAgent != nil { + if err := o.QANMysqlSlowlogAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeQanMySqlSlowlogAgentOk" + "." + "qan_mysql_slowlog_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeQanMySqlSlowlogAgentOk" + "." + "qan_mysql_slowlog_agent") } return err } @@ -430,7 +567,6 @@ func (o *ChangeQANMySQLSlowlogAgentOKBodyQANMysqlSlowlogAgent) validateStatusEnu } func (o *ChangeQANMySQLSlowlogAgentOKBodyQANMysqlSlowlogAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -443,6 +579,11 @@ func (o *ChangeQANMySQLSlowlogAgentOKBodyQANMysqlSlowlogAgent) validateStatus(fo return nil } +// ContextValidate validates this change QAN my SQL slowlog agent OK body QAN mysql slowlog agent based on context it is used +func (o *ChangeQANMySQLSlowlogAgentOKBodyQANMysqlSlowlogAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeQANMySQLSlowlogAgentOKBodyQANMysqlSlowlogAgent) MarshalBinary() ([]byte, error) { if o == nil { @@ -491,6 +632,11 @@ func (o *ChangeQANMySQLSlowlogAgentParamsBodyCommon) Validate(formats strfmt.Reg return nil } +// ContextValidate validates this change QAN my SQL slowlog agent params body common based on context it is used +func (o *ChangeQANMySQLSlowlogAgentParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeQANMySQLSlowlogAgentParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_stat_monitor_agent_parameters.go b/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_stat_monitor_agent_parameters.go index 5b263c9073..6e2e43b9f6 100644 --- a/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_stat_monitor_agent_parameters.go +++ b/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_stat_monitor_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeQANPostgreSQLPgStatMonitorAgentParams creates a new ChangeQANPostgreSQLPgStatMonitorAgentParams object -// with the default values initialized. +// NewChangeQANPostgreSQLPgStatMonitorAgentParams creates a new ChangeQANPostgreSQLPgStatMonitorAgentParams 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 NewChangeQANPostgreSQLPgStatMonitorAgentParams() *ChangeQANPostgreSQLPgStatMonitorAgentParams { - var () return &ChangeQANPostgreSQLPgStatMonitorAgentParams{ - timeout: cr.DefaultTimeout, } } // NewChangeQANPostgreSQLPgStatMonitorAgentParamsWithTimeout creates a new ChangeQANPostgreSQLPgStatMonitorAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeQANPostgreSQLPgStatMonitorAgentParamsWithTimeout(timeout time.Duration) *ChangeQANPostgreSQLPgStatMonitorAgentParams { - var () return &ChangeQANPostgreSQLPgStatMonitorAgentParams{ - timeout: timeout, } } // NewChangeQANPostgreSQLPgStatMonitorAgentParamsWithContext creates a new ChangeQANPostgreSQLPgStatMonitorAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeQANPostgreSQLPgStatMonitorAgentParamsWithContext(ctx context.Context) *ChangeQANPostgreSQLPgStatMonitorAgentParams { - var () return &ChangeQANPostgreSQLPgStatMonitorAgentParams{ - Context: ctx, } } // NewChangeQANPostgreSQLPgStatMonitorAgentParamsWithHTTPClient creates a new ChangeQANPostgreSQLPgStatMonitorAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeQANPostgreSQLPgStatMonitorAgentParamsWithHTTPClient(client *http.Client) *ChangeQANPostgreSQLPgStatMonitorAgentParams { - var () return &ChangeQANPostgreSQLPgStatMonitorAgentParams{ HTTPClient: client, } } -/*ChangeQANPostgreSQLPgStatMonitorAgentParams contains all the parameters to send to the API endpoint -for the change QAN postgre SQL pg stat monitor agent operation typically these are written to a http.Request +/* ChangeQANPostgreSQLPgStatMonitorAgentParams contains all the parameters to send to the API endpoint + for the change QAN postgre SQL pg stat monitor agent operation. + + Typically these are written to a http.Request. */ type ChangeQANPostgreSQLPgStatMonitorAgentParams struct { - /*Body*/ + // Body. Body ChangeQANPostgreSQLPgStatMonitorAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeQANPostgreSQLPgStatMonitorAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change QAN postgre SQL pg stat monitor agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeQANPostgreSQLPgStatMonitorAgentParams) WithDefaults() *ChangeQANPostgreSQLPgStatMonitorAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change QAN postgre SQL pg stat monitor agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeQANPostgreSQLPgStatMonitorAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change QAN postgre SQL pg stat monitor agent params func (o *ChangeQANPostgreSQLPgStatMonitorAgentParams) WithTimeout(timeout time.Duration) *ChangeQANPostgreSQLPgStatMonitorAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentParams) WriteToRequest(r runtime.C return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_stat_monitor_agent_responses.go b/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_stat_monitor_agent_responses.go index cd737dba82..e892cd56da 100644 --- a/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_stat_monitor_agent_responses.go +++ b/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_stat_monitor_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeQANPostgreSQLPgStatMonitorAgentOK() *ChangeQANPostgreSQLPgStatMoni return &ChangeQANPostgreSQLPgStatMonitorAgentOK{} } -/*ChangeQANPostgreSQLPgStatMonitorAgentOK handles this case with default header values. +/* ChangeQANPostgreSQLPgStatMonitorAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeQANPostgreSQLPgStatMonitorAgentOK struct { func (o *ChangeQANPostgreSQLPgStatMonitorAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeQANPostgreSQLPgStatMonitorAgent][%d] changeQanPostgreSqlPgStatMonitorAgentOk %+v", 200, o.Payload) } - func (o *ChangeQANPostgreSQLPgStatMonitorAgentOK) GetPayload() *ChangeQANPostgreSQLPgStatMonitorAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeQANPostgreSQLPgStatMonitorAgentDefault(code int) *ChangeQANPostgre } } -/*ChangeQANPostgreSQLPgStatMonitorAgentDefault handles this case with default header values. +/* ChangeQANPostgreSQLPgStatMonitorAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefault) Code() int { func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeQANPostgreSQLPgStatMonitorAgent][%d] ChangeQANPostgreSQLPgStatMonitorAgent default %+v", o._statusCode, o.Payload) } - func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefault) GetPayload() *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentBody) Validate(formats strfmt.Regi } func (o *ChangeQANPostgreSQLPgStatMonitorAgentBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentBody) validateCommon(formats strfm if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change QAN postgre SQL pg stat monitor agent body based on the context it is used +func (o *ChangeQANPostgreSQLPgStatMonitorAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeQANPostgreSQLPgStatMonitorAgentBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeQANPostgreSQLPgStatMonitorAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change QAN postgre SQL pg stat monitor agent default body @@ -214,7 +244,6 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBody) Validate(formats strf } func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBody) validateDetails(forma if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeQANPostgreSQLPgStatMonitorAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeQANPostgreSQLPgStatMonitorAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change QAN postgre SQL pg stat monitor agent default body based on the context it is used +func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBody) 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 *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeQANPostgreSQLPgStatMonitorAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeQANPostgreSQLPgStatMonitorAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBody) UnmarshalBinary(b []b return nil } +/*ChangeQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0 change QAN postgre SQL pg stat monitor agent default body details items0 +swagger:model ChangeQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0 +*/ +type ChangeQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change QAN postgre SQL pg stat monitor agent default body details items0 +func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change QAN postgre SQL pg stat monitor agent default body details items0 based on context it is used +func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeQANPostgreSQLPgStatMonitorAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeQANPostgreSQLPgStatMonitorAgentOKBody change QAN postgre SQL pg stat monitor agent OK body swagger:model ChangeQANPostgreSQLPgStatMonitorAgentOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentOKBody) Validate(formats strfmt.Re } func (o *ChangeQANPostgreSQLPgStatMonitorAgentOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentOKBody) validateQANPostgresqlPgsta if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeQanPostgreSqlPgStatMonitorAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeQanPostgreSqlPgStatMonitorAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change QAN postgre SQL pg stat monitor agent OK body based on the context it is used +func (o *ChangeQANPostgreSQLPgStatMonitorAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateQANPostgresqlPgstatmonitorAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeQANPostgreSQLPgStatMonitorAgentOKBody) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANPostgresqlPgstatmonitorAgent != nil { + if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeQanPostgreSqlPgStatMonitorAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeQanPostgreSqlPgStatMonitorAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") } return err } @@ -418,7 +555,6 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentOKBodyQANPostgresqlPgstatmonitorAg } func (o *ChangeQANPostgreSQLPgStatMonitorAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -431,6 +567,11 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentOKBodyQANPostgresqlPgstatmonitorAg return nil } +// ContextValidate validates this change QAN postgre SQL pg stat monitor agent OK body QAN postgresql pgstatmonitor agent based on context it is used +func (o *ChangeQANPostgreSQLPgStatMonitorAgentOKBodyQANPostgresqlPgstatmonitorAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeQANPostgreSQLPgStatMonitorAgentOKBodyQANPostgresqlPgstatmonitorAgent) MarshalBinary() ([]byte, error) { if o == nil { @@ -479,6 +620,11 @@ func (o *ChangeQANPostgreSQLPgStatMonitorAgentParamsBodyCommon) Validate(formats return nil } +// ContextValidate validates this change QAN postgre SQL pg stat monitor agent params body common based on context it is used +func (o *ChangeQANPostgreSQLPgStatMonitorAgentParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeQANPostgreSQLPgStatMonitorAgentParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_statements_agent_parameters.go b/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_statements_agent_parameters.go index b3d9ecd14d..cd1c57b4a9 100644 --- a/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_statements_agent_parameters.go +++ b/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_statements_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeQANPostgreSQLPgStatementsAgentParams creates a new ChangeQANPostgreSQLPgStatementsAgentParams object -// with the default values initialized. +// NewChangeQANPostgreSQLPgStatementsAgentParams creates a new ChangeQANPostgreSQLPgStatementsAgentParams 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 NewChangeQANPostgreSQLPgStatementsAgentParams() *ChangeQANPostgreSQLPgStatementsAgentParams { - var () return &ChangeQANPostgreSQLPgStatementsAgentParams{ - timeout: cr.DefaultTimeout, } } // NewChangeQANPostgreSQLPgStatementsAgentParamsWithTimeout creates a new ChangeQANPostgreSQLPgStatementsAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeQANPostgreSQLPgStatementsAgentParamsWithTimeout(timeout time.Duration) *ChangeQANPostgreSQLPgStatementsAgentParams { - var () return &ChangeQANPostgreSQLPgStatementsAgentParams{ - timeout: timeout, } } // NewChangeQANPostgreSQLPgStatementsAgentParamsWithContext creates a new ChangeQANPostgreSQLPgStatementsAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeQANPostgreSQLPgStatementsAgentParamsWithContext(ctx context.Context) *ChangeQANPostgreSQLPgStatementsAgentParams { - var () return &ChangeQANPostgreSQLPgStatementsAgentParams{ - Context: ctx, } } // NewChangeQANPostgreSQLPgStatementsAgentParamsWithHTTPClient creates a new ChangeQANPostgreSQLPgStatementsAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeQANPostgreSQLPgStatementsAgentParamsWithHTTPClient(client *http.Client) *ChangeQANPostgreSQLPgStatementsAgentParams { - var () return &ChangeQANPostgreSQLPgStatementsAgentParams{ HTTPClient: client, } } -/*ChangeQANPostgreSQLPgStatementsAgentParams contains all the parameters to send to the API endpoint -for the change QAN postgre SQL pg statements agent operation typically these are written to a http.Request +/* ChangeQANPostgreSQLPgStatementsAgentParams contains all the parameters to send to the API endpoint + for the change QAN postgre SQL pg statements agent operation. + + Typically these are written to a http.Request. */ type ChangeQANPostgreSQLPgStatementsAgentParams struct { - /*Body*/ + // Body. Body ChangeQANPostgreSQLPgStatementsAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeQANPostgreSQLPgStatementsAgentParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change QAN postgre SQL pg statements agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeQANPostgreSQLPgStatementsAgentParams) WithDefaults() *ChangeQANPostgreSQLPgStatementsAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change QAN postgre SQL pg statements agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeQANPostgreSQLPgStatementsAgentParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change QAN postgre SQL pg statements agent params func (o *ChangeQANPostgreSQLPgStatementsAgentParams) WithTimeout(timeout time.Duration) *ChangeQANPostgreSQLPgStatementsAgentParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentParams) WriteToRequest(r runtime.Cl return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_statements_agent_responses.go b/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_statements_agent_responses.go index 9ad03cc9ff..1e8bba6681 100644 --- a/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_statements_agent_responses.go +++ b/api/inventorypb/json/client/agents/change_qan_postgre_sql_pg_statements_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeQANPostgreSQLPgStatementsAgentOK() *ChangeQANPostgreSQLPgStatement return &ChangeQANPostgreSQLPgStatementsAgentOK{} } -/*ChangeQANPostgreSQLPgStatementsAgentOK handles this case with default header values. +/* ChangeQANPostgreSQLPgStatementsAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeQANPostgreSQLPgStatementsAgentOK struct { func (o *ChangeQANPostgreSQLPgStatementsAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeQANPostgreSQLPgStatementsAgent][%d] changeQanPostgreSqlPgStatementsAgentOk %+v", 200, o.Payload) } - func (o *ChangeQANPostgreSQLPgStatementsAgentOK) GetPayload() *ChangeQANPostgreSQLPgStatementsAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeQANPostgreSQLPgStatementsAgentDefault(code int) *ChangeQANPostgreS } } -/*ChangeQANPostgreSQLPgStatementsAgentDefault handles this case with default header values. +/* ChangeQANPostgreSQLPgStatementsAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentDefault) Code() int { func (o *ChangeQANPostgreSQLPgStatementsAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeQANPostgreSQLPgStatementsAgent][%d] ChangeQANPostgreSQLPgStatementsAgent default %+v", o._statusCode, o.Payload) } - func (o *ChangeQANPostgreSQLPgStatementsAgentDefault) GetPayload() *ChangeQANPostgreSQLPgStatementsAgentDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentBody) Validate(formats strfmt.Regis } func (o *ChangeQANPostgreSQLPgStatementsAgentBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentBody) validateCommon(formats strfmt if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change QAN postgre SQL pg statements agent body based on the context it is used +func (o *ChangeQANPostgreSQLPgStatementsAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeQANPostgreSQLPgStatementsAgentBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeQANPostgreSQLPgStatementsAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change QAN postgre SQL pg statements agent default body @@ -214,7 +244,6 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentDefaultBody) Validate(formats strfm } func (o *ChangeQANPostgreSQLPgStatementsAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentDefaultBody) validateDetails(format if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeQANPostgreSQLPgStatementsAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeQANPostgreSQLPgStatementsAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change QAN postgre SQL pg statements agent default body based on the context it is used +func (o *ChangeQANPostgreSQLPgStatementsAgentDefaultBody) 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 *ChangeQANPostgreSQLPgStatementsAgentDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeQANPostgreSQLPgStatementsAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeQANPostgreSQLPgStatementsAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentDefaultBody) UnmarshalBinary(b []by return nil } +/*ChangeQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0 change QAN postgre SQL pg statements agent default body details items0 +swagger:model ChangeQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0 +*/ +type ChangeQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change QAN postgre SQL pg statements agent default body details items0 +func (o *ChangeQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change QAN postgre SQL pg statements agent default body details items0 based on context it is used +func (o *ChangeQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeQANPostgreSQLPgStatementsAgentDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeQANPostgreSQLPgStatementsAgentOKBody change QAN postgre SQL pg statements agent OK body swagger:model ChangeQANPostgreSQLPgStatementsAgentOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentOKBody) Validate(formats strfmt.Reg } func (o *ChangeQANPostgreSQLPgStatementsAgentOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentOKBody) validateQANPostgresqlPgstat if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeQanPostgreSqlPgStatementsAgentOk" + "." + "qan_postgresql_pgstatements_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeQanPostgreSqlPgStatementsAgentOk" + "." + "qan_postgresql_pgstatements_agent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change QAN postgre SQL pg statements agent OK body based on the context it is used +func (o *ChangeQANPostgreSQLPgStatementsAgentOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateQANPostgresqlPgstatementsAgent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeQANPostgreSQLPgStatementsAgentOKBody) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANPostgresqlPgstatementsAgent != nil { + if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeQanPostgreSqlPgStatementsAgentOk" + "." + "qan_postgresql_pgstatements_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeQanPostgreSqlPgStatementsAgentOk" + "." + "qan_postgresql_pgstatements_agent") } return err } @@ -415,7 +552,6 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentOKBodyQANPostgresqlPgstatementsAgen } func (o *ChangeQANPostgreSQLPgStatementsAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -428,6 +564,11 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentOKBodyQANPostgresqlPgstatementsAgen return nil } +// ContextValidate validates this change QAN postgre SQL pg statements agent OK body QAN postgresql pgstatements agent based on context it is used +func (o *ChangeQANPostgreSQLPgStatementsAgentOKBodyQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeQANPostgreSQLPgStatementsAgentOKBodyQANPostgresqlPgstatementsAgent) MarshalBinary() ([]byte, error) { if o == nil { @@ -476,6 +617,11 @@ func (o *ChangeQANPostgreSQLPgStatementsAgentParamsBodyCommon) Validate(formats return nil } +// ContextValidate validates this change QAN postgre SQL pg statements agent params body common based on context it is used +func (o *ChangeQANPostgreSQLPgStatementsAgentParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeQANPostgreSQLPgStatementsAgentParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/change_rds_exporter_parameters.go b/api/inventorypb/json/client/agents/change_rds_exporter_parameters.go index 9c9d5e4633..253797ed0c 100644 --- a/api/inventorypb/json/client/agents/change_rds_exporter_parameters.go +++ b/api/inventorypb/json/client/agents/change_rds_exporter_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeRDSExporterParams creates a new ChangeRDSExporterParams object -// with the default values initialized. +// NewChangeRDSExporterParams creates a new ChangeRDSExporterParams 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 NewChangeRDSExporterParams() *ChangeRDSExporterParams { - var () return &ChangeRDSExporterParams{ - timeout: cr.DefaultTimeout, } } // NewChangeRDSExporterParamsWithTimeout creates a new ChangeRDSExporterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeRDSExporterParamsWithTimeout(timeout time.Duration) *ChangeRDSExporterParams { - var () return &ChangeRDSExporterParams{ - timeout: timeout, } } // NewChangeRDSExporterParamsWithContext creates a new ChangeRDSExporterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeRDSExporterParamsWithContext(ctx context.Context) *ChangeRDSExporterParams { - var () return &ChangeRDSExporterParams{ - Context: ctx, } } // NewChangeRDSExporterParamsWithHTTPClient creates a new ChangeRDSExporterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeRDSExporterParamsWithHTTPClient(client *http.Client) *ChangeRDSExporterParams { - var () return &ChangeRDSExporterParams{ HTTPClient: client, } } -/*ChangeRDSExporterParams contains all the parameters to send to the API endpoint -for the change RDS exporter operation typically these are written to a http.Request +/* ChangeRDSExporterParams contains all the parameters to send to the API endpoint + for the change RDS exporter operation. + + Typically these are written to a http.Request. */ type ChangeRDSExporterParams struct { - /*Body*/ + // Body. Body ChangeRDSExporterBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeRDSExporterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change RDS exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeRDSExporterParams) WithDefaults() *ChangeRDSExporterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change RDS exporter params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeRDSExporterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change RDS exporter params func (o *ChangeRDSExporterParams) WithTimeout(timeout time.Duration) *ChangeRDSExporterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeRDSExporterParams) WriteToRequest(r runtime.ClientRequest, reg st return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/change_rds_exporter_responses.go b/api/inventorypb/json/client/agents/change_rds_exporter_responses.go index a1960eb8f3..3d411698f1 100644 --- a/api/inventorypb/json/client/agents/change_rds_exporter_responses.go +++ b/api/inventorypb/json/client/agents/change_rds_exporter_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeRDSExporterOK() *ChangeRDSExporterOK { return &ChangeRDSExporterOK{} } -/*ChangeRDSExporterOK handles this case with default header values. +/* ChangeRDSExporterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeRDSExporterOK struct { func (o *ChangeRDSExporterOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeRDSExporter][%d] changeRdsExporterOk %+v", 200, o.Payload) } - func (o *ChangeRDSExporterOK) GetPayload() *ChangeRDSExporterOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewChangeRDSExporterDefault(code int) *ChangeRDSExporterDefault { } } -/*ChangeRDSExporterDefault handles this case with default header values. +/* ChangeRDSExporterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ChangeRDSExporterDefault) Code() int { func (o *ChangeRDSExporterDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/ChangeRDSExporter][%d] ChangeRDSExporter default %+v", o._statusCode, o.Payload) } - func (o *ChangeRDSExporterDefault) GetPayload() *ChangeRDSExporterDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ChangeRDSExporterBody) Validate(formats strfmt.Registry) error { } func (o *ChangeRDSExporterBody) validateCommon(formats strfmt.Registry) error { - if swag.IsZero(o.Common) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ChangeRDSExporterBody) validateCommon(formats strfmt.Registry) error { if err := o.Common.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change RDS exporter body based on the context it is used +func (o *ChangeRDSExporterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateCommon(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeRDSExporterBody) contextValidateCommon(ctx context.Context, formats strfmt.Registry) error { + + if o.Common != nil { + if err := o.Common.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "common") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "common") } return err } @@ -196,7 +226,7 @@ type ChangeRDSExporterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeRDSExporterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change RDS exporter default body @@ -214,7 +244,6 @@ func (o *ChangeRDSExporterDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ChangeRDSExporterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ChangeRDSExporterDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeRDSExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeRDSExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change RDS exporter default body based on the context it is used +func (o *ChangeRDSExporterDefaultBody) 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 *ChangeRDSExporterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeRDSExporter default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeRDSExporter default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,6 +321,47 @@ func (o *ChangeRDSExporterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangeRDSExporterDefaultBodyDetailsItems0 change RDS exporter default body details items0 +swagger:model ChangeRDSExporterDefaultBodyDetailsItems0 +*/ +type ChangeRDSExporterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change RDS exporter default body details items0 +func (o *ChangeRDSExporterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change RDS exporter default body details items0 based on context it is used +func (o *ChangeRDSExporterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeRDSExporterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeRDSExporterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeRDSExporterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeRDSExporterOKBody change RDS exporter OK body swagger:model ChangeRDSExporterOKBody */ @@ -280,7 +386,6 @@ func (o *ChangeRDSExporterOKBody) Validate(formats strfmt.Registry) error { } func (o *ChangeRDSExporterOKBody) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required return nil } @@ -289,6 +394,38 @@ func (o *ChangeRDSExporterOKBody) validateRDSExporter(formats strfmt.Registry) e if err := o.RDSExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeRdsExporterOk" + "." + "rds_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeRdsExporterOk" + "." + "rds_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change RDS exporter OK body based on the context it is used +func (o *ChangeRDSExporterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateRDSExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeRDSExporterOKBody) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.RDSExporter != nil { + if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeRdsExporterOk" + "." + "rds_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeRdsExporterOk" + "." + "rds_exporter") } return err } @@ -338,17 +475,6 @@ type ChangeRDSExporterOKBodyRDSExporter struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics (the same for several configurations). ListenPort int64 `json:"listen_port,omitempty"` @@ -360,6 +486,17 @@ type ChangeRDSExporterOKBodyRDSExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,omitempty"` } // Validate validates this change RDS exporter OK body RDS exporter @@ -421,7 +558,6 @@ func (o *ChangeRDSExporterOKBodyRDSExporter) validateStatusEnum(path, location s } func (o *ChangeRDSExporterOKBodyRDSExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -434,6 +570,11 @@ func (o *ChangeRDSExporterOKBodyRDSExporter) validateStatus(formats strfmt.Regis return nil } +// ContextValidate validates this change RDS exporter OK body RDS exporter based on context it is used +func (o *ChangeRDSExporterOKBodyRDSExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeRDSExporterOKBodyRDSExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -482,6 +623,11 @@ func (o *ChangeRDSExporterParamsBodyCommon) Validate(formats strfmt.Registry) er return nil } +// ContextValidate validates this change RDS exporter params body common based on context it is used +func (o *ChangeRDSExporterParamsBodyCommon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeRDSExporterParamsBodyCommon) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/agents/get_agent_parameters.go b/api/inventorypb/json/client/agents/get_agent_parameters.go index 7da5e73efa..db63951e21 100644 --- a/api/inventorypb/json/client/agents/get_agent_parameters.go +++ b/api/inventorypb/json/client/agents/get_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetAgentParams creates a new GetAgentParams object -// with the default values initialized. +// 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 { - var () return &GetAgentParams{ - timeout: cr.DefaultTimeout, } } // NewGetAgentParamsWithTimeout creates a new GetAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAgentParamsWithTimeout(timeout time.Duration) *GetAgentParams { - var () return &GetAgentParams{ - timeout: timeout, } } // NewGetAgentParamsWithContext creates a new GetAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAgentParamsWithContext(ctx context.Context) *GetAgentParams { - var () return &GetAgentParams{ - Context: ctx, } } // NewGetAgentParamsWithHTTPClient creates a new GetAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAgentParamsWithHTTPClient(client *http.Client) *GetAgentParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body GetAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type GetAgentParams struct { 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) @@ -119,7 +133,6 @@ func (o *GetAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/get_agent_responses.go b/api/inventorypb/json/client/agents/get_agent_responses.go index af63aae808..f19c9aa7f1 100644 --- a/api/inventorypb/json/client/agents/get_agent_responses.go +++ b/api/inventorypb/json/client/agents/get_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewGetAgentOK() *GetAgentOK { return &GetAgentOK{} } -/*GetAgentOK handles this case with default header values. +/* GetAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type GetAgentOK struct { func (o *GetAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/Get][%d] getAgentOk %+v", 200, o.Payload) } - func (o *GetAgentOK) GetPayload() *GetAgentOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewGetAgentDefault(code int) *GetAgentDefault { } } -/*GetAgentDefault handles this case with default header values. +/* GetAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *GetAgentDefault) Code() int { func (o *GetAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/Get][%d] GetAgent default %+v", o._statusCode, o.Payload) } - func (o *GetAgentDefault) GetPayload() *GetAgentDefaultBody { return o.Payload } @@ -133,6 +132,11 @@ func (o *GetAgentBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get agent body based on context it is used +func (o *GetAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetAgentBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -166,7 +170,7 @@ type GetAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get agent default body @@ -184,7 +188,6 @@ func (o *GetAgentDefaultBody) Validate(formats strfmt.Registry) error { } func (o *GetAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -198,6 +201,42 @@ func (o *GetAgentDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -226,6 +265,47 @@ func (o *GetAgentDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetAgentDefaultBodyDetailsItems0 get agent default body details items0 +swagger:model GetAgentDefaultBodyDetailsItems0 +*/ +type GetAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -348,7 +428,6 @@ func (o *GetAgentOKBody) Validate(formats strfmt.Registry) error { } func (o *GetAgentOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseExporter) { // not required return nil } @@ -357,6 +436,8 @@ func (o *GetAgentOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) if err := o.AzureDatabaseExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "azure_database_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "azure_database_exporter") } return err } @@ -366,7 +447,6 @@ func (o *GetAgentOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) } func (o *GetAgentOKBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required return nil } @@ -375,6 +455,8 @@ func (o *GetAgentOKBody) validateExternalExporter(formats strfmt.Registry) error if err := o.ExternalExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "external_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "external_exporter") } return err } @@ -384,7 +466,6 @@ func (o *GetAgentOKBody) validateExternalExporter(formats strfmt.Registry) error } func (o *GetAgentOKBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required return nil } @@ -393,6 +474,8 @@ func (o *GetAgentOKBody) validateMongodbExporter(formats strfmt.Registry) error if err := o.MongodbExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "mongodb_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "mongodb_exporter") } return err } @@ -402,7 +485,6 @@ func (o *GetAgentOKBody) validateMongodbExporter(formats strfmt.Registry) error } func (o *GetAgentOKBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required return nil } @@ -411,6 +493,8 @@ func (o *GetAgentOKBody) validateMysqldExporter(formats strfmt.Registry) error { if err := o.MysqldExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "mysqld_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "mysqld_exporter") } return err } @@ -420,7 +504,6 @@ func (o *GetAgentOKBody) validateMysqldExporter(formats strfmt.Registry) error { } func (o *GetAgentOKBody) validateNodeExporter(formats strfmt.Registry) error { - if swag.IsZero(o.NodeExporter) { // not required return nil } @@ -429,6 +512,8 @@ func (o *GetAgentOKBody) validateNodeExporter(formats strfmt.Registry) error { if err := o.NodeExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "node_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "node_exporter") } return err } @@ -438,7 +523,6 @@ func (o *GetAgentOKBody) validateNodeExporter(formats strfmt.Registry) error { } func (o *GetAgentOKBody) validatePMMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.PMMAgent) { // not required return nil } @@ -447,6 +531,8 @@ func (o *GetAgentOKBody) validatePMMAgent(formats strfmt.Registry) error { if err := o.PMMAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "pmm_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "pmm_agent") } return err } @@ -456,7 +542,6 @@ func (o *GetAgentOKBody) validatePMMAgent(formats strfmt.Registry) error { } func (o *GetAgentOKBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required return nil } @@ -465,6 +550,8 @@ func (o *GetAgentOKBody) validatePostgresExporter(formats strfmt.Registry) error if err := o.PostgresExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "postgres_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "postgres_exporter") } return err } @@ -474,7 +561,6 @@ func (o *GetAgentOKBody) validatePostgresExporter(formats strfmt.Registry) error } func (o *GetAgentOKBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required return nil } @@ -483,6 +569,8 @@ func (o *GetAgentOKBody) validateProxysqlExporter(formats strfmt.Registry) error if err := o.ProxysqlExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "proxysql_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "proxysql_exporter") } return err } @@ -492,7 +580,6 @@ func (o *GetAgentOKBody) validateProxysqlExporter(formats strfmt.Registry) error } func (o *GetAgentOKBody) validateQANMongodbProfilerAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required return nil } @@ -501,6 +588,8 @@ func (o *GetAgentOKBody) validateQANMongodbProfilerAgent(formats strfmt.Registry if err := o.QANMongodbProfilerAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "qan_mongodb_profiler_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "qan_mongodb_profiler_agent") } return err } @@ -510,7 +599,6 @@ func (o *GetAgentOKBody) validateQANMongodbProfilerAgent(formats strfmt.Registry } func (o *GetAgentOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required return nil } @@ -519,6 +607,8 @@ func (o *GetAgentOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry if err := o.QANMysqlPerfschemaAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "qan_mysql_perfschema_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "qan_mysql_perfschema_agent") } return err } @@ -528,7 +618,6 @@ func (o *GetAgentOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry } func (o *GetAgentOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required return nil } @@ -537,6 +626,8 @@ func (o *GetAgentOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) e if err := o.QANMysqlSlowlogAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "qan_mysql_slowlog_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "qan_mysql_slowlog_agent") } return err } @@ -546,7 +637,6 @@ func (o *GetAgentOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) e } func (o *GetAgentOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required return nil } @@ -555,6 +645,8 @@ func (o *GetAgentOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.R if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatements_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatements_agent") } return err } @@ -564,7 +656,6 @@ func (o *GetAgentOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.R } func (o *GetAgentOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required return nil } @@ -573,6 +664,8 @@ func (o *GetAgentOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt. if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") } return err } @@ -582,7 +675,6 @@ func (o *GetAgentOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt. } func (o *GetAgentOKBody) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required return nil } @@ -591,6 +683,8 @@ func (o *GetAgentOKBody) validateRDSExporter(formats strfmt.Registry) error { if err := o.RDSExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "rds_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "rds_exporter") } return err } @@ -600,7 +694,6 @@ func (o *GetAgentOKBody) validateRDSExporter(formats strfmt.Registry) error { } func (o *GetAgentOKBody) validateVmagent(formats strfmt.Registry) error { - if swag.IsZero(o.Vmagent) { // not required return nil } @@ -609,6 +702,318 @@ func (o *GetAgentOKBody) validateVmagent(formats strfmt.Registry) error { if err := o.Vmagent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAgentOk" + "." + "vmagent") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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.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.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.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 err := o.AzureDatabaseExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "azure_database_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "external_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "mongodb_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "mysqld_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.NodeExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "node_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "node_exporter") + } + return err + } + } + + return nil +} + +func (o *GetAgentOKBody) contextValidatePMMAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.PMMAgent != nil { + if err := o.PMMAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "pmm_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "postgres_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "proxysql_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "proxysql_exporter") + } + return err + } + } + + return nil +} + +func (o *GetAgentOKBody) contextValidateQANMongodbProfilerAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMongodbProfilerAgent != nil { + if err := o.QANMongodbProfilerAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "qan_mongodb_profiler_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.QANMysqlPerfschemaAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "qan_mysql_perfschema_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.QANMysqlSlowlogAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "qan_mysql_slowlog_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatements_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "rds_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "rds_exporter") + } + return err + } + } + + return nil +} + +func (o *GetAgentOKBody) contextValidateVmagent(ctx context.Context, formats strfmt.Registry) error { + + if o.Vmagent != nil { + if err := o.Vmagent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getAgentOk" + "." + "vmagent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getAgentOk" + "." + "vmagent") } return err } @@ -661,6 +1066,12 @@ type GetAgentOKBodyAzureDatabaseExporter struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,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"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -671,12 +1082,6 @@ type GetAgentOKBodyAzureDatabaseExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` } // Validate validates this get agent OK body azure database exporter @@ -738,7 +1143,6 @@ func (o *GetAgentOKBodyAzureDatabaseExporter) validateStatusEnum(path, location } func (o *GetAgentOKBodyAzureDatabaseExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -751,6 +1155,11 @@ func (o *GetAgentOKBodyAzureDatabaseExporter) validateStatus(formats strfmt.Regi return nil } +// ContextValidate validates this get agent OK body azure database exporter based on context it is used +func (o *GetAgentOKBodyAzureDatabaseExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetAgentOKBodyAzureDatabaseExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -810,6 +1219,11 @@ func (o *GetAgentOKBodyExternalExporter) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this get agent OK body external exporter based on context it is used +func (o *GetAgentOKBodyExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetAgentOKBodyExternalExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -863,17 +1277,6 @@ type GetAgentOKBodyMongodbExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -886,6 +1289,17 @@ type GetAgentOKBodyMongodbExporter struct { // Enable All collectors. EnableAllCollectors bool `json:"enable_all_collectors,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,omitempty"` } // Validate validates this get agent OK body mongodb exporter @@ -947,7 +1361,6 @@ func (o *GetAgentOKBodyMongodbExporter) validateStatusEnum(path, location string } func (o *GetAgentOKBodyMongodbExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -960,6 +1373,11 @@ func (o *GetAgentOKBodyMongodbExporter) validateStatus(formats strfmt.Registry) return nil } +// ContextValidate validates this get agent OK body mongodb exporter based on context it is used +func (o *GetAgentOKBodyMongodbExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetAgentOKBodyMongodbExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -1027,6 +1445,12 @@ type GetAgentOKBodyMysqldExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // 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"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1037,12 +1461,6 @@ type GetAgentOKBodyMysqldExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` } // Validate validates this get agent OK body mysqld exporter @@ -1104,7 +1522,6 @@ func (o *GetAgentOKBodyMysqldExporter) validateStatusEnum(path, location string, } func (o *GetAgentOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1117,6 +1534,11 @@ func (o *GetAgentOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) e return nil } +// ContextValidate validates this get agent OK body mysqld exporter based on context it is used +func (o *GetAgentOKBodyMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetAgentOKBodyMysqldExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -1158,6 +1580,9 @@ type GetAgentOKBodyNodeExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1168,9 +1593,6 @@ type GetAgentOKBodyNodeExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this get agent OK body node exporter @@ -1232,7 +1654,6 @@ func (o *GetAgentOKBodyNodeExporter) validateStatusEnum(path, location string, v } func (o *GetAgentOKBodyNodeExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1245,6 +1666,11 @@ func (o *GetAgentOKBodyNodeExporter) validateStatus(formats strfmt.Registry) err return nil } +// ContextValidate validates this get agent OK body node exporter based on context it is used +func (o *GetAgentOKBodyNodeExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetAgentOKBodyNodeExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -1286,6 +1712,11 @@ 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 { @@ -1339,6 +1770,9 @@ type GetAgentOKBodyPostgresExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1349,9 +1783,6 @@ type GetAgentOKBodyPostgresExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this get agent OK body postgres exporter @@ -1413,7 +1844,6 @@ func (o *GetAgentOKBodyPostgresExporter) validateStatusEnum(path, location strin } func (o *GetAgentOKBodyPostgresExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1426,6 +1856,11 @@ func (o *GetAgentOKBodyPostgresExporter) validateStatus(formats strfmt.Registry) return nil } +// ContextValidate validates this get agent OK body postgres exporter based on context it is used +func (o *GetAgentOKBodyPostgresExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetAgentOKBodyPostgresExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -1479,6 +1914,9 @@ type GetAgentOKBodyProxysqlExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1489,9 +1927,6 @@ type GetAgentOKBodyProxysqlExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this get agent OK body proxysql exporter @@ -1553,7 +1988,6 @@ func (o *GetAgentOKBodyProxysqlExporter) validateStatusEnum(path, location strin } func (o *GetAgentOKBodyProxysqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1566,6 +2000,11 @@ func (o *GetAgentOKBodyProxysqlExporter) validateStatus(formats strfmt.Registry) return nil } +// ContextValidate validates this get agent OK body proxysql exporter based on context it is used +func (o *GetAgentOKBodyProxysqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetAgentOKBodyProxysqlExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -1684,7 +2123,6 @@ func (o *GetAgentOKBodyQANMongodbProfilerAgent) validateStatusEnum(path, locatio } func (o *GetAgentOKBodyQANMongodbProfilerAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1697,6 +2135,11 @@ func (o *GetAgentOKBodyQANMongodbProfilerAgent) validateStatus(formats strfmt.Re 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 { @@ -1827,7 +2270,6 @@ func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) validateStatusEnum(path, locatio } func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1840,6 +2282,11 @@ func (o *GetAgentOKBodyQANMysqlPerfschemaAgent) validateStatus(formats strfmt.Re 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 { @@ -1973,7 +2420,6 @@ func (o *GetAgentOKBodyQANMysqlSlowlogAgent) validateStatusEnum(path, location s } func (o *GetAgentOKBodyQANMysqlSlowlogAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1986,6 +2432,11 @@ func (o *GetAgentOKBodyQANMysqlSlowlogAgent) validateStatus(formats strfmt.Regis 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 { @@ -2104,7 +2555,6 @@ func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatusEnum(path, } func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -2117,6 +2567,11 @@ func (o *GetAgentOKBodyQANPostgresqlPgstatementsAgent) validateStatus(formats st 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 { @@ -2238,7 +2693,6 @@ func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatusEnum(path, } func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -2251,6 +2705,11 @@ func (o *GetAgentOKBodyQANPostgresqlPgstatmonitorAgent) validateStatus(formats s 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 { @@ -2292,17 +2751,6 @@ type GetAgentOKBodyRDSExporter struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics (the same for several configurations). ListenPort int64 `json:"listen_port,omitempty"` @@ -2314,6 +2762,17 @@ type GetAgentOKBodyRDSExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,omitempty"` } // Validate validates this get agent OK body RDS exporter @@ -2375,7 +2834,6 @@ func (o *GetAgentOKBodyRDSExporter) validateStatusEnum(path, location string, va } func (o *GetAgentOKBodyRDSExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -2388,6 +2846,11 @@ func (o *GetAgentOKBodyRDSExporter) validateStatus(formats strfmt.Registry) erro return nil } +// ContextValidate validates this get agent OK body RDS exporter based on context it is used +func (o *GetAgentOKBodyRDSExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetAgentOKBodyRDSExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -2490,7 +2953,6 @@ func (o *GetAgentOKBodyVmagent) validateStatusEnum(path, location string, value } func (o *GetAgentOKBodyVmagent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -2503,6 +2965,11 @@ func (o *GetAgentOKBodyVmagent) validateStatus(formats strfmt.Registry) error { 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 { diff --git a/api/inventorypb/json/client/agents/list_agents_parameters.go b/api/inventorypb/json/client/agents/list_agents_parameters.go index 617ff5cd40..610dc1afb3 100644 --- a/api/inventorypb/json/client/agents/list_agents_parameters.go +++ b/api/inventorypb/json/client/agents/list_agents_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListAgentsParams creates a new ListAgentsParams object -// with the default values initialized. +// 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 { - var () return &ListAgentsParams{ - timeout: cr.DefaultTimeout, } } // NewListAgentsParamsWithTimeout creates a new ListAgentsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListAgentsParamsWithTimeout(timeout time.Duration) *ListAgentsParams { - var () return &ListAgentsParams{ - timeout: timeout, } } // NewListAgentsParamsWithContext creates a new ListAgentsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListAgentsParamsWithContext(ctx context.Context) *ListAgentsParams { - var () return &ListAgentsParams{ - Context: ctx, } } // NewListAgentsParamsWithHTTPClient creates a new ListAgentsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListAgentsParamsWithHTTPClient(client *http.Client) *ListAgentsParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body ListAgentsBody timeout time.Duration @@ -68,6 +67,21 @@ type ListAgentsParams struct { 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) @@ -119,7 +133,6 @@ func (o *ListAgentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/list_agents_responses.go b/api/inventorypb/json/client/agents/list_agents_responses.go index 8c12aae98a..b210a92229 100644 --- a/api/inventorypb/json/client/agents/list_agents_responses.go +++ b/api/inventorypb/json/client/agents/list_agents_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListAgentsOK() *ListAgentsOK { return &ListAgentsOK{} } -/*ListAgentsOK handles this case with default header values. +/* ListAgentsOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListAgentsOK struct { func (o *ListAgentsOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/List][%d] listAgentsOk %+v", 200, o.Payload) } - func (o *ListAgentsOK) GetPayload() *ListAgentsOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListAgentsDefault(code int) *ListAgentsDefault { } } -/*ListAgentsDefault handles this case with default header values. +/* ListAgentsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListAgentsDefault) Code() int { func (o *ListAgentsDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/List][%d] ListAgents default %+v", o._statusCode, o.Payload) } - func (o *ListAgentsDefault) GetPayload() *ListAgentsDefaultBody { return o.Payload } @@ -119,199 +118,6 @@ func (o *ListAgentsDefault) readResponse(response runtime.ClientResponse, consum return nil } -/*AzureDatabaseExporterItems0 AzureDatabaseExporter runs on Generic or Container Node and exposes RemoteAzure Node metrics. -swagger:model AzureDatabaseExporterItems0 -*/ -type AzureDatabaseExporterItems0 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. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` -} - -// Validate validates this azure database exporter items0 -func (o *AzureDatabaseExporterItems0) 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 azureDatabaseExporterItems0TypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AGENT_STATUS_INVALID","STARTING","RUNNING","WAITING","STOPPING","DONE","UNKNOWN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - azureDatabaseExporterItems0TypeStatusPropEnum = append(azureDatabaseExporterItems0TypeStatusPropEnum, v) - } -} - -const ( - - // AzureDatabaseExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - AzureDatabaseExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - - // AzureDatabaseExporterItems0StatusSTARTING captures enum value "STARTING" - AzureDatabaseExporterItems0StatusSTARTING string = "STARTING" - - // AzureDatabaseExporterItems0StatusRUNNING captures enum value "RUNNING" - AzureDatabaseExporterItems0StatusRUNNING string = "RUNNING" - - // AzureDatabaseExporterItems0StatusWAITING captures enum value "WAITING" - AzureDatabaseExporterItems0StatusWAITING string = "WAITING" - - // AzureDatabaseExporterItems0StatusSTOPPING captures enum value "STOPPING" - AzureDatabaseExporterItems0StatusSTOPPING string = "STOPPING" - - // AzureDatabaseExporterItems0StatusDONE captures enum value "DONE" - AzureDatabaseExporterItems0StatusDONE string = "DONE" - - // AzureDatabaseExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" - AzureDatabaseExporterItems0StatusUNKNOWN string = "UNKNOWN" -) - -// prop value enum -func (o *AzureDatabaseExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, azureDatabaseExporterItems0TypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AzureDatabaseExporterItems0) 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 -} - -// MarshalBinary interface implementation -func (o *AzureDatabaseExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AzureDatabaseExporterItems0) UnmarshalBinary(b []byte) error { - var res AzureDatabaseExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*ExternalExporterItems0 ExternalExporter runs on any Node type, including Remote Node. -swagger:model ExternalExporterItems0 -*/ -type ExternalExporterItems0 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"` -} - -// Validate validates this external exporter items0 -func (o *ExternalExporterItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ExternalExporterItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ExternalExporterItems0) UnmarshalBinary(b []byte) error { - var res ExternalExporterItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*ListAgentsBody list agents body swagger:model ListAgentsBody */ @@ -420,7 +226,6 @@ func (o *ListAgentsBody) validateAgentTypeEnum(path, location string, value stri } func (o *ListAgentsBody) validateAgentType(formats strfmt.Registry) error { - if swag.IsZero(o.AgentType) { // not required return nil } @@ -433,6 +238,11 @@ func (o *ListAgentsBody) validateAgentType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list agents body based on context it is used +func (o *ListAgentsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ListAgentsBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -466,7 +276,7 @@ type ListAgentsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ListAgentsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this list agents default body @@ -484,7 +294,6 @@ func (o *ListAgentsDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ListAgentsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -498,6 +307,42 @@ func (o *ListAgentsDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListAgents default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -526,55 +371,96 @@ func (o *ListAgentsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ListAgentsDefaultBodyDetailsItems0 list agents default body details items0 +swagger:model ListAgentsDefaultBodyDetailsItems0 +*/ +type ListAgentsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 []*PMMAgentItems0 `json:"pmm_agent"` + PMMAgent []*ListAgentsOKBodyPMMAgentItems0 `json:"pmm_agent"` // vm agent - VMAgent []*VMAgentItems0 `json:"vm_agent"` + VMAgent []*ListAgentsOKBodyVMAgentItems0 `json:"vm_agent"` // node exporter - NodeExporter []*NodeExporterItems0 `json:"node_exporter"` + NodeExporter []*ListAgentsOKBodyNodeExporterItems0 `json:"node_exporter"` // mysqld exporter - MysqldExporter []*MysqldExporterItems0 `json:"mysqld_exporter"` + MysqldExporter []*ListAgentsOKBodyMysqldExporterItems0 `json:"mysqld_exporter"` // mongodb exporter - MongodbExporter []*MongodbExporterItems0 `json:"mongodb_exporter"` + MongodbExporter []*ListAgentsOKBodyMongodbExporterItems0 `json:"mongodb_exporter"` // postgres exporter - PostgresExporter []*PostgresExporterItems0 `json:"postgres_exporter"` + PostgresExporter []*ListAgentsOKBodyPostgresExporterItems0 `json:"postgres_exporter"` // proxysql exporter - ProxysqlExporter []*ProxysqlExporterItems0 `json:"proxysql_exporter"` + ProxysqlExporter []*ListAgentsOKBodyProxysqlExporterItems0 `json:"proxysql_exporter"` // qan mysql perfschema agent - QANMysqlPerfschemaAgent []*QANMysqlPerfschemaAgentItems0 `json:"qan_mysql_perfschema_agent"` + QANMysqlPerfschemaAgent []*ListAgentsOKBodyQANMysqlPerfschemaAgentItems0 `json:"qan_mysql_perfschema_agent"` // qan mysql slowlog agent - QANMysqlSlowlogAgent []*QANMysqlSlowlogAgentItems0 `json:"qan_mysql_slowlog_agent"` + QANMysqlSlowlogAgent []*ListAgentsOKBodyQANMysqlSlowlogAgentItems0 `json:"qan_mysql_slowlog_agent"` // qan mongodb profiler agent - QANMongodbProfilerAgent []*QANMongodbProfilerAgentItems0 `json:"qan_mongodb_profiler_agent"` + QANMongodbProfilerAgent []*ListAgentsOKBodyQANMongodbProfilerAgentItems0 `json:"qan_mongodb_profiler_agent"` // qan postgresql pgstatements agent - QANPostgresqlPgstatementsAgent []*QANPostgresqlPgstatementsAgentItems0 `json:"qan_postgresql_pgstatements_agent"` + QANPostgresqlPgstatementsAgent []*ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0 `json:"qan_postgresql_pgstatements_agent"` // qan postgresql pgstatmonitor agent - QANPostgresqlPgstatmonitorAgent []*QANPostgresqlPgstatmonitorAgentItems0 `json:"qan_postgresql_pgstatmonitor_agent"` + QANPostgresqlPgstatmonitorAgent []*ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0 `json:"qan_postgresql_pgstatmonitor_agent"` // rds exporter - RDSExporter []*RDSExporterItems0 `json:"rds_exporter"` + RDSExporter []*ListAgentsOKBodyRDSExporterItems0 `json:"rds_exporter"` // external exporter - ExternalExporter []*ExternalExporterItems0 `json:"external_exporter"` + ExternalExporter []*ListAgentsOKBodyExternalExporterItems0 `json:"external_exporter"` // azure database exporter - AzureDatabaseExporter []*AzureDatabaseExporterItems0 `json:"azure_database_exporter"` + AzureDatabaseExporter []*ListAgentsOKBodyAzureDatabaseExporterItems0 `json:"azure_database_exporter"` } // Validate validates this list agents OK body @@ -648,7 +534,6 @@ func (o *ListAgentsOKBody) Validate(formats strfmt.Registry) error { } func (o *ListAgentsOKBody) validatePMMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.PMMAgent) { // not required return nil } @@ -662,6 +547,8 @@ func (o *ListAgentsOKBody) validatePMMAgent(formats strfmt.Registry) error { if err := o.PMMAgent[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "pmm_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "pmm_agent" + "." + strconv.Itoa(i)) } return err } @@ -673,7 +560,6 @@ func (o *ListAgentsOKBody) validatePMMAgent(formats strfmt.Registry) error { } func (o *ListAgentsOKBody) validateVMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.VMAgent) { // not required return nil } @@ -687,6 +573,8 @@ func (o *ListAgentsOKBody) validateVMAgent(formats strfmt.Registry) error { if err := o.VMAgent[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "vm_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "vm_agent" + "." + strconv.Itoa(i)) } return err } @@ -698,7 +586,6 @@ func (o *ListAgentsOKBody) validateVMAgent(formats strfmt.Registry) error { } func (o *ListAgentsOKBody) validateNodeExporter(formats strfmt.Registry) error { - if swag.IsZero(o.NodeExporter) { // not required return nil } @@ -712,6 +599,8 @@ func (o *ListAgentsOKBody) validateNodeExporter(formats strfmt.Registry) error { if err := o.NodeExporter[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "node_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "node_exporter" + "." + strconv.Itoa(i)) } return err } @@ -723,7 +612,6 @@ func (o *ListAgentsOKBody) validateNodeExporter(formats strfmt.Registry) error { } func (o *ListAgentsOKBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required return nil } @@ -737,6 +625,8 @@ func (o *ListAgentsOKBody) validateMysqldExporter(formats strfmt.Registry) error if err := o.MysqldExporter[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "mysqld_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "mysqld_exporter" + "." + strconv.Itoa(i)) } return err } @@ -748,7 +638,6 @@ func (o *ListAgentsOKBody) validateMysqldExporter(formats strfmt.Registry) error } func (o *ListAgentsOKBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required return nil } @@ -762,6 +651,8 @@ func (o *ListAgentsOKBody) validateMongodbExporter(formats strfmt.Registry) erro if err := o.MongodbExporter[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "mongodb_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "mongodb_exporter" + "." + strconv.Itoa(i)) } return err } @@ -773,7 +664,6 @@ func (o *ListAgentsOKBody) validateMongodbExporter(formats strfmt.Registry) erro } func (o *ListAgentsOKBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required return nil } @@ -787,6 +677,8 @@ func (o *ListAgentsOKBody) validatePostgresExporter(formats strfmt.Registry) err if err := o.PostgresExporter[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "postgres_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "postgres_exporter" + "." + strconv.Itoa(i)) } return err } @@ -798,7 +690,6 @@ func (o *ListAgentsOKBody) validatePostgresExporter(formats strfmt.Registry) err } func (o *ListAgentsOKBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required return nil } @@ -812,6 +703,8 @@ func (o *ListAgentsOKBody) validateProxysqlExporter(formats strfmt.Registry) err if err := o.ProxysqlExporter[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "proxysql_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "proxysql_exporter" + "." + strconv.Itoa(i)) } return err } @@ -823,7 +716,6 @@ func (o *ListAgentsOKBody) validateProxysqlExporter(formats strfmt.Registry) err } func (o *ListAgentsOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschemaAgent) { // not required return nil } @@ -837,6 +729,8 @@ func (o *ListAgentsOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Regist if err := o.QANMysqlPerfschemaAgent[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "qan_mysql_perfschema_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "qan_mysql_perfschema_agent" + "." + strconv.Itoa(i)) } return err } @@ -848,7 +742,6 @@ func (o *ListAgentsOKBody) validateQANMysqlPerfschemaAgent(formats strfmt.Regist } func (o *ListAgentsOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlogAgent) { // not required return nil } @@ -862,6 +755,8 @@ func (o *ListAgentsOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) if err := o.QANMysqlSlowlogAgent[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "qan_mysql_slowlog_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "qan_mysql_slowlog_agent" + "." + strconv.Itoa(i)) } return err } @@ -873,7 +768,6 @@ func (o *ListAgentsOKBody) validateQANMysqlSlowlogAgent(formats strfmt.Registry) } func (o *ListAgentsOKBody) validateQANMongodbProfilerAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfilerAgent) { // not required return nil } @@ -887,6 +781,8 @@ func (o *ListAgentsOKBody) validateQANMongodbProfilerAgent(formats strfmt.Regist if err := o.QANMongodbProfilerAgent[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAgentsOk" + "." + "qan_mongodb_profiler_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "qan_mongodb_profiler_agent" + "." + strconv.Itoa(i)) } return err } @@ -898,7 +794,6 @@ func (o *ListAgentsOKBody) validateQANMongodbProfilerAgent(formats strfmt.Regist } func (o *ListAgentsOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required return nil } @@ -908,122 +803,700 @@ func (o *ListAgentsOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt continue } - if o.QANPostgresqlPgstatementsAgent[i] != nil { - if err := o.QANPostgresqlPgstatementsAgent[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatements_agent" + "." + strconv.Itoa(i)) - } - return err - } - } + if o.QANPostgresqlPgstatementsAgent[i] != nil { + if err := o.QANPostgresqlPgstatementsAgent[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatements_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "rds_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "rds_exporter" + "." + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "external_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "external_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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "azure_database_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "azure_database_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.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.contextValidateExternalExporter(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateAzureDatabaseExporter(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 err := o.PMMAgent[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "pmm_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.VMAgent[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "vm_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.NodeExporter[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "node_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.MysqldExporter[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "mysqld_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.MongodbExporter[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "mongodb_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.PostgresExporter[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "postgres_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.ProxysqlExporter[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "proxysql_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.QANMysqlPerfschemaAgent[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "qan_mysql_perfschema_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.QANMysqlSlowlogAgent[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "qan_mysql_slowlog_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.QANMongodbProfilerAgent[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "qan_mongodb_profiler_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "qan_mongodb_profiler_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 err := o.QANPostgresqlPgstatementsAgent[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatements_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.QANPostgresqlPgstatmonitorAgent[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + 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 err := o.RDSExporter[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "rds_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "rds_exporter" + "." + 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 err := o.ExternalExporter[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "external_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "external_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 err := o.AzureDatabaseExporter[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAgentsOk" + "." + "azure_database_exporter" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAgentsOk" + "." + "azure_database_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"` + + // 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"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var listAgentsOkBodyAzureDatabaseExporterItems0TypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AGENT_STATUS_INVALID","STARTING","RUNNING","WAITING","STOPPING","DONE","UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listAgentsOkBodyAzureDatabaseExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyAzureDatabaseExporterItems0TypeStatusPropEnum, v) + } +} + +const ( + + // ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyAzureDatabaseExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - } + // ListAgentsOKBodyAzureDatabaseExporterItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyAzureDatabaseExporterItems0StatusSTARTING string = "STARTING" - return nil -} + // ListAgentsOKBodyAzureDatabaseExporterItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyAzureDatabaseExporterItems0StatusRUNNING string = "RUNNING" -func (o *ListAgentsOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { + // ListAgentsOKBodyAzureDatabaseExporterItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyAzureDatabaseExporterItems0StatusWAITING string = "WAITING" - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required - return nil - } + // ListAgentsOKBodyAzureDatabaseExporterItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyAzureDatabaseExporterItems0StatusSTOPPING string = "STOPPING" - for i := 0; i < len(o.QANPostgresqlPgstatmonitorAgent); i++ { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent[i]) { // not required - continue - } + // ListAgentsOKBodyAzureDatabaseExporterItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyAzureDatabaseExporterItems0StatusDONE string = "DONE" - if o.QANPostgresqlPgstatmonitorAgent[i] != nil { - if err := o.QANPostgresqlPgstatmonitorAgent[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAgentsOk" + "." + "qan_postgresql_pgstatmonitor_agent" + "." + strconv.Itoa(i)) - } - return err - } - } + // ListAgentsOKBodyAzureDatabaseExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyAzureDatabaseExporterItems0StatusUNKNOWN string = "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 *ListAgentsOKBody) validateRDSExporter(formats strfmt.Registry) error { - - if swag.IsZero(o.RDSExporter) { // not required +func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } - for i := 0; i < len(o.RDSExporter); i++ { - if swag.IsZero(o.RDSExporter[i]) { // not required - continue - } + // value enum + if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { + return err + } - if o.RDSExporter[i] != nil { - if err := o.RDSExporter[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAgentsOk" + "." + "rds_exporter" + "." + strconv.Itoa(i)) - } - return err - } - } + return nil +} + +// ContextValidate validates this list agents OK body azure database exporter items0 based on context it is used +func (o *ListAgentsOKBodyAzureDatabaseExporterItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + 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 } -func (o *ListAgentsOKBody) validateExternalExporter(formats strfmt.Registry) error { +/*ListAgentsOKBodyExternalExporterItems0 ExternalExporter runs on any Node type, including Remote Node. +swagger:model ListAgentsOKBodyExternalExporterItems0 +*/ +type ListAgentsOKBodyExternalExporterItems0 struct { - if swag.IsZero(o.ExternalExporter) { // not required - return nil - } + // Unique randomly generated instance identifier. + AgentID string `json:"agent_id,omitempty"` - for i := 0; i < len(o.ExternalExporter); i++ { - if swag.IsZero(o.ExternalExporter[i]) { // not required - continue - } + // Node identifier where this instance runs. + RunsOnNodeID string `json:"runs_on_node_id,omitempty"` - if o.ExternalExporter[i] != nil { - if err := o.ExternalExporter[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAgentsOk" + "." + "external_exporter" + "." + strconv.Itoa(i)) - } - return err - } - } + // If disabled, metrics from this exporter will not be collected. + Disabled bool `json:"disabled,omitempty"` - } + // Service identifier. + ServiceID string `json:"service_id,omitempty"` - return nil -} + // HTTP basic auth username for collecting metrics. + Username string `json:"username,omitempty"` -func (o *ListAgentsOKBody) validateAzureDatabaseExporter(formats strfmt.Registry) error { + // Scheme to generate URI to exporter metrics endpoints. + Scheme string `json:"scheme,omitempty"` - if swag.IsZero(o.AzureDatabaseExporter) { // not required - return nil - } + // Path under which metrics are exposed, used to generate URI. + MetricsPath string `json:"metrics_path,omitempty"` - for i := 0; i < len(o.AzureDatabaseExporter); i++ { - if swag.IsZero(o.AzureDatabaseExporter[i]) { // not required - continue - } + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` - if o.AzureDatabaseExporter[i] != nil { - if err := o.AzureDatabaseExporter[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAgentsOk" + "." + "azure_database_exporter" + "." + strconv.Itoa(i)) - } - return err - } - } + // 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"` +} + +// Validate validates this list agents OK body external exporter items0 +func (o *ListAgentsOKBodyExternalExporterItems0) Validate(formats strfmt.Registry) error { + return nil +} +// ContextValidate validates this list agents OK body external exporter items0 based on context it is used +func (o *ListAgentsOKBodyExternalExporterItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ListAgentsOKBody) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyExternalExporterItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1031,8 +1504,8 @@ func (o *ListAgentsOKBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListAgentsOKBody) UnmarshalBinary(b []byte) error { - var res ListAgentsOKBody +func (o *ListAgentsOKBodyExternalExporterItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyExternalExporterItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1040,10 +1513,10 @@ func (o *ListAgentsOKBody) UnmarshalBinary(b []byte) error { return nil } -/*MongodbExporterItems0 MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics. -swagger:model MongodbExporterItems0 +/*ListAgentsOKBodyMongodbExporterItems0 MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics. +swagger:model ListAgentsOKBodyMongodbExporterItems0 */ -type MongodbExporterItems0 struct { +type ListAgentsOKBodyMongodbExporterItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1075,17 +1548,6 @@ type MongodbExporterItems0 struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -1098,10 +1560,21 @@ type MongodbExporterItems0 struct { // Enable All collectors. EnableAllCollectors bool `json:"enable_all_collectors,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,omitempty"` } -// Validate validates this mongodb exporter items0 -func (o *MongodbExporterItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -1114,7 +1587,7 @@ func (o *MongodbExporterItems0) Validate(formats strfmt.Registry) error { return nil } -var mongodbExporterItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyMongodbExporterItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -1122,44 +1595,43 @@ func init() { panic(err) } for _, v := range res { - mongodbExporterItems0TypeStatusPropEnum = append(mongodbExporterItems0TypeStatusPropEnum, v) + listAgentsOkBodyMongodbExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyMongodbExporterItems0TypeStatusPropEnum, v) } } const ( - // MongodbExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - MongodbExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyMongodbExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // MongodbExporterItems0StatusSTARTING captures enum value "STARTING" - MongodbExporterItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyMongodbExporterItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyMongodbExporterItems0StatusSTARTING string = "STARTING" - // MongodbExporterItems0StatusRUNNING captures enum value "RUNNING" - MongodbExporterItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyMongodbExporterItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyMongodbExporterItems0StatusRUNNING string = "RUNNING" - // MongodbExporterItems0StatusWAITING captures enum value "WAITING" - MongodbExporterItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyMongodbExporterItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyMongodbExporterItems0StatusWAITING string = "WAITING" - // MongodbExporterItems0StatusSTOPPING captures enum value "STOPPING" - MongodbExporterItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyMongodbExporterItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyMongodbExporterItems0StatusSTOPPING string = "STOPPING" - // MongodbExporterItems0StatusDONE captures enum value "DONE" - MongodbExporterItems0StatusDONE string = "DONE" + // ListAgentsOKBodyMongodbExporterItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyMongodbExporterItems0StatusDONE string = "DONE" - // MongodbExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" - MongodbExporterItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyMongodbExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyMongodbExporterItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *MongodbExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mongodbExporterItems0TypeStatusPropEnum, true); err != nil { +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 *MongodbExporterItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyMongodbExporterItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -1172,8 +1644,13 @@ func (o *MongodbExporterItems0) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list agents OK body mongodb exporter items0 based on context it is used +func (o *ListAgentsOKBodyMongodbExporterItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *MongodbExporterItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyMongodbExporterItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1181,8 +1658,8 @@ func (o *MongodbExporterItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *MongodbExporterItems0) UnmarshalBinary(b []byte) error { - var res MongodbExporterItems0 +func (o *ListAgentsOKBodyMongodbExporterItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyMongodbExporterItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1190,10 +1667,10 @@ func (o *MongodbExporterItems0) UnmarshalBinary(b []byte) error { return nil } -/*MysqldExporterItems0 MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics. -swagger:model MysqldExporterItems0 +/*ListAgentsOKBodyMysqldExporterItems0 MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics. +swagger:model ListAgentsOKBodyMysqldExporterItems0 */ -type MysqldExporterItems0 struct { +type ListAgentsOKBodyMysqldExporterItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1239,6 +1716,12 @@ type MysqldExporterItems0 struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // 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"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1249,16 +1732,10 @@ type MysqldExporterItems0 struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` } -// Validate validates this mysqld exporter items0 -func (o *MysqldExporterItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -1271,7 +1748,7 @@ func (o *MysqldExporterItems0) Validate(formats strfmt.Registry) error { return nil } -var mysqldExporterItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyMysqldExporterItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -1279,44 +1756,43 @@ func init() { panic(err) } for _, v := range res { - mysqldExporterItems0TypeStatusPropEnum = append(mysqldExporterItems0TypeStatusPropEnum, v) + listAgentsOkBodyMysqldExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyMysqldExporterItems0TypeStatusPropEnum, v) } } const ( - // MysqldExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - MysqldExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyMysqldExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // MysqldExporterItems0StatusSTARTING captures enum value "STARTING" - MysqldExporterItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyMysqldExporterItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyMysqldExporterItems0StatusSTARTING string = "STARTING" - // MysqldExporterItems0StatusRUNNING captures enum value "RUNNING" - MysqldExporterItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyMysqldExporterItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyMysqldExporterItems0StatusRUNNING string = "RUNNING" - // MysqldExporterItems0StatusWAITING captures enum value "WAITING" - MysqldExporterItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyMysqldExporterItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyMysqldExporterItems0StatusWAITING string = "WAITING" - // MysqldExporterItems0StatusSTOPPING captures enum value "STOPPING" - MysqldExporterItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyMysqldExporterItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyMysqldExporterItems0StatusSTOPPING string = "STOPPING" - // MysqldExporterItems0StatusDONE captures enum value "DONE" - MysqldExporterItems0StatusDONE string = "DONE" + // ListAgentsOKBodyMysqldExporterItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyMysqldExporterItems0StatusDONE string = "DONE" - // MysqldExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" - MysqldExporterItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyMysqldExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyMysqldExporterItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *MysqldExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mysqldExporterItems0TypeStatusPropEnum, true); err != nil { +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 *MysqldExporterItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyMysqldExporterItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -1329,8 +1805,13 @@ func (o *MysqldExporterItems0) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list agents OK body mysqld exporter items0 based on context it is used +func (o *ListAgentsOKBodyMysqldExporterItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *MysqldExporterItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyMysqldExporterItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1338,8 +1819,8 @@ func (o *MysqldExporterItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *MysqldExporterItems0) UnmarshalBinary(b []byte) error { - var res MysqldExporterItems0 +func (o *ListAgentsOKBodyMysqldExporterItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyMysqldExporterItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1347,10 +1828,10 @@ func (o *MysqldExporterItems0) UnmarshalBinary(b []byte) error { return nil } -/*NodeExporterItems0 NodeExporter runs on Generic or Container Node and exposes its metrics. -swagger:model NodeExporterItems0 +/*ListAgentsOKBodyNodeExporterItems0 NodeExporter runs on Generic or Container Node and exposes its metrics. +swagger:model ListAgentsOKBodyNodeExporterItems0 */ -type NodeExporterItems0 struct { +type ListAgentsOKBodyNodeExporterItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1370,6 +1851,9 @@ type NodeExporterItems0 struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1380,13 +1864,10 @@ type NodeExporterItems0 struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } -// Validate validates this node exporter items0 -func (o *NodeExporterItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -1399,7 +1880,7 @@ func (o *NodeExporterItems0) Validate(formats strfmt.Registry) error { return nil } -var nodeExporterItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyNodeExporterItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -1407,44 +1888,43 @@ func init() { panic(err) } for _, v := range res { - nodeExporterItems0TypeStatusPropEnum = append(nodeExporterItems0TypeStatusPropEnum, v) + listAgentsOkBodyNodeExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyNodeExporterItems0TypeStatusPropEnum, v) } } const ( - // NodeExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - NodeExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyNodeExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // NodeExporterItems0StatusSTARTING captures enum value "STARTING" - NodeExporterItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyNodeExporterItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyNodeExporterItems0StatusSTARTING string = "STARTING" - // NodeExporterItems0StatusRUNNING captures enum value "RUNNING" - NodeExporterItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyNodeExporterItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyNodeExporterItems0StatusRUNNING string = "RUNNING" - // NodeExporterItems0StatusWAITING captures enum value "WAITING" - NodeExporterItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyNodeExporterItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyNodeExporterItems0StatusWAITING string = "WAITING" - // NodeExporterItems0StatusSTOPPING captures enum value "STOPPING" - NodeExporterItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyNodeExporterItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyNodeExporterItems0StatusSTOPPING string = "STOPPING" - // NodeExporterItems0StatusDONE captures enum value "DONE" - NodeExporterItems0StatusDONE string = "DONE" + // ListAgentsOKBodyNodeExporterItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyNodeExporterItems0StatusDONE string = "DONE" - // NodeExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" - NodeExporterItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyNodeExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyNodeExporterItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *NodeExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, nodeExporterItems0TypeStatusPropEnum, true); err != nil { +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 *NodeExporterItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyNodeExporterItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -1457,8 +1937,13 @@ func (o *NodeExporterItems0) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list agents OK body node exporter items0 based on context it is used +func (o *ListAgentsOKBodyNodeExporterItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *NodeExporterItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyNodeExporterItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1466,8 +1951,8 @@ func (o *NodeExporterItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *NodeExporterItems0) UnmarshalBinary(b []byte) error { - var res NodeExporterItems0 +func (o *ListAgentsOKBodyNodeExporterItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyNodeExporterItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1475,10 +1960,10 @@ func (o *NodeExporterItems0) UnmarshalBinary(b []byte) error { return nil } -/*PMMAgentItems0 PMMAgent runs on Generic or Container Node. -swagger:model PMMAgentItems0 +/*ListAgentsOKBodyPMMAgentItems0 PMMAgent runs on Generic or Container Node. +swagger:model ListAgentsOKBodyPMMAgentItems0 */ -type PMMAgentItems0 struct { +type ListAgentsOKBodyPMMAgentItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1493,13 +1978,18 @@ type PMMAgentItems0 struct { Connected bool `json:"connected,omitempty"` } -// Validate validates this PMM agent items0 -func (o *PMMAgentItems0) Validate(formats strfmt.Registry) error { +// 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 *PMMAgentItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyPMMAgentItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1507,8 +1997,8 @@ func (o *PMMAgentItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PMMAgentItems0) UnmarshalBinary(b []byte) error { - var res PMMAgentItems0 +func (o *ListAgentsOKBodyPMMAgentItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyPMMAgentItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1516,10 +2006,10 @@ func (o *PMMAgentItems0) UnmarshalBinary(b []byte) error { return nil } -/*PostgresExporterItems0 PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics. -swagger:model PostgresExporterItems0 +/*ListAgentsOKBodyPostgresExporterItems0 PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics. +swagger:model ListAgentsOKBodyPostgresExporterItems0 */ -type PostgresExporterItems0 struct { +type ListAgentsOKBodyPostgresExporterItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1551,6 +2041,9 @@ type PostgresExporterItems0 struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1561,13 +2054,10 @@ type PostgresExporterItems0 struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } -// Validate validates this postgres exporter items0 -func (o *PostgresExporterItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -1580,7 +2070,7 @@ func (o *PostgresExporterItems0) Validate(formats strfmt.Registry) error { return nil } -var postgresExporterItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyPostgresExporterItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -1588,44 +2078,43 @@ func init() { panic(err) } for _, v := range res { - postgresExporterItems0TypeStatusPropEnum = append(postgresExporterItems0TypeStatusPropEnum, v) + listAgentsOkBodyPostgresExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyPostgresExporterItems0TypeStatusPropEnum, v) } } const ( - // PostgresExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - PostgresExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyPostgresExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // PostgresExporterItems0StatusSTARTING captures enum value "STARTING" - PostgresExporterItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyPostgresExporterItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyPostgresExporterItems0StatusSTARTING string = "STARTING" - // PostgresExporterItems0StatusRUNNING captures enum value "RUNNING" - PostgresExporterItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyPostgresExporterItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyPostgresExporterItems0StatusRUNNING string = "RUNNING" - // PostgresExporterItems0StatusWAITING captures enum value "WAITING" - PostgresExporterItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyPostgresExporterItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyPostgresExporterItems0StatusWAITING string = "WAITING" - // PostgresExporterItems0StatusSTOPPING captures enum value "STOPPING" - PostgresExporterItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyPostgresExporterItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyPostgresExporterItems0StatusSTOPPING string = "STOPPING" - // PostgresExporterItems0StatusDONE captures enum value "DONE" - PostgresExporterItems0StatusDONE string = "DONE" + // ListAgentsOKBodyPostgresExporterItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyPostgresExporterItems0StatusDONE string = "DONE" - // PostgresExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" - PostgresExporterItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyPostgresExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyPostgresExporterItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *PostgresExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, postgresExporterItems0TypeStatusPropEnum, true); err != nil { +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 *PostgresExporterItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyPostgresExporterItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -1638,8 +2127,13 @@ func (o *PostgresExporterItems0) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list agents OK body postgres exporter items0 based on context it is used +func (o *ListAgentsOKBodyPostgresExporterItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *PostgresExporterItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyPostgresExporterItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1647,8 +2141,8 @@ func (o *PostgresExporterItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PostgresExporterItems0) UnmarshalBinary(b []byte) error { - var res PostgresExporterItems0 +func (o *ListAgentsOKBodyPostgresExporterItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyPostgresExporterItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1656,10 +2150,10 @@ func (o *PostgresExporterItems0) UnmarshalBinary(b []byte) error { return nil } -/*ProxysqlExporterItems0 ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics. -swagger:model ProxysqlExporterItems0 +/*ListAgentsOKBodyProxysqlExporterItems0 ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics. +swagger:model ListAgentsOKBodyProxysqlExporterItems0 */ -type ProxysqlExporterItems0 struct { +type ListAgentsOKBodyProxysqlExporterItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1691,6 +2185,9 @@ type ProxysqlExporterItems0 struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1701,13 +2198,10 @@ type ProxysqlExporterItems0 struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } -// Validate validates this proxysql exporter items0 -func (o *ProxysqlExporterItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -1720,7 +2214,7 @@ func (o *ProxysqlExporterItems0) Validate(formats strfmt.Registry) error { return nil } -var proxysqlExporterItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyProxysqlExporterItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -1728,44 +2222,43 @@ func init() { panic(err) } for _, v := range res { - proxysqlExporterItems0TypeStatusPropEnum = append(proxysqlExporterItems0TypeStatusPropEnum, v) + listAgentsOkBodyProxysqlExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyProxysqlExporterItems0TypeStatusPropEnum, v) } } const ( - // ProxysqlExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - ProxysqlExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyProxysqlExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // ProxysqlExporterItems0StatusSTARTING captures enum value "STARTING" - ProxysqlExporterItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyProxysqlExporterItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyProxysqlExporterItems0StatusSTARTING string = "STARTING" - // ProxysqlExporterItems0StatusRUNNING captures enum value "RUNNING" - ProxysqlExporterItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyProxysqlExporterItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyProxysqlExporterItems0StatusRUNNING string = "RUNNING" - // ProxysqlExporterItems0StatusWAITING captures enum value "WAITING" - ProxysqlExporterItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyProxysqlExporterItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyProxysqlExporterItems0StatusWAITING string = "WAITING" - // ProxysqlExporterItems0StatusSTOPPING captures enum value "STOPPING" - ProxysqlExporterItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyProxysqlExporterItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyProxysqlExporterItems0StatusSTOPPING string = "STOPPING" - // ProxysqlExporterItems0StatusDONE captures enum value "DONE" - ProxysqlExporterItems0StatusDONE string = "DONE" + // ListAgentsOKBodyProxysqlExporterItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyProxysqlExporterItems0StatusDONE string = "DONE" - // ProxysqlExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" - ProxysqlExporterItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyProxysqlExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyProxysqlExporterItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *ProxysqlExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, proxysqlExporterItems0TypeStatusPropEnum, true); err != nil { +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 *ProxysqlExporterItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyProxysqlExporterItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -1778,8 +2271,13 @@ func (o *ProxysqlExporterItems0) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list agents OK body proxysql exporter items0 based on context it is used +func (o *ListAgentsOKBodyProxysqlExporterItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *ProxysqlExporterItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyProxysqlExporterItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1787,8 +2285,8 @@ func (o *ProxysqlExporterItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ProxysqlExporterItems0) UnmarshalBinary(b []byte) error { - var res ProxysqlExporterItems0 +func (o *ListAgentsOKBodyProxysqlExporterItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyProxysqlExporterItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1796,10 +2294,10 @@ func (o *ProxysqlExporterItems0) UnmarshalBinary(b []byte) error { return nil } -/*QANMongodbProfilerAgentItems0 QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. -swagger:model QANMongodbProfilerAgentItems0 +/*ListAgentsOKBodyQANMongodbProfilerAgentItems0 QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server. +swagger:model ListAgentsOKBodyQANMongodbProfilerAgentItems0 */ -type QANMongodbProfilerAgentItems0 struct { +type ListAgentsOKBodyQANMongodbProfilerAgentItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1837,8 +2335,8 @@ type QANMongodbProfilerAgentItems0 struct { Status *string `json:"status,omitempty"` } -// Validate validates this QAN mongodb profiler agent items0 -func (o *QANMongodbProfilerAgentItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -1851,7 +2349,7 @@ func (o *QANMongodbProfilerAgentItems0) Validate(formats strfmt.Registry) error return nil } -var qanMongodbProfilerAgentItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyQanMongodbProfilerAgentItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -1859,44 +2357,43 @@ func init() { panic(err) } for _, v := range res { - qanMongodbProfilerAgentItems0TypeStatusPropEnum = append(qanMongodbProfilerAgentItems0TypeStatusPropEnum, v) + listAgentsOkBodyQanMongodbProfilerAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanMongodbProfilerAgentItems0TypeStatusPropEnum, v) } } const ( - // QANMongodbProfilerAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - QANMongodbProfilerAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // QANMongodbProfilerAgentItems0StatusSTARTING captures enum value "STARTING" - QANMongodbProfilerAgentItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusSTARTING string = "STARTING" - // QANMongodbProfilerAgentItems0StatusRUNNING captures enum value "RUNNING" - QANMongodbProfilerAgentItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusRUNNING string = "RUNNING" - // QANMongodbProfilerAgentItems0StatusWAITING captures enum value "WAITING" - QANMongodbProfilerAgentItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusWAITING string = "WAITING" - // QANMongodbProfilerAgentItems0StatusSTOPPING captures enum value "STOPPING" - QANMongodbProfilerAgentItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusSTOPPING string = "STOPPING" - // QANMongodbProfilerAgentItems0StatusDONE captures enum value "DONE" - QANMongodbProfilerAgentItems0StatusDONE string = "DONE" + // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusDONE string = "DONE" - // QANMongodbProfilerAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" - QANMongodbProfilerAgentItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyQANMongodbProfilerAgentItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *QANMongodbProfilerAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, qanMongodbProfilerAgentItems0TypeStatusPropEnum, true); err != nil { +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 *QANMongodbProfilerAgentItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -1909,8 +2406,13 @@ func (o *QANMongodbProfilerAgentItems0) validateStatus(formats strfmt.Registry) 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 *QANMongodbProfilerAgentItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1918,8 +2420,8 @@ func (o *QANMongodbProfilerAgentItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *QANMongodbProfilerAgentItems0) UnmarshalBinary(b []byte) error { - var res QANMongodbProfilerAgentItems0 +func (o *ListAgentsOKBodyQANMongodbProfilerAgentItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyQANMongodbProfilerAgentItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1927,10 +2429,10 @@ func (o *QANMongodbProfilerAgentItems0) UnmarshalBinary(b []byte) error { return nil } -/*QANMysqlPerfschemaAgentItems0 QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model QANMysqlPerfschemaAgentItems0 +/*ListAgentsOKBodyQANMysqlPerfschemaAgentItems0 QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. +swagger:model ListAgentsOKBodyQANMysqlPerfschemaAgentItems0 */ -type QANMysqlPerfschemaAgentItems0 struct { +type ListAgentsOKBodyQANMysqlPerfschemaAgentItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -1980,8 +2482,8 @@ type QANMysqlPerfschemaAgentItems0 struct { Status *string `json:"status,omitempty"` } -// Validate validates this QAN mysql perfschema agent items0 -func (o *QANMysqlPerfschemaAgentItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -1994,7 +2496,7 @@ func (o *QANMysqlPerfschemaAgentItems0) Validate(formats strfmt.Registry) error return nil } -var qanMysqlPerfschemaAgentItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -2002,44 +2504,43 @@ func init() { panic(err) } for _, v := range res { - qanMysqlPerfschemaAgentItems0TypeStatusPropEnum = append(qanMysqlPerfschemaAgentItems0TypeStatusPropEnum, v) + listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanMysqlPerfschemaAgentItems0TypeStatusPropEnum, v) } } const ( - // QANMysqlPerfschemaAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - QANMysqlPerfschemaAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // QANMysqlPerfschemaAgentItems0StatusSTARTING captures enum value "STARTING" - QANMysqlPerfschemaAgentItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusSTARTING string = "STARTING" - // QANMysqlPerfschemaAgentItems0StatusRUNNING captures enum value "RUNNING" - QANMysqlPerfschemaAgentItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusRUNNING string = "RUNNING" - // QANMysqlPerfschemaAgentItems0StatusWAITING captures enum value "WAITING" - QANMysqlPerfschemaAgentItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusWAITING string = "WAITING" - // QANMysqlPerfschemaAgentItems0StatusSTOPPING captures enum value "STOPPING" - QANMysqlPerfschemaAgentItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusSTOPPING string = "STOPPING" - // QANMysqlPerfschemaAgentItems0StatusDONE captures enum value "DONE" - QANMysqlPerfschemaAgentItems0StatusDONE string = "DONE" + // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusDONE string = "DONE" - // QANMysqlPerfschemaAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" - QANMysqlPerfschemaAgentItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyQANMysqlPerfschemaAgentItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *QANMysqlPerfschemaAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, qanMysqlPerfschemaAgentItems0TypeStatusPropEnum, true); err != nil { +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 *QANMysqlPerfschemaAgentItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -2052,8 +2553,13 @@ func (o *QANMysqlPerfschemaAgentItems0) validateStatus(formats strfmt.Registry) 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 *QANMysqlPerfschemaAgentItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -2061,8 +2567,8 @@ func (o *QANMysqlPerfschemaAgentItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *QANMysqlPerfschemaAgentItems0) UnmarshalBinary(b []byte) error { - var res QANMysqlPerfschemaAgentItems0 +func (o *ListAgentsOKBodyQANMysqlPerfschemaAgentItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyQANMysqlPerfschemaAgentItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -2070,10 +2576,10 @@ func (o *QANMysqlPerfschemaAgentItems0) UnmarshalBinary(b []byte) error { return nil } -/*QANMysqlSlowlogAgentItems0 QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. -swagger:model QANMysqlSlowlogAgentItems0 +/*ListAgentsOKBodyQANMysqlSlowlogAgentItems0 QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server. +swagger:model ListAgentsOKBodyQANMysqlSlowlogAgentItems0 */ -type QANMysqlSlowlogAgentItems0 struct { +type ListAgentsOKBodyQANMysqlSlowlogAgentItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -2126,8 +2632,8 @@ type QANMysqlSlowlogAgentItems0 struct { Status *string `json:"status,omitempty"` } -// Validate validates this QAN mysql slowlog agent items0 -func (o *QANMysqlSlowlogAgentItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -2140,7 +2646,7 @@ func (o *QANMysqlSlowlogAgentItems0) Validate(formats strfmt.Registry) error { return nil } -var qanMysqlSlowlogAgentItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -2148,44 +2654,43 @@ func init() { panic(err) } for _, v := range res { - qanMysqlSlowlogAgentItems0TypeStatusPropEnum = append(qanMysqlSlowlogAgentItems0TypeStatusPropEnum, v) + listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanMysqlSlowlogAgentItems0TypeStatusPropEnum, v) } } const ( - // QANMysqlSlowlogAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - QANMysqlSlowlogAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // QANMysqlSlowlogAgentItems0StatusSTARTING captures enum value "STARTING" - QANMysqlSlowlogAgentItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusSTARTING string = "STARTING" - // QANMysqlSlowlogAgentItems0StatusRUNNING captures enum value "RUNNING" - QANMysqlSlowlogAgentItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusRUNNING string = "RUNNING" - // QANMysqlSlowlogAgentItems0StatusWAITING captures enum value "WAITING" - QANMysqlSlowlogAgentItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusWAITING string = "WAITING" - // QANMysqlSlowlogAgentItems0StatusSTOPPING captures enum value "STOPPING" - QANMysqlSlowlogAgentItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusSTOPPING string = "STOPPING" - // QANMysqlSlowlogAgentItems0StatusDONE captures enum value "DONE" - QANMysqlSlowlogAgentItems0StatusDONE string = "DONE" + // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusDONE string = "DONE" - // QANMysqlSlowlogAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" - QANMysqlSlowlogAgentItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyQANMysqlSlowlogAgentItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *QANMysqlSlowlogAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, qanMysqlSlowlogAgentItems0TypeStatusPropEnum, true); err != nil { +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 *QANMysqlSlowlogAgentItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -2198,8 +2703,13 @@ func (o *QANMysqlSlowlogAgentItems0) validateStatus(formats strfmt.Registry) 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 *QANMysqlSlowlogAgentItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -2207,8 +2717,8 @@ func (o *QANMysqlSlowlogAgentItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *QANMysqlSlowlogAgentItems0) UnmarshalBinary(b []byte) error { - var res QANMysqlSlowlogAgentItems0 +func (o *ListAgentsOKBodyQANMysqlSlowlogAgentItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyQANMysqlSlowlogAgentItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -2216,10 +2726,10 @@ func (o *QANMysqlSlowlogAgentItems0) UnmarshalBinary(b []byte) error { return nil } -/*QANPostgresqlPgstatementsAgentItems0 QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model QANPostgresqlPgstatementsAgentItems0 +/*ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0 QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. +swagger:model ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0 */ -type QANPostgresqlPgstatementsAgentItems0 struct { +type ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -2257,8 +2767,8 @@ type QANPostgresqlPgstatementsAgentItems0 struct { Status *string `json:"status,omitempty"` } -// Validate validates this QAN postgresql pgstatements agent items0 -func (o *QANPostgresqlPgstatementsAgentItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -2271,7 +2781,7 @@ func (o *QANPostgresqlPgstatementsAgentItems0) Validate(formats strfmt.Registry) return nil } -var qanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -2279,44 +2789,43 @@ func init() { panic(err) } for _, v := range res { - qanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum = append(qanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum, v) + listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum, v) } } const ( - // QANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - QANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // QANPostgresqlPgstatementsAgentItems0StatusSTARTING captures enum value "STARTING" - QANPostgresqlPgstatementsAgentItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusSTARTING string = "STARTING" - // QANPostgresqlPgstatementsAgentItems0StatusRUNNING captures enum value "RUNNING" - QANPostgresqlPgstatementsAgentItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusRUNNING string = "RUNNING" - // QANPostgresqlPgstatementsAgentItems0StatusWAITING captures enum value "WAITING" - QANPostgresqlPgstatementsAgentItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusWAITING string = "WAITING" - // QANPostgresqlPgstatementsAgentItems0StatusSTOPPING captures enum value "STOPPING" - QANPostgresqlPgstatementsAgentItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusSTOPPING string = "STOPPING" - // QANPostgresqlPgstatementsAgentItems0StatusDONE captures enum value "DONE" - QANPostgresqlPgstatementsAgentItems0StatusDONE string = "DONE" + // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusDONE string = "DONE" - // QANPostgresqlPgstatementsAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" - QANPostgresqlPgstatementsAgentItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *QANPostgresqlPgstatementsAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, qanPostgresqlPgstatementsAgentItems0TypeStatusPropEnum, true); err != nil { +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 *QANPostgresqlPgstatementsAgentItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -2329,8 +2838,13 @@ func (o *QANPostgresqlPgstatementsAgentItems0) validateStatus(formats strfmt.Reg 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 *QANPostgresqlPgstatementsAgentItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -2338,8 +2852,8 @@ func (o *QANPostgresqlPgstatementsAgentItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *QANPostgresqlPgstatementsAgentItems0) UnmarshalBinary(b []byte) error { - var res QANPostgresqlPgstatementsAgentItems0 +func (o *ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyQANPostgresqlPgstatementsAgentItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -2347,10 +2861,10 @@ func (o *QANPostgresqlPgstatementsAgentItems0) UnmarshalBinary(b []byte) error { return nil } -/*QANPostgresqlPgstatmonitorAgentItems0 QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. -swagger:model QANPostgresqlPgstatmonitorAgentItems0 +/*ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0 QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server. +swagger:model ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0 */ -type QANPostgresqlPgstatmonitorAgentItems0 struct { +type ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -2391,8 +2905,8 @@ type QANPostgresqlPgstatmonitorAgentItems0 struct { Status *string `json:"status,omitempty"` } -// Validate validates this QAN postgresql pgstatmonitor agent items0 -func (o *QANPostgresqlPgstatmonitorAgentItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -2405,7 +2919,7 @@ func (o *QANPostgresqlPgstatmonitorAgentItems0) Validate(formats strfmt.Registry return nil } -var qanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -2413,44 +2927,43 @@ func init() { panic(err) } for _, v := range res { - qanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum = append(qanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum, v) + listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyQanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum, v) } } const ( - // QANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - QANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // QANPostgresqlPgstatmonitorAgentItems0StatusSTARTING captures enum value "STARTING" - QANPostgresqlPgstatmonitorAgentItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusSTARTING string = "STARTING" - // QANPostgresqlPgstatmonitorAgentItems0StatusRUNNING captures enum value "RUNNING" - QANPostgresqlPgstatmonitorAgentItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusRUNNING string = "RUNNING" - // QANPostgresqlPgstatmonitorAgentItems0StatusWAITING captures enum value "WAITING" - QANPostgresqlPgstatmonitorAgentItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusWAITING string = "WAITING" - // QANPostgresqlPgstatmonitorAgentItems0StatusSTOPPING captures enum value "STOPPING" - QANPostgresqlPgstatmonitorAgentItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusSTOPPING string = "STOPPING" - // QANPostgresqlPgstatmonitorAgentItems0StatusDONE captures enum value "DONE" - QANPostgresqlPgstatmonitorAgentItems0StatusDONE string = "DONE" + // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusDONE string = "DONE" - // QANPostgresqlPgstatmonitorAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" - QANPostgresqlPgstatmonitorAgentItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *QANPostgresqlPgstatmonitorAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, qanPostgresqlPgstatmonitorAgentItems0TypeStatusPropEnum, true); err != nil { +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 *QANPostgresqlPgstatmonitorAgentItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -2463,8 +2976,13 @@ func (o *QANPostgresqlPgstatmonitorAgentItems0) validateStatus(formats strfmt.Re 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 *QANPostgresqlPgstatmonitorAgentItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -2472,8 +2990,8 @@ func (o *QANPostgresqlPgstatmonitorAgentItems0) MarshalBinary() ([]byte, error) } // UnmarshalBinary interface implementation -func (o *QANPostgresqlPgstatmonitorAgentItems0) UnmarshalBinary(b []byte) error { - var res QANPostgresqlPgstatmonitorAgentItems0 +func (o *ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyQANPostgresqlPgstatmonitorAgentItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -2481,10 +2999,10 @@ func (o *QANPostgresqlPgstatmonitorAgentItems0) UnmarshalBinary(b []byte) error return nil } -/*RDSExporterItems0 RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics. -swagger:model RDSExporterItems0 +/*ListAgentsOKBodyRDSExporterItems0 RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics. +swagger:model ListAgentsOKBodyRDSExporterItems0 */ -type RDSExporterItems0 struct { +type ListAgentsOKBodyRDSExporterItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -2504,17 +3022,6 @@ type RDSExporterItems0 struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics (the same for several configurations). ListenPort int64 `json:"listen_port,omitempty"` @@ -2526,10 +3033,21 @@ type RDSExporterItems0 struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,omitempty"` } -// Validate validates this RDS exporter items0 -func (o *RDSExporterItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -2542,7 +3060,7 @@ func (o *RDSExporterItems0) Validate(formats strfmt.Registry) error { return nil } -var rdsExporterItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyRdsExporterItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -2550,44 +3068,43 @@ func init() { panic(err) } for _, v := range res { - rdsExporterItems0TypeStatusPropEnum = append(rdsExporterItems0TypeStatusPropEnum, v) + listAgentsOkBodyRdsExporterItems0TypeStatusPropEnum = append(listAgentsOkBodyRdsExporterItems0TypeStatusPropEnum, v) } } const ( - // RDSExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - RDSExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyRDSExporterItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // RDSExporterItems0StatusSTARTING captures enum value "STARTING" - RDSExporterItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyRDSExporterItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyRDSExporterItems0StatusSTARTING string = "STARTING" - // RDSExporterItems0StatusRUNNING captures enum value "RUNNING" - RDSExporterItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyRDSExporterItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyRDSExporterItems0StatusRUNNING string = "RUNNING" - // RDSExporterItems0StatusWAITING captures enum value "WAITING" - RDSExporterItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyRDSExporterItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyRDSExporterItems0StatusWAITING string = "WAITING" - // RDSExporterItems0StatusSTOPPING captures enum value "STOPPING" - RDSExporterItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyRDSExporterItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyRDSExporterItems0StatusSTOPPING string = "STOPPING" - // RDSExporterItems0StatusDONE captures enum value "DONE" - RDSExporterItems0StatusDONE string = "DONE" + // ListAgentsOKBodyRDSExporterItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyRDSExporterItems0StatusDONE string = "DONE" - // RDSExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" - RDSExporterItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyRDSExporterItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyRDSExporterItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *RDSExporterItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, rdsExporterItems0TypeStatusPropEnum, true); err != nil { +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 *RDSExporterItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyRDSExporterItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -2600,8 +3117,13 @@ func (o *RDSExporterItems0) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list agents OK body RDS exporter items0 based on context it is used +func (o *ListAgentsOKBodyRDSExporterItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *RDSExporterItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyRDSExporterItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -2609,8 +3131,8 @@ func (o *RDSExporterItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RDSExporterItems0) UnmarshalBinary(b []byte) error { - var res RDSExporterItems0 +func (o *ListAgentsOKBodyRDSExporterItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyRDSExporterItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -2618,12 +3140,12 @@ func (o *RDSExporterItems0) UnmarshalBinary(b []byte) error { return nil } -/*VMAgentItems0 VMAgent runs on Generic or Container Node alongside pmm-agent. +/*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 VMAgentItems0 +swagger:model ListAgentsOKBodyVMAgentItems0 */ -type VMAgentItems0 struct { +type ListAgentsOKBodyVMAgentItems0 struct { // Unique randomly generated instance identifier. AgentID string `json:"agent_id,omitempty"` @@ -2643,8 +3165,8 @@ type VMAgentItems0 struct { Status *string `json:"status,omitempty"` } -// Validate validates this VM agent items0 -func (o *VMAgentItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -2657,7 +3179,7 @@ func (o *VMAgentItems0) Validate(formats strfmt.Registry) error { return nil } -var vmAgentItems0TypeStatusPropEnum []interface{} +var listAgentsOkBodyVmAgentItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -2665,44 +3187,43 @@ func init() { panic(err) } for _, v := range res { - vmAgentItems0TypeStatusPropEnum = append(vmAgentItems0TypeStatusPropEnum, v) + listAgentsOkBodyVmAgentItems0TypeStatusPropEnum = append(listAgentsOkBodyVmAgentItems0TypeStatusPropEnum, v) } } const ( - // VMAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" - VMAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" + // ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSINVALID captures enum value "AGENT_STATUS_INVALID" + ListAgentsOKBodyVMAgentItems0StatusAGENTSTATUSINVALID string = "AGENT_STATUS_INVALID" - // VMAgentItems0StatusSTARTING captures enum value "STARTING" - VMAgentItems0StatusSTARTING string = "STARTING" + // ListAgentsOKBodyVMAgentItems0StatusSTARTING captures enum value "STARTING" + ListAgentsOKBodyVMAgentItems0StatusSTARTING string = "STARTING" - // VMAgentItems0StatusRUNNING captures enum value "RUNNING" - VMAgentItems0StatusRUNNING string = "RUNNING" + // ListAgentsOKBodyVMAgentItems0StatusRUNNING captures enum value "RUNNING" + ListAgentsOKBodyVMAgentItems0StatusRUNNING string = "RUNNING" - // VMAgentItems0StatusWAITING captures enum value "WAITING" - VMAgentItems0StatusWAITING string = "WAITING" + // ListAgentsOKBodyVMAgentItems0StatusWAITING captures enum value "WAITING" + ListAgentsOKBodyVMAgentItems0StatusWAITING string = "WAITING" - // VMAgentItems0StatusSTOPPING captures enum value "STOPPING" - VMAgentItems0StatusSTOPPING string = "STOPPING" + // ListAgentsOKBodyVMAgentItems0StatusSTOPPING captures enum value "STOPPING" + ListAgentsOKBodyVMAgentItems0StatusSTOPPING string = "STOPPING" - // VMAgentItems0StatusDONE captures enum value "DONE" - VMAgentItems0StatusDONE string = "DONE" + // ListAgentsOKBodyVMAgentItems0StatusDONE captures enum value "DONE" + ListAgentsOKBodyVMAgentItems0StatusDONE string = "DONE" - // VMAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" - VMAgentItems0StatusUNKNOWN string = "UNKNOWN" + // ListAgentsOKBodyVMAgentItems0StatusUNKNOWN captures enum value "UNKNOWN" + ListAgentsOKBodyVMAgentItems0StatusUNKNOWN string = "UNKNOWN" ) // prop value enum -func (o *VMAgentItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, vmAgentItems0TypeStatusPropEnum, true); err != nil { +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 *VMAgentItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAgentsOKBodyVMAgentItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -2715,8 +3236,13 @@ func (o *VMAgentItems0) validateStatus(formats strfmt.Registry) error { 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 *VMAgentItems0) MarshalBinary() ([]byte, error) { +func (o *ListAgentsOKBodyVMAgentItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -2724,8 +3250,8 @@ func (o *VMAgentItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VMAgentItems0) UnmarshalBinary(b []byte) error { - var res VMAgentItems0 +func (o *ListAgentsOKBodyVMAgentItems0) UnmarshalBinary(b []byte) error { + var res ListAgentsOKBodyVMAgentItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/remove_agent_parameters.go b/api/inventorypb/json/client/agents/remove_agent_parameters.go index d31cb3bce8..bef02a1a6d 100644 --- a/api/inventorypb/json/client/agents/remove_agent_parameters.go +++ b/api/inventorypb/json/client/agents/remove_agent_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRemoveAgentParams creates a new RemoveAgentParams object -// with the default values initialized. +// 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 { - var () return &RemoveAgentParams{ - timeout: cr.DefaultTimeout, } } // NewRemoveAgentParamsWithTimeout creates a new RemoveAgentParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRemoveAgentParamsWithTimeout(timeout time.Duration) *RemoveAgentParams { - var () return &RemoveAgentParams{ - timeout: timeout, } } // NewRemoveAgentParamsWithContext creates a new RemoveAgentParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRemoveAgentParamsWithContext(ctx context.Context) *RemoveAgentParams { - var () return &RemoveAgentParams{ - Context: ctx, } } // NewRemoveAgentParamsWithHTTPClient creates a new RemoveAgentParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRemoveAgentParamsWithHTTPClient(client *http.Client) *RemoveAgentParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body RemoveAgentBody timeout time.Duration @@ -68,6 +67,21 @@ type RemoveAgentParams struct { 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) @@ -119,7 +133,6 @@ func (o *RemoveAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/agents/remove_agent_responses.go b/api/inventorypb/json/client/agents/remove_agent_responses.go index 814660d0ff..f8a5e348bf 100644 --- a/api/inventorypb/json/client/agents/remove_agent_responses.go +++ b/api/inventorypb/json/client/agents/remove_agent_responses.go @@ -6,6 +6,7 @@ package agents // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewRemoveAgentOK() *RemoveAgentOK { return &RemoveAgentOK{} } -/*RemoveAgentOK handles this case with default header values. +/* RemoveAgentOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type RemoveAgentOK struct { func (o *RemoveAgentOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/Remove][%d] removeAgentOk %+v", 200, o.Payload) } - func (o *RemoveAgentOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewRemoveAgentDefault(code int) *RemoveAgentDefault { } } -/*RemoveAgentDefault handles this case with default header values. +/* RemoveAgentDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *RemoveAgentDefault) Code() int { func (o *RemoveAgentDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Agents/Remove][%d] RemoveAgent default %+v", o._statusCode, o.Payload) } - func (o *RemoveAgentDefault) GetPayload() *RemoveAgentDefaultBody { return o.Payload } @@ -132,6 +131,11 @@ func (o *RemoveAgentBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this remove agent body based on context it is used +func (o *RemoveAgentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *RemoveAgentBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -165,7 +169,7 @@ type RemoveAgentDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RemoveAgentDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this remove agent default body @@ -183,7 +187,6 @@ func (o *RemoveAgentDefaultBody) Validate(formats strfmt.Registry) error { } func (o *RemoveAgentDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -197,6 +200,42 @@ func (o *RemoveAgentDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RemoveAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RemoveAgent default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RemoveAgent default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,3 +263,44 @@ func (o *RemoveAgentDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*RemoveAgentDefaultBodyDetailsItems0 remove agent default body details items0 +swagger:model RemoveAgentDefaultBodyDetailsItems0 +*/ +type RemoveAgentDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/inventorypb/json/client/nodes/add_container_node_parameters.go b/api/inventorypb/json/client/nodes/add_container_node_parameters.go index 151457a38d..3bd2bd80a7 100644 --- a/api/inventorypb/json/client/nodes/add_container_node_parameters.go +++ b/api/inventorypb/json/client/nodes/add_container_node_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddContainerNodeParams creates a new AddContainerNodeParams object -// with the default values initialized. +// NewAddContainerNodeParams creates a new AddContainerNodeParams 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 NewAddContainerNodeParams() *AddContainerNodeParams { - var () return &AddContainerNodeParams{ - timeout: cr.DefaultTimeout, } } // NewAddContainerNodeParamsWithTimeout creates a new AddContainerNodeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddContainerNodeParamsWithTimeout(timeout time.Duration) *AddContainerNodeParams { - var () return &AddContainerNodeParams{ - timeout: timeout, } } // NewAddContainerNodeParamsWithContext creates a new AddContainerNodeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddContainerNodeParamsWithContext(ctx context.Context) *AddContainerNodeParams { - var () return &AddContainerNodeParams{ - Context: ctx, } } // NewAddContainerNodeParamsWithHTTPClient creates a new AddContainerNodeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddContainerNodeParamsWithHTTPClient(client *http.Client) *AddContainerNodeParams { - var () return &AddContainerNodeParams{ HTTPClient: client, } } -/*AddContainerNodeParams contains all the parameters to send to the API endpoint -for the add container node operation typically these are written to a http.Request +/* AddContainerNodeParams contains all the parameters to send to the API endpoint + for the add container node operation. + + Typically these are written to a http.Request. */ type AddContainerNodeParams struct { - /*Body*/ + // Body. Body AddContainerNodeBody timeout time.Duration @@ -68,6 +67,21 @@ type AddContainerNodeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add container node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddContainerNodeParams) WithDefaults() *AddContainerNodeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add container node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddContainerNodeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add container node params func (o *AddContainerNodeParams) WithTimeout(timeout time.Duration) *AddContainerNodeParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddContainerNodeParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/nodes/add_container_node_responses.go b/api/inventorypb/json/client/nodes/add_container_node_responses.go index d6dc878a1a..b24621093a 100644 --- a/api/inventorypb/json/client/nodes/add_container_node_responses.go +++ b/api/inventorypb/json/client/nodes/add_container_node_responses.go @@ -6,6 +6,7 @@ package nodes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddContainerNodeOK() *AddContainerNodeOK { return &AddContainerNodeOK{} } -/*AddContainerNodeOK handles this case with default header values. +/* AddContainerNodeOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddContainerNodeOK struct { func (o *AddContainerNodeOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/AddContainer][%d] addContainerNodeOk %+v", 200, o.Payload) } - func (o *AddContainerNodeOK) GetPayload() *AddContainerNodeOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddContainerNodeDefault(code int) *AddContainerNodeDefault { } } -/*AddContainerNodeDefault handles this case with default header values. +/* AddContainerNodeDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddContainerNodeDefault) Code() int { func (o *AddContainerNodeDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/AddContainer][%d] AddContainerNode default %+v", o._statusCode, o.Payload) } - func (o *AddContainerNodeDefault) GetPayload() *AddContainerNodeDefaultBody { return o.Payload } @@ -155,6 +154,11 @@ func (o *AddContainerNodeBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add container node body based on context it is used +func (o *AddContainerNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddContainerNodeBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -188,7 +192,7 @@ type AddContainerNodeDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddContainerNodeDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add container node default body @@ -206,7 +210,6 @@ func (o *AddContainerNodeDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddContainerNodeDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -220,6 +223,42 @@ func (o *AddContainerNodeDefaultBody) validateDetails(formats strfmt.Registry) e if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddContainerNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddContainerNode default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add container node default body based on the context it is used +func (o *AddContainerNodeDefaultBody) 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 *AddContainerNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddContainerNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddContainerNode default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -248,6 +287,47 @@ func (o *AddContainerNodeDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddContainerNodeDefaultBodyDetailsItems0 add container node default body details items0 +swagger:model AddContainerNodeDefaultBodyDetailsItems0 +*/ +type AddContainerNodeDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add container node default body details items0 +func (o *AddContainerNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add container node default body details items0 based on context it is used +func (o *AddContainerNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddContainerNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddContainerNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddContainerNodeDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddContainerNodeOKBody add container node OK body swagger:model AddContainerNodeOKBody */ @@ -272,7 +352,6 @@ func (o *AddContainerNodeOKBody) Validate(formats strfmt.Registry) error { } func (o *AddContainerNodeOKBody) validateContainer(formats strfmt.Registry) error { - if swag.IsZero(o.Container) { // not required return nil } @@ -281,6 +360,38 @@ func (o *AddContainerNodeOKBody) validateContainer(formats strfmt.Registry) erro if err := o.Container.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addContainerNodeOk" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addContainerNodeOk" + "." + "container") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add container node OK body based on the context it is used +func (o *AddContainerNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateContainer(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddContainerNodeOKBody) contextValidateContainer(ctx context.Context, formats strfmt.Registry) error { + + if o.Container != nil { + if err := o.Container.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addContainerNodeOk" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addContainerNodeOk" + "." + "container") } return err } @@ -348,44 +459,13 @@ func (o *AddContainerNodeOKBodyContainer) Validate(formats strfmt.Registry) erro return nil } -// MarshalBinary interface implementation -func (o *AddContainerNodeOKBodyContainer) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddContainerNodeOKBodyContainer) UnmarshalBinary(b []byte) error { - var res AddContainerNodeOKBodyContainer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add container node OK body container based on context it is used +func (o *AddContainerNodeOKBodyContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddContainerNodeOKBodyContainer) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -393,8 +473,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddContainerNodeOKBodyContainer) UnmarshalBinary(b []byte) error { + var res AddContainerNodeOKBodyContainer if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/inventorypb/json/client/nodes/add_generic_node_parameters.go b/api/inventorypb/json/client/nodes/add_generic_node_parameters.go index 1cf6bf6863..933315fe0e 100644 --- a/api/inventorypb/json/client/nodes/add_generic_node_parameters.go +++ b/api/inventorypb/json/client/nodes/add_generic_node_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddGenericNodeParams creates a new AddGenericNodeParams object -// with the default values initialized. +// NewAddGenericNodeParams creates a new AddGenericNodeParams 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 NewAddGenericNodeParams() *AddGenericNodeParams { - var () return &AddGenericNodeParams{ - timeout: cr.DefaultTimeout, } } // NewAddGenericNodeParamsWithTimeout creates a new AddGenericNodeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddGenericNodeParamsWithTimeout(timeout time.Duration) *AddGenericNodeParams { - var () return &AddGenericNodeParams{ - timeout: timeout, } } // NewAddGenericNodeParamsWithContext creates a new AddGenericNodeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddGenericNodeParamsWithContext(ctx context.Context) *AddGenericNodeParams { - var () return &AddGenericNodeParams{ - Context: ctx, } } // NewAddGenericNodeParamsWithHTTPClient creates a new AddGenericNodeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddGenericNodeParamsWithHTTPClient(client *http.Client) *AddGenericNodeParams { - var () return &AddGenericNodeParams{ HTTPClient: client, } } -/*AddGenericNodeParams contains all the parameters to send to the API endpoint -for the add generic node operation typically these are written to a http.Request +/* AddGenericNodeParams contains all the parameters to send to the API endpoint + for the add generic node operation. + + Typically these are written to a http.Request. */ type AddGenericNodeParams struct { - /*Body*/ + // Body. Body AddGenericNodeBody timeout time.Duration @@ -68,6 +67,21 @@ type AddGenericNodeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add generic node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddGenericNodeParams) WithDefaults() *AddGenericNodeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add generic node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddGenericNodeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add generic node params func (o *AddGenericNodeParams) WithTimeout(timeout time.Duration) *AddGenericNodeParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddGenericNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/nodes/add_generic_node_responses.go b/api/inventorypb/json/client/nodes/add_generic_node_responses.go index e795483cd4..482bfe2da0 100644 --- a/api/inventorypb/json/client/nodes/add_generic_node_responses.go +++ b/api/inventorypb/json/client/nodes/add_generic_node_responses.go @@ -6,6 +6,7 @@ package nodes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddGenericNodeOK() *AddGenericNodeOK { return &AddGenericNodeOK{} } -/*AddGenericNodeOK handles this case with default header values. +/* AddGenericNodeOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddGenericNodeOK struct { func (o *AddGenericNodeOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/AddGeneric][%d] addGenericNodeOk %+v", 200, o.Payload) } - func (o *AddGenericNodeOK) GetPayload() *AddGenericNodeOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddGenericNodeDefault(code int) *AddGenericNodeDefault { } } -/*AddGenericNodeDefault handles this case with default header values. +/* AddGenericNodeDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddGenericNodeDefault) Code() int { func (o *AddGenericNodeDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/AddGeneric][%d] AddGenericNode default %+v", o._statusCode, o.Payload) } - func (o *AddGenericNodeDefault) GetPayload() *AddGenericNodeDefaultBody { return o.Payload } @@ -152,6 +151,11 @@ func (o *AddGenericNodeBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add generic node body based on context it is used +func (o *AddGenericNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddGenericNodeBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -185,7 +189,7 @@ type AddGenericNodeDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddGenericNodeDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add generic node default body @@ -203,7 +207,6 @@ func (o *AddGenericNodeDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddGenericNodeDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -217,6 +220,42 @@ func (o *AddGenericNodeDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddGenericNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddGenericNode default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add generic node default body based on the context it is used +func (o *AddGenericNodeDefaultBody) 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 *AddGenericNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddGenericNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddGenericNode default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -245,6 +284,47 @@ func (o *AddGenericNodeDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddGenericNodeDefaultBodyDetailsItems0 add generic node default body details items0 +swagger:model AddGenericNodeDefaultBodyDetailsItems0 +*/ +type AddGenericNodeDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add generic node default body details items0 +func (o *AddGenericNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add generic node default body details items0 based on context it is used +func (o *AddGenericNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddGenericNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddGenericNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddGenericNodeDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddGenericNodeOKBody add generic node OK body swagger:model AddGenericNodeOKBody */ @@ -269,7 +349,6 @@ func (o *AddGenericNodeOKBody) Validate(formats strfmt.Registry) error { } func (o *AddGenericNodeOKBody) validateGeneric(formats strfmt.Registry) error { - if swag.IsZero(o.Generic) { // not required return nil } @@ -278,6 +357,38 @@ func (o *AddGenericNodeOKBody) validateGeneric(formats strfmt.Registry) error { if err := o.Generic.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addGenericNodeOk" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addGenericNodeOk" + "." + "generic") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add generic node OK body based on the context it is used +func (o *AddGenericNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateGeneric(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddGenericNodeOKBody) contextValidateGeneric(ctx context.Context, formats strfmt.Registry) error { + + if o.Generic != nil { + if err := o.Generic.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addGenericNodeOk" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addGenericNodeOk" + "." + "generic") } return err } @@ -342,6 +453,11 @@ func (o *AddGenericNodeOKBodyGeneric) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add generic node OK body generic based on context it is used +func (o *AddGenericNodeOKBodyGeneric) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddGenericNodeOKBodyGeneric) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/nodes/add_remote_azure_database_node_parameters.go b/api/inventorypb/json/client/nodes/add_remote_azure_database_node_parameters.go index 4cd3901836..9f3065241d 100644 --- a/api/inventorypb/json/client/nodes/add_remote_azure_database_node_parameters.go +++ b/api/inventorypb/json/client/nodes/add_remote_azure_database_node_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddRemoteAzureDatabaseNodeParams creates a new AddRemoteAzureDatabaseNodeParams object -// with the default values initialized. +// NewAddRemoteAzureDatabaseNodeParams creates a new AddRemoteAzureDatabaseNodeParams 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 NewAddRemoteAzureDatabaseNodeParams() *AddRemoteAzureDatabaseNodeParams { - var () return &AddRemoteAzureDatabaseNodeParams{ - timeout: cr.DefaultTimeout, } } // NewAddRemoteAzureDatabaseNodeParamsWithTimeout creates a new AddRemoteAzureDatabaseNodeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddRemoteAzureDatabaseNodeParamsWithTimeout(timeout time.Duration) *AddRemoteAzureDatabaseNodeParams { - var () return &AddRemoteAzureDatabaseNodeParams{ - timeout: timeout, } } // NewAddRemoteAzureDatabaseNodeParamsWithContext creates a new AddRemoteAzureDatabaseNodeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddRemoteAzureDatabaseNodeParamsWithContext(ctx context.Context) *AddRemoteAzureDatabaseNodeParams { - var () return &AddRemoteAzureDatabaseNodeParams{ - Context: ctx, } } // NewAddRemoteAzureDatabaseNodeParamsWithHTTPClient creates a new AddRemoteAzureDatabaseNodeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddRemoteAzureDatabaseNodeParamsWithHTTPClient(client *http.Client) *AddRemoteAzureDatabaseNodeParams { - var () return &AddRemoteAzureDatabaseNodeParams{ HTTPClient: client, } } -/*AddRemoteAzureDatabaseNodeParams contains all the parameters to send to the API endpoint -for the add remote azure database node operation typically these are written to a http.Request +/* AddRemoteAzureDatabaseNodeParams contains all the parameters to send to the API endpoint + for the add remote azure database node operation. + + Typically these are written to a http.Request. */ type AddRemoteAzureDatabaseNodeParams struct { - /*Body*/ + // Body. Body AddRemoteAzureDatabaseNodeBody timeout time.Duration @@ -68,6 +67,21 @@ type AddRemoteAzureDatabaseNodeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add remote azure database node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRemoteAzureDatabaseNodeParams) WithDefaults() *AddRemoteAzureDatabaseNodeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add remote azure database node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRemoteAzureDatabaseNodeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add remote azure database node params func (o *AddRemoteAzureDatabaseNodeParams) WithTimeout(timeout time.Duration) *AddRemoteAzureDatabaseNodeParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddRemoteAzureDatabaseNodeParams) WriteToRequest(r runtime.ClientReques return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/nodes/add_remote_azure_database_node_responses.go b/api/inventorypb/json/client/nodes/add_remote_azure_database_node_responses.go index c06db776a2..94f4f341f7 100644 --- a/api/inventorypb/json/client/nodes/add_remote_azure_database_node_responses.go +++ b/api/inventorypb/json/client/nodes/add_remote_azure_database_node_responses.go @@ -6,6 +6,7 @@ package nodes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddRemoteAzureDatabaseNodeOK() *AddRemoteAzureDatabaseNodeOK { return &AddRemoteAzureDatabaseNodeOK{} } -/*AddRemoteAzureDatabaseNodeOK handles this case with default header values. +/* AddRemoteAzureDatabaseNodeOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddRemoteAzureDatabaseNodeOK struct { func (o *AddRemoteAzureDatabaseNodeOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/AddRemoteAzureDatabase][%d] addRemoteAzureDatabaseNodeOk %+v", 200, o.Payload) } - func (o *AddRemoteAzureDatabaseNodeOK) GetPayload() *AddRemoteAzureDatabaseNodeOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddRemoteAzureDatabaseNodeDefault(code int) *AddRemoteAzureDatabaseNodeD } } -/*AddRemoteAzureDatabaseNodeDefault handles this case with default header values. +/* AddRemoteAzureDatabaseNodeDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddRemoteAzureDatabaseNodeDefault) Code() int { func (o *AddRemoteAzureDatabaseNodeDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/AddRemoteAzureDatabase][%d] AddRemoteAzureDatabaseNode default %+v", o._statusCode, o.Payload) } - func (o *AddRemoteAzureDatabaseNodeDefault) GetPayload() *AddRemoteAzureDatabaseNodeDefaultBody { return o.Payload } @@ -146,6 +145,11 @@ func (o *AddRemoteAzureDatabaseNodeBody) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this add remote azure database node body based on context it is used +func (o *AddRemoteAzureDatabaseNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRemoteAzureDatabaseNodeBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -179,7 +183,7 @@ type AddRemoteAzureDatabaseNodeDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddRemoteAzureDatabaseNodeDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add remote azure database node default body @@ -197,7 +201,6 @@ func (o *AddRemoteAzureDatabaseNodeDefaultBody) Validate(formats strfmt.Registry } func (o *AddRemoteAzureDatabaseNodeDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -211,6 +214,42 @@ func (o *AddRemoteAzureDatabaseNodeDefaultBody) validateDetails(formats strfmt.R if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddRemoteAzureDatabaseNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddRemoteAzureDatabaseNode default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add remote azure database node default body based on the context it is used +func (o *AddRemoteAzureDatabaseNodeDefaultBody) 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 *AddRemoteAzureDatabaseNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddRemoteAzureDatabaseNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddRemoteAzureDatabaseNode default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -239,6 +278,47 @@ func (o *AddRemoteAzureDatabaseNodeDefaultBody) UnmarshalBinary(b []byte) error return nil } +/*AddRemoteAzureDatabaseNodeDefaultBodyDetailsItems0 add remote azure database node default body details items0 +swagger:model AddRemoteAzureDatabaseNodeDefaultBodyDetailsItems0 +*/ +type AddRemoteAzureDatabaseNodeDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add remote azure database node default body details items0 +func (o *AddRemoteAzureDatabaseNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add remote azure database node default body details items0 based on context it is used +func (o *AddRemoteAzureDatabaseNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddRemoteAzureDatabaseNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddRemoteAzureDatabaseNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddRemoteAzureDatabaseNodeDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddRemoteAzureDatabaseNodeOKBody add remote azure database node OK body swagger:model AddRemoteAzureDatabaseNodeOKBody */ @@ -263,7 +343,6 @@ func (o *AddRemoteAzureDatabaseNodeOKBody) Validate(formats strfmt.Registry) err } func (o *AddRemoteAzureDatabaseNodeOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteAzureDatabase) { // not required return nil } @@ -272,6 +351,38 @@ func (o *AddRemoteAzureDatabaseNodeOKBody) validateRemoteAzureDatabase(formats s if err := o.RemoteAzureDatabase.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRemoteAzureDatabaseNodeOk" + "." + "remote_azure_database") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRemoteAzureDatabaseNodeOk" + "." + "remote_azure_database") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add remote azure database node OK body based on the context it is used +func (o *AddRemoteAzureDatabaseNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateRemoteAzureDatabase(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddRemoteAzureDatabaseNodeOKBody) contextValidateRemoteAzureDatabase(ctx context.Context, formats strfmt.Registry) error { + + if o.RemoteAzureDatabase != nil { + if err := o.RemoteAzureDatabase.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRemoteAzureDatabaseNodeOk" + "." + "remote_azure_database") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRemoteAzureDatabaseNodeOk" + "." + "remote_azure_database") } return err } @@ -330,6 +441,11 @@ func (o *AddRemoteAzureDatabaseNodeOKBodyRemoteAzureDatabase) Validate(formats s return nil } +// ContextValidate validates this add remote azure database node OK body remote azure database based on context it is used +func (o *AddRemoteAzureDatabaseNodeOKBodyRemoteAzureDatabase) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRemoteAzureDatabaseNodeOKBodyRemoteAzureDatabase) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/nodes/add_remote_node_parameters.go b/api/inventorypb/json/client/nodes/add_remote_node_parameters.go index d1c75faebf..26895d0295 100644 --- a/api/inventorypb/json/client/nodes/add_remote_node_parameters.go +++ b/api/inventorypb/json/client/nodes/add_remote_node_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddRemoteNodeParams creates a new AddRemoteNodeParams object -// with the default values initialized. +// NewAddRemoteNodeParams creates a new AddRemoteNodeParams 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 NewAddRemoteNodeParams() *AddRemoteNodeParams { - var () return &AddRemoteNodeParams{ - timeout: cr.DefaultTimeout, } } // NewAddRemoteNodeParamsWithTimeout creates a new AddRemoteNodeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddRemoteNodeParamsWithTimeout(timeout time.Duration) *AddRemoteNodeParams { - var () return &AddRemoteNodeParams{ - timeout: timeout, } } // NewAddRemoteNodeParamsWithContext creates a new AddRemoteNodeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddRemoteNodeParamsWithContext(ctx context.Context) *AddRemoteNodeParams { - var () return &AddRemoteNodeParams{ - Context: ctx, } } // NewAddRemoteNodeParamsWithHTTPClient creates a new AddRemoteNodeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddRemoteNodeParamsWithHTTPClient(client *http.Client) *AddRemoteNodeParams { - var () return &AddRemoteNodeParams{ HTTPClient: client, } } -/*AddRemoteNodeParams contains all the parameters to send to the API endpoint -for the add remote node operation typically these are written to a http.Request +/* AddRemoteNodeParams contains all the parameters to send to the API endpoint + for the add remote node operation. + + Typically these are written to a http.Request. */ type AddRemoteNodeParams struct { - /*Body*/ + // Body. Body AddRemoteNodeBody timeout time.Duration @@ -68,6 +67,21 @@ type AddRemoteNodeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add remote node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRemoteNodeParams) WithDefaults() *AddRemoteNodeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add remote node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRemoteNodeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add remote node params func (o *AddRemoteNodeParams) WithTimeout(timeout time.Duration) *AddRemoteNodeParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddRemoteNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/nodes/add_remote_node_responses.go b/api/inventorypb/json/client/nodes/add_remote_node_responses.go index bf124595d1..9b5a346acb 100644 --- a/api/inventorypb/json/client/nodes/add_remote_node_responses.go +++ b/api/inventorypb/json/client/nodes/add_remote_node_responses.go @@ -6,6 +6,7 @@ package nodes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddRemoteNodeOK() *AddRemoteNodeOK { return &AddRemoteNodeOK{} } -/*AddRemoteNodeOK handles this case with default header values. +/* AddRemoteNodeOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddRemoteNodeOK struct { func (o *AddRemoteNodeOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/AddRemote][%d] addRemoteNodeOk %+v", 200, o.Payload) } - func (o *AddRemoteNodeOK) GetPayload() *AddRemoteNodeOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddRemoteNodeDefault(code int) *AddRemoteNodeDefault { } } -/*AddRemoteNodeDefault handles this case with default header values. +/* AddRemoteNodeDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddRemoteNodeDefault) Code() int { func (o *AddRemoteNodeDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/AddRemote][%d] AddRemoteNode default %+v", o._statusCode, o.Payload) } - func (o *AddRemoteNodeDefault) GetPayload() *AddRemoteNodeDefaultBody { return o.Payload } @@ -146,6 +145,11 @@ func (o *AddRemoteNodeBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add remote node body based on context it is used +func (o *AddRemoteNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRemoteNodeBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -179,7 +183,7 @@ type AddRemoteNodeDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddRemoteNodeDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add remote node default body @@ -197,7 +201,6 @@ func (o *AddRemoteNodeDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddRemoteNodeDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -211,6 +214,42 @@ func (o *AddRemoteNodeDefaultBody) validateDetails(formats strfmt.Registry) erro if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddRemoteNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddRemoteNode default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add remote node default body based on the context it is used +func (o *AddRemoteNodeDefaultBody) 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 *AddRemoteNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddRemoteNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddRemoteNode default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -239,6 +278,47 @@ func (o *AddRemoteNodeDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddRemoteNodeDefaultBodyDetailsItems0 add remote node default body details items0 +swagger:model AddRemoteNodeDefaultBodyDetailsItems0 +*/ +type AddRemoteNodeDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add remote node default body details items0 +func (o *AddRemoteNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add remote node default body details items0 based on context it is used +func (o *AddRemoteNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddRemoteNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddRemoteNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddRemoteNodeDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddRemoteNodeOKBody add remote node OK body swagger:model AddRemoteNodeOKBody */ @@ -263,7 +343,6 @@ func (o *AddRemoteNodeOKBody) Validate(formats strfmt.Registry) error { } func (o *AddRemoteNodeOKBody) validateRemote(formats strfmt.Registry) error { - if swag.IsZero(o.Remote) { // not required return nil } @@ -272,6 +351,38 @@ func (o *AddRemoteNodeOKBody) validateRemote(formats strfmt.Registry) error { if err := o.Remote.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRemoteNodeOk" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRemoteNodeOk" + "." + "remote") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add remote node OK body based on the context it is used +func (o *AddRemoteNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateRemote(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddRemoteNodeOKBody) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { + + if o.Remote != nil { + if err := o.Remote.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRemoteNodeOk" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRemoteNodeOk" + "." + "remote") } return err } @@ -330,6 +441,11 @@ func (o *AddRemoteNodeOKBodyRemote) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add remote node OK body remote based on context it is used +func (o *AddRemoteNodeOKBodyRemote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRemoteNodeOKBodyRemote) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/nodes/add_remote_rds_node_parameters.go b/api/inventorypb/json/client/nodes/add_remote_rds_node_parameters.go index 869138aa07..b4f4436ff9 100644 --- a/api/inventorypb/json/client/nodes/add_remote_rds_node_parameters.go +++ b/api/inventorypb/json/client/nodes/add_remote_rds_node_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddRemoteRDSNodeParams creates a new AddRemoteRDSNodeParams object -// with the default values initialized. +// NewAddRemoteRDSNodeParams creates a new AddRemoteRDSNodeParams 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 NewAddRemoteRDSNodeParams() *AddRemoteRDSNodeParams { - var () return &AddRemoteRDSNodeParams{ - timeout: cr.DefaultTimeout, } } // NewAddRemoteRDSNodeParamsWithTimeout creates a new AddRemoteRDSNodeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddRemoteRDSNodeParamsWithTimeout(timeout time.Duration) *AddRemoteRDSNodeParams { - var () return &AddRemoteRDSNodeParams{ - timeout: timeout, } } // NewAddRemoteRDSNodeParamsWithContext creates a new AddRemoteRDSNodeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddRemoteRDSNodeParamsWithContext(ctx context.Context) *AddRemoteRDSNodeParams { - var () return &AddRemoteRDSNodeParams{ - Context: ctx, } } // NewAddRemoteRDSNodeParamsWithHTTPClient creates a new AddRemoteRDSNodeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddRemoteRDSNodeParamsWithHTTPClient(client *http.Client) *AddRemoteRDSNodeParams { - var () return &AddRemoteRDSNodeParams{ HTTPClient: client, } } -/*AddRemoteRDSNodeParams contains all the parameters to send to the API endpoint -for the add remote RDS node operation typically these are written to a http.Request +/* AddRemoteRDSNodeParams contains all the parameters to send to the API endpoint + for the add remote RDS node operation. + + Typically these are written to a http.Request. */ type AddRemoteRDSNodeParams struct { - /*Body*/ + // Body. Body AddRemoteRDSNodeBody timeout time.Duration @@ -68,6 +67,21 @@ type AddRemoteRDSNodeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add remote RDS node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRemoteRDSNodeParams) WithDefaults() *AddRemoteRDSNodeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add remote RDS node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRemoteRDSNodeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add remote RDS node params func (o *AddRemoteRDSNodeParams) WithTimeout(timeout time.Duration) *AddRemoteRDSNodeParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddRemoteRDSNodeParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go b/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go index 527ccc0c22..c4ce1fde61 100644 --- a/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go +++ b/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go @@ -6,6 +6,7 @@ package nodes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddRemoteRDSNodeOK() *AddRemoteRDSNodeOK { return &AddRemoteRDSNodeOK{} } -/*AddRemoteRDSNodeOK handles this case with default header values. +/* AddRemoteRDSNodeOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddRemoteRDSNodeOK struct { func (o *AddRemoteRDSNodeOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/AddRemoteRDS][%d] addRemoteRdsNodeOk %+v", 200, o.Payload) } - func (o *AddRemoteRDSNodeOK) GetPayload() *AddRemoteRDSNodeOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddRemoteRDSNodeDefault(code int) *AddRemoteRDSNodeDefault { } } -/*AddRemoteRDSNodeDefault handles this case with default header values. +/* AddRemoteRDSNodeDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddRemoteRDSNodeDefault) Code() int { func (o *AddRemoteRDSNodeDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/AddRemoteRDS][%d] AddRemoteRDSNode default %+v", o._statusCode, o.Payload) } - func (o *AddRemoteRDSNodeDefault) GetPayload() *AddRemoteRDSNodeDefaultBody { return o.Payload } @@ -146,6 +145,11 @@ func (o *AddRemoteRDSNodeBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add remote RDS node body based on context it is used +func (o *AddRemoteRDSNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRemoteRDSNodeBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -179,7 +183,7 @@ type AddRemoteRDSNodeDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddRemoteRDSNodeDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add remote RDS node default body @@ -197,7 +201,6 @@ func (o *AddRemoteRDSNodeDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddRemoteRDSNodeDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -211,6 +214,42 @@ func (o *AddRemoteRDSNodeDefaultBody) validateDetails(formats strfmt.Registry) e if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddRemoteRDSNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddRemoteRDSNode default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add remote RDS node default body based on the context it is used +func (o *AddRemoteRDSNodeDefaultBody) 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 *AddRemoteRDSNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddRemoteRDSNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddRemoteRDSNode default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -239,6 +278,47 @@ func (o *AddRemoteRDSNodeDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddRemoteRDSNodeDefaultBodyDetailsItems0 add remote RDS node default body details items0 +swagger:model AddRemoteRDSNodeDefaultBodyDetailsItems0 +*/ +type AddRemoteRDSNodeDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add remote RDS node default body details items0 +func (o *AddRemoteRDSNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add remote RDS node default body details items0 based on context it is used +func (o *AddRemoteRDSNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddRemoteRDSNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddRemoteRDSNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddRemoteRDSNodeDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddRemoteRDSNodeOKBody add remote RDS node OK body swagger:model AddRemoteRDSNodeOKBody */ @@ -263,7 +343,6 @@ func (o *AddRemoteRDSNodeOKBody) Validate(formats strfmt.Registry) error { } func (o *AddRemoteRDSNodeOKBody) validateRemoteRDS(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteRDS) { // not required return nil } @@ -272,6 +351,38 @@ func (o *AddRemoteRDSNodeOKBody) validateRemoteRDS(formats strfmt.Registry) erro if err := o.RemoteRDS.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRemoteRdsNodeOk" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRemoteRdsNodeOk" + "." + "remote_rds") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add remote RDS node OK body based on the context it is used +func (o *AddRemoteRDSNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateRemoteRDS(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddRemoteRDSNodeOKBody) contextValidateRemoteRDS(ctx context.Context, formats strfmt.Registry) error { + + if o.RemoteRDS != nil { + if err := o.RemoteRDS.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRemoteRdsNodeOk" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRemoteRdsNodeOk" + "." + "remote_rds") } return err } @@ -330,6 +441,11 @@ func (o *AddRemoteRDSNodeOKBodyRemoteRDS) Validate(formats strfmt.Registry) erro return nil } +// ContextValidate validates this add remote RDS node OK body remote RDS based on context it is used +func (o *AddRemoteRDSNodeOKBodyRemoteRDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRemoteRDSNodeOKBodyRemoteRDS) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/nodes/get_node_parameters.go b/api/inventorypb/json/client/nodes/get_node_parameters.go index 881e14f10f..ff8762d101 100644 --- a/api/inventorypb/json/client/nodes/get_node_parameters.go +++ b/api/inventorypb/json/client/nodes/get_node_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetNodeParams creates a new GetNodeParams object -// with the default values initialized. +// 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 { - var () return &GetNodeParams{ - timeout: cr.DefaultTimeout, } } // NewGetNodeParamsWithTimeout creates a new GetNodeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetNodeParamsWithTimeout(timeout time.Duration) *GetNodeParams { - var () return &GetNodeParams{ - timeout: timeout, } } // NewGetNodeParamsWithContext creates a new GetNodeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetNodeParamsWithContext(ctx context.Context) *GetNodeParams { - var () return &GetNodeParams{ - Context: ctx, } } // NewGetNodeParamsWithHTTPClient creates a new GetNodeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetNodeParamsWithHTTPClient(client *http.Client) *GetNodeParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body GetNodeBody timeout time.Duration @@ -68,6 +67,21 @@ type GetNodeParams struct { 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) @@ -119,7 +133,6 @@ func (o *GetNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/nodes/get_node_responses.go b/api/inventorypb/json/client/nodes/get_node_responses.go index 1241f352f1..33cf51b85e 100644 --- a/api/inventorypb/json/client/nodes/get_node_responses.go +++ b/api/inventorypb/json/client/nodes/get_node_responses.go @@ -6,6 +6,7 @@ package nodes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetNodeOK() *GetNodeOK { return &GetNodeOK{} } -/*GetNodeOK handles this case with default header values. +/* GetNodeOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetNodeOK struct { func (o *GetNodeOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/Get][%d] getNodeOk %+v", 200, o.Payload) } - func (o *GetNodeOK) GetPayload() *GetNodeOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetNodeDefault(code int) *GetNodeDefault { } } -/*GetNodeDefault handles this case with default header values. +/* GetNodeDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetNodeDefault) Code() int { func (o *GetNodeDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/Get][%d] GetNode default %+v", o._statusCode, o.Payload) } - func (o *GetNodeDefault) GetPayload() *GetNodeDefaultBody { return o.Payload } @@ -131,6 +130,11 @@ func (o *GetNodeBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get node body based on context it is used +func (o *GetNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetNodeBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -164,7 +168,7 @@ type GetNodeDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetNodeDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get node default body @@ -182,7 +186,6 @@ func (o *GetNodeDefaultBody) Validate(formats strfmt.Registry) error { } func (o *GetNodeDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -196,6 +199,42 @@ func (o *GetNodeDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetNode default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,6 +263,47 @@ func (o *GetNodeDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetNodeDefaultBodyDetailsItems0 get node default body details items0 +swagger:model GetNodeDefaultBodyDetailsItems0 +*/ +type GetNodeDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -276,7 +356,6 @@ func (o *GetNodeOKBody) Validate(formats strfmt.Registry) error { } func (o *GetNodeOKBody) validateContainer(formats strfmt.Registry) error { - if swag.IsZero(o.Container) { // not required return nil } @@ -285,6 +364,8 @@ func (o *GetNodeOKBody) validateContainer(formats strfmt.Registry) error { if err := o.Container.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getNodeOk" + "." + "container") } return err } @@ -294,7 +375,6 @@ func (o *GetNodeOKBody) validateContainer(formats strfmt.Registry) error { } func (o *GetNodeOKBody) validateGeneric(formats strfmt.Registry) error { - if swag.IsZero(o.Generic) { // not required return nil } @@ -303,6 +383,8 @@ func (o *GetNodeOKBody) validateGeneric(formats strfmt.Registry) error { if err := o.Generic.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getNodeOk" + "." + "generic") } return err } @@ -312,7 +394,6 @@ func (o *GetNodeOKBody) validateGeneric(formats strfmt.Registry) error { } func (o *GetNodeOKBody) validateRemote(formats strfmt.Registry) error { - if swag.IsZero(o.Remote) { // not required return nil } @@ -321,6 +402,8 @@ func (o *GetNodeOKBody) validateRemote(formats strfmt.Registry) error { if err := o.Remote.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getNodeOk" + "." + "remote") } return err } @@ -330,7 +413,6 @@ func (o *GetNodeOKBody) validateRemote(formats strfmt.Registry) error { } func (o *GetNodeOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteAzureDatabase) { // not required return nil } @@ -339,6 +421,8 @@ func (o *GetNodeOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) err if err := o.RemoteAzureDatabase.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "remote_azure_database") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getNodeOk" + "." + "remote_azure_database") } return err } @@ -348,7 +432,6 @@ func (o *GetNodeOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) err } func (o *GetNodeOKBody) validateRemoteRDS(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteRDS) { // not required return nil } @@ -357,6 +440,118 @@ func (o *GetNodeOKBody) validateRemoteRDS(formats strfmt.Registry) error { if err := o.RemoteRDS.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNodeOk" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Container.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getNodeOk" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Generic.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getNodeOk" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Remote.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getNodeOk" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.RemoteAzureDatabase.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getNodeOk" + "." + "remote_azure_database") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.RemoteRDS.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getNodeOk" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getNodeOk" + "." + "remote_rds") } return err } @@ -424,6 +619,11 @@ 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 { @@ -480,6 +680,11 @@ 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 { @@ -530,6 +735,11 @@ 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 { @@ -580,6 +790,11 @@ func (o *GetNodeOKBodyRemoteAzureDatabase) Validate(formats strfmt.Registry) err 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 { @@ -630,6 +845,11 @@ 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 { diff --git a/api/inventorypb/json/client/nodes/list_nodes_parameters.go b/api/inventorypb/json/client/nodes/list_nodes_parameters.go index 20251779b9..9083027499 100644 --- a/api/inventorypb/json/client/nodes/list_nodes_parameters.go +++ b/api/inventorypb/json/client/nodes/list_nodes_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListNodesParams creates a new ListNodesParams object -// with the default values initialized. +// 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 { - var () return &ListNodesParams{ - timeout: cr.DefaultTimeout, } } // NewListNodesParamsWithTimeout creates a new ListNodesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListNodesParamsWithTimeout(timeout time.Duration) *ListNodesParams { - var () return &ListNodesParams{ - timeout: timeout, } } // NewListNodesParamsWithContext creates a new ListNodesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListNodesParamsWithContext(ctx context.Context) *ListNodesParams { - var () return &ListNodesParams{ - Context: ctx, } } // NewListNodesParamsWithHTTPClient creates a new ListNodesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListNodesParamsWithHTTPClient(client *http.Client) *ListNodesParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body ListNodesBody timeout time.Duration @@ -68,6 +67,21 @@ type ListNodesParams struct { 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() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list nodes params func (o *ListNodesParams) WithTimeout(timeout time.Duration) *ListNodesParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ListNodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/nodes/list_nodes_responses.go b/api/inventorypb/json/client/nodes/list_nodes_responses.go index 50e62a1a9c..a5d632bb56 100644 --- a/api/inventorypb/json/client/nodes/list_nodes_responses.go +++ b/api/inventorypb/json/client/nodes/list_nodes_responses.go @@ -6,6 +6,7 @@ package nodes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListNodesOK() *ListNodesOK { return &ListNodesOK{} } -/*ListNodesOK handles this case with default header values. +/* ListNodesOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListNodesOK struct { func (o *ListNodesOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/List][%d] listNodesOk %+v", 200, o.Payload) } - func (o *ListNodesOK) GetPayload() *ListNodesOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListNodesDefault(code int) *ListNodesDefault { } } -/*ListNodesDefault handles this case with default header values. +/* ListNodesDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListNodesDefault) Code() int { func (o *ListNodesDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/List][%d] ListNodes default %+v", o._statusCode, o.Payload) } - func (o *ListNodesDefault) GetPayload() *ListNodesDefaultBody { return o.Payload } @@ -119,121 +118,6 @@ func (o *ListNodesDefault) readResponse(response runtime.ClientResponse, consume return nil } -/*ContainerItems0 ContainerNode represents a Docker container. -swagger:model ContainerItems0 -*/ -type ContainerItems0 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 container items0 -func (o *ContainerItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ContainerItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ContainerItems0) UnmarshalBinary(b []byte) error { - var res ContainerItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*GenericItems0 GenericNode represents a bare metal server or virtual machine. -swagger:model GenericItems0 -*/ -type GenericItems0 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 generic items0 -func (o *GenericItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GenericItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GenericItems0) UnmarshalBinary(b []byte) error { - var res GenericItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*ListNodesBody list nodes body swagger:model ListNodesBody */ @@ -300,7 +184,6 @@ func (o *ListNodesBody) validateNodeTypeEnum(path, location string, value string } func (o *ListNodesBody) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required return nil } @@ -313,6 +196,11 @@ func (o *ListNodesBody) validateNodeType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list nodes body based on context it is used +func (o *ListNodesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ListNodesBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -346,7 +234,7 @@ type ListNodesDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ListNodesDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this list nodes default body @@ -364,7 +252,6 @@ func (o *ListNodesDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ListNodesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -378,6 +265,42 @@ func (o *ListNodesDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListNodes default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -406,25 +329,66 @@ func (o *ListNodesDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ListNodesDefaultBodyDetailsItems0 list nodes default body details items0 +swagger:model ListNodesDefaultBodyDetailsItems0 +*/ +type ListNodesDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 []*GenericItems0 `json:"generic"` + Generic []*ListNodesOKBodyGenericItems0 `json:"generic"` // container - Container []*ContainerItems0 `json:"container"` + Container []*ListNodesOKBodyContainerItems0 `json:"container"` // remote - Remote []*RemoteItems0 `json:"remote"` + Remote []*ListNodesOKBodyRemoteItems0 `json:"remote"` // remote rds - RemoteRDS []*RemoteRDSItems0 `json:"remote_rds"` + RemoteRDS []*ListNodesOKBodyRemoteRDSItems0 `json:"remote_rds"` // remote azure database - RemoteAzureDatabase []*RemoteAzureDatabaseItems0 `json:"remote_azure_database"` + RemoteAzureDatabase []*ListNodesOKBodyRemoteAzureDatabaseItems0 `json:"remote_azure_database"` } // Validate validates this list nodes OK body @@ -458,7 +422,6 @@ func (o *ListNodesOKBody) Validate(formats strfmt.Registry) error { } func (o *ListNodesOKBody) validateGeneric(formats strfmt.Registry) error { - if swag.IsZero(o.Generic) { // not required return nil } @@ -472,6 +435,8 @@ func (o *ListNodesOKBody) validateGeneric(formats strfmt.Registry) error { if err := o.Generic[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listNodesOk" + "." + "generic" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listNodesOk" + "." + "generic" + "." + strconv.Itoa(i)) } return err } @@ -483,7 +448,6 @@ func (o *ListNodesOKBody) validateGeneric(formats strfmt.Registry) error { } func (o *ListNodesOKBody) validateContainer(formats strfmt.Registry) error { - if swag.IsZero(o.Container) { // not required return nil } @@ -497,6 +461,8 @@ func (o *ListNodesOKBody) validateContainer(formats strfmt.Registry) error { if err := o.Container[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listNodesOk" + "." + "container" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listNodesOk" + "." + "container" + "." + strconv.Itoa(i)) } return err } @@ -508,7 +474,6 @@ func (o *ListNodesOKBody) validateContainer(formats strfmt.Registry) error { } func (o *ListNodesOKBody) validateRemote(formats strfmt.Registry) error { - if swag.IsZero(o.Remote) { // not required return nil } @@ -522,6 +487,8 @@ func (o *ListNodesOKBody) validateRemote(formats strfmt.Registry) error { if err := o.Remote[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listNodesOk" + "." + "remote" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listNodesOk" + "." + "remote" + "." + strconv.Itoa(i)) } return err } @@ -533,7 +500,6 @@ func (o *ListNodesOKBody) validateRemote(formats strfmt.Registry) error { } func (o *ListNodesOKBody) validateRemoteRDS(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteRDS) { // not required return nil } @@ -547,6 +513,8 @@ func (o *ListNodesOKBody) validateRemoteRDS(formats strfmt.Registry) error { if err := o.RemoteRDS[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listNodesOk" + "." + "remote_rds" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listNodesOk" + "." + "remote_rds" + "." + strconv.Itoa(i)) } return err } @@ -558,7 +526,6 @@ func (o *ListNodesOKBody) validateRemoteRDS(formats strfmt.Registry) error { } func (o *ListNodesOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) error { - if swag.IsZero(o.RemoteAzureDatabase) { // not required return nil } @@ -572,6 +539,138 @@ func (o *ListNodesOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) e if err := o.RemoteAzureDatabase[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listNodesOk" + "." + "remote_azure_database" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Generic[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listNodesOk" + "." + "generic" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Container[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listNodesOk" + "." + "container" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Remote[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listNodesOk" + "." + "remote" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.RemoteRDS[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listNodesOk" + "." + "remote_rds" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.RemoteAzureDatabase[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listNodesOk" + "." + "remote_azure_database" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listNodesOk" + "." + "remote_azure_database" + "." + strconv.Itoa(i)) } return err } @@ -600,10 +699,135 @@ func (o *ListNodesOKBody) UnmarshalBinary(b []byte) error { return nil } -/*RemoteAzureDatabaseItems0 RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes. -swagger:model RemoteAzureDatabaseItems0 +/*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 RemoteAzureDatabaseItems0 struct { +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"` @@ -627,13 +851,18 @@ type RemoteAzureDatabaseItems0 struct { CustomLabels map[string]string `json:"custom_labels,omitempty"` } -// Validate validates this remote azure database items0 -func (o *RemoteAzureDatabaseItems0) Validate(formats strfmt.Registry) error { +// 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 *RemoteAzureDatabaseItems0) MarshalBinary() ([]byte, error) { +func (o *ListNodesOKBodyRemoteAzureDatabaseItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -641,8 +870,8 @@ func (o *RemoteAzureDatabaseItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RemoteAzureDatabaseItems0) UnmarshalBinary(b []byte) error { - var res RemoteAzureDatabaseItems0 +func (o *ListNodesOKBodyRemoteAzureDatabaseItems0) UnmarshalBinary(b []byte) error { + var res ListNodesOKBodyRemoteAzureDatabaseItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -650,10 +879,10 @@ func (o *RemoteAzureDatabaseItems0) UnmarshalBinary(b []byte) error { return nil } -/*RemoteItems0 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 RemoteItems0 +/*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 RemoteItems0 struct { +type ListNodesOKBodyRemoteItems0 struct { // Unique randomly generated instance identifier. NodeID string `json:"node_id,omitempty"` @@ -677,13 +906,18 @@ type RemoteItems0 struct { CustomLabels map[string]string `json:"custom_labels,omitempty"` } -// Validate validates this remote items0 -func (o *RemoteItems0) Validate(formats strfmt.Registry) error { +// 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 *RemoteItems0) MarshalBinary() ([]byte, error) { +func (o *ListNodesOKBodyRemoteItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -691,8 +925,8 @@ func (o *RemoteItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RemoteItems0) UnmarshalBinary(b []byte) error { - var res RemoteItems0 +func (o *ListNodesOKBodyRemoteItems0) UnmarshalBinary(b []byte) error { + var res ListNodesOKBodyRemoteItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -700,10 +934,10 @@ func (o *RemoteItems0) UnmarshalBinary(b []byte) error { return nil } -/*RemoteRDSItems0 RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes. -swagger:model RemoteRDSItems0 +/*ListNodesOKBodyRemoteRDSItems0 RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes. +swagger:model ListNodesOKBodyRemoteRDSItems0 */ -type RemoteRDSItems0 struct { +type ListNodesOKBodyRemoteRDSItems0 struct { // Unique randomly generated instance identifier. NodeID string `json:"node_id,omitempty"` @@ -727,13 +961,18 @@ type RemoteRDSItems0 struct { CustomLabels map[string]string `json:"custom_labels,omitempty"` } -// Validate validates this remote RDS items0 -func (o *RemoteRDSItems0) Validate(formats strfmt.Registry) error { +// 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 *RemoteRDSItems0) MarshalBinary() ([]byte, error) { +func (o *ListNodesOKBodyRemoteRDSItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -741,8 +980,8 @@ func (o *RemoteRDSItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RemoteRDSItems0) UnmarshalBinary(b []byte) error { - var res RemoteRDSItems0 +func (o *ListNodesOKBodyRemoteRDSItems0) UnmarshalBinary(b []byte) error { + var res ListNodesOKBodyRemoteRDSItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/inventorypb/json/client/nodes/nodes_client.go b/api/inventorypb/json/client/nodes/nodes_client.go index c13940483d..b71b1c15df 100644 --- a/api/inventorypb/json/client/nodes/nodes_client.go +++ b/api/inventorypb/json/client/nodes/nodes_client.go @@ -23,23 +23,26 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddContainerNode(params *AddContainerNodeParams) (*AddContainerNodeOK, error) + AddContainerNode(params *AddContainerNodeParams, opts ...ClientOption) (*AddContainerNodeOK, error) - AddGenericNode(params *AddGenericNodeParams) (*AddGenericNodeOK, error) + AddGenericNode(params *AddGenericNodeParams, opts ...ClientOption) (*AddGenericNodeOK, error) - AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodeParams) (*AddRemoteAzureDatabaseNodeOK, error) + AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodeParams, opts ...ClientOption) (*AddRemoteAzureDatabaseNodeOK, error) - AddRemoteNode(params *AddRemoteNodeParams) (*AddRemoteNodeOK, error) + AddRemoteNode(params *AddRemoteNodeParams, opts ...ClientOption) (*AddRemoteNodeOK, error) - AddRemoteRDSNode(params *AddRemoteRDSNodeParams) (*AddRemoteRDSNodeOK, error) + AddRemoteRDSNode(params *AddRemoteRDSNodeParams, opts ...ClientOption) (*AddRemoteRDSNodeOK, error) - GetNode(params *GetNodeParams) (*GetNodeOK, error) + GetNode(params *GetNodeParams, opts ...ClientOption) (*GetNodeOK, error) - ListNodes(params *ListNodesParams) (*ListNodesOK, error) + ListNodes(params *ListNodesParams, opts ...ClientOption) (*ListNodesOK, error) - RemoveNode(params *RemoveNodeParams) (*RemoveNodeOK, error) + RemoveNode(params *RemoveNodeParams, opts ...ClientOption) (*RemoveNodeOK, error) SetTransport(transport runtime.ClientTransport) } @@ -49,13 +52,12 @@ type ClientService interface { Adds container Node. */ -func (a *Client) AddContainerNode(params *AddContainerNodeParams) (*AddContainerNodeOK, error) { +func (a *Client) AddContainerNode(params *AddContainerNodeParams, opts ...ClientOption) (*AddContainerNodeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddContainerNodeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddContainerNode", Method: "POST", PathPattern: "/v1/inventory/Nodes/AddContainer", @@ -66,7 +68,12 @@ func (a *Client) AddContainerNode(params *AddContainerNodeParams) (*AddContainer Reader: &AddContainerNodeReader{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 } @@ -84,13 +91,12 @@ func (a *Client) AddContainerNode(params *AddContainerNodeParams) (*AddContainer Adds generic Node. */ -func (a *Client) AddGenericNode(params *AddGenericNodeParams) (*AddGenericNodeOK, error) { +func (a *Client) AddGenericNode(params *AddGenericNodeParams, opts ...ClientOption) (*AddGenericNodeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddGenericNodeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddGenericNode", Method: "POST", PathPattern: "/v1/inventory/Nodes/AddGeneric", @@ -101,7 +107,12 @@ func (a *Client) AddGenericNode(params *AddGenericNodeParams) (*AddGenericNodeOK Reader: &AddGenericNodeReader{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 } @@ -119,13 +130,12 @@ func (a *Client) AddGenericNode(params *AddGenericNodeParams) (*AddGenericNodeOK Adds remote Azure database Node. */ -func (a *Client) AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodeParams) (*AddRemoteAzureDatabaseNodeOK, error) { +func (a *Client) AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodeParams, opts ...ClientOption) (*AddRemoteAzureDatabaseNodeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddRemoteAzureDatabaseNodeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddRemoteAzureDatabaseNode", Method: "POST", PathPattern: "/v1/inventory/Nodes/AddRemoteAzureDatabase", @@ -136,7 +146,12 @@ func (a *Client) AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodePa Reader: &AddRemoteAzureDatabaseNodeReader{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 } @@ -154,13 +169,12 @@ func (a *Client) AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodePa Adds remote Node. */ -func (a *Client) AddRemoteNode(params *AddRemoteNodeParams) (*AddRemoteNodeOK, error) { +func (a *Client) AddRemoteNode(params *AddRemoteNodeParams, opts ...ClientOption) (*AddRemoteNodeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddRemoteNodeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddRemoteNode", Method: "POST", PathPattern: "/v1/inventory/Nodes/AddRemote", @@ -171,7 +185,12 @@ func (a *Client) AddRemoteNode(params *AddRemoteNodeParams) (*AddRemoteNodeOK, e Reader: &AddRemoteNodeReader{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 } @@ -189,13 +208,12 @@ func (a *Client) AddRemoteNode(params *AddRemoteNodeParams) (*AddRemoteNodeOK, e Adds remote RDS Node. */ -func (a *Client) AddRemoteRDSNode(params *AddRemoteRDSNodeParams) (*AddRemoteRDSNodeOK, error) { +func (a *Client) AddRemoteRDSNode(params *AddRemoteRDSNodeParams, opts ...ClientOption) (*AddRemoteRDSNodeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddRemoteRDSNodeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddRemoteRDSNode", Method: "POST", PathPattern: "/v1/inventory/Nodes/AddRemoteRDS", @@ -206,7 +224,12 @@ func (a *Client) AddRemoteRDSNode(params *AddRemoteRDSNodeParams) (*AddRemoteRDS Reader: &AddRemoteRDSNodeReader{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 } @@ -224,13 +247,12 @@ func (a *Client) AddRemoteRDSNode(params *AddRemoteRDSNodeParams) (*AddRemoteRDS Returns a single Node by ID. */ -func (a *Client) GetNode(params *GetNodeParams) (*GetNodeOK, error) { +func (a *Client) GetNode(params *GetNodeParams, opts ...ClientOption) (*GetNodeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetNodeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetNode", Method: "POST", PathPattern: "/v1/inventory/Nodes/Get", @@ -241,7 +263,12 @@ func (a *Client) GetNode(params *GetNodeParams) (*GetNodeOK, error) { 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 } @@ -259,13 +286,12 @@ func (a *Client) GetNode(params *GetNodeParams) (*GetNodeOK, error) { Returns a list of all Nodes. */ -func (a *Client) ListNodes(params *ListNodesParams) (*ListNodesOK, error) { +func (a *Client) ListNodes(params *ListNodesParams, opts ...ClientOption) (*ListNodesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListNodesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListNodes", Method: "POST", PathPattern: "/v1/inventory/Nodes/List", @@ -276,7 +302,12 @@ func (a *Client) ListNodes(params *ListNodesParams) (*ListNodesOK, error) { 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 } @@ -294,13 +325,12 @@ func (a *Client) ListNodes(params *ListNodesParams) (*ListNodesOK, error) { Removes Node. */ -func (a *Client) RemoveNode(params *RemoveNodeParams) (*RemoveNodeOK, error) { +func (a *Client) RemoveNode(params *RemoveNodeParams, opts ...ClientOption) (*RemoveNodeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRemoveNodeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RemoveNode", Method: "POST", PathPattern: "/v1/inventory/Nodes/Remove", @@ -311,7 +341,12 @@ func (a *Client) RemoveNode(params *RemoveNodeParams) (*RemoveNodeOK, error) { 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 } diff --git a/api/inventorypb/json/client/nodes/remove_node_parameters.go b/api/inventorypb/json/client/nodes/remove_node_parameters.go index daebb71fc9..d1a3a758ae 100644 --- a/api/inventorypb/json/client/nodes/remove_node_parameters.go +++ b/api/inventorypb/json/client/nodes/remove_node_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRemoveNodeParams creates a new RemoveNodeParams object -// with the default values initialized. +// 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 { - var () return &RemoveNodeParams{ - timeout: cr.DefaultTimeout, } } // NewRemoveNodeParamsWithTimeout creates a new RemoveNodeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRemoveNodeParamsWithTimeout(timeout time.Duration) *RemoveNodeParams { - var () return &RemoveNodeParams{ - timeout: timeout, } } // NewRemoveNodeParamsWithContext creates a new RemoveNodeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRemoveNodeParamsWithContext(ctx context.Context) *RemoveNodeParams { - var () return &RemoveNodeParams{ - Context: ctx, } } // NewRemoveNodeParamsWithHTTPClient creates a new RemoveNodeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRemoveNodeParamsWithHTTPClient(client *http.Client) *RemoveNodeParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body RemoveNodeBody timeout time.Duration @@ -68,6 +67,21 @@ type RemoveNodeParams struct { 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) @@ -119,7 +133,6 @@ func (o *RemoveNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/nodes/remove_node_responses.go b/api/inventorypb/json/client/nodes/remove_node_responses.go index fc1d6cb650..5c1f442138 100644 --- a/api/inventorypb/json/client/nodes/remove_node_responses.go +++ b/api/inventorypb/json/client/nodes/remove_node_responses.go @@ -6,6 +6,7 @@ package nodes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewRemoveNodeOK() *RemoveNodeOK { return &RemoveNodeOK{} } -/*RemoveNodeOK handles this case with default header values. +/* RemoveNodeOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type RemoveNodeOK struct { func (o *RemoveNodeOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/Remove][%d] removeNodeOk %+v", 200, o.Payload) } - func (o *RemoveNodeOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewRemoveNodeDefault(code int) *RemoveNodeDefault { } } -/*RemoveNodeDefault handles this case with default header values. +/* RemoveNodeDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *RemoveNodeDefault) Code() int { func (o *RemoveNodeDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Nodes/Remove][%d] RemoveNode default %+v", o._statusCode, o.Payload) } - func (o *RemoveNodeDefault) GetPayload() *RemoveNodeDefaultBody { return o.Payload } @@ -132,6 +131,11 @@ func (o *RemoveNodeBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this remove node body based on context it is used +func (o *RemoveNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *RemoveNodeBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -165,7 +169,7 @@ type RemoveNodeDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RemoveNodeDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this remove node default body @@ -183,7 +187,6 @@ func (o *RemoveNodeDefaultBody) Validate(formats strfmt.Registry) error { } func (o *RemoveNodeDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -197,6 +200,42 @@ func (o *RemoveNodeDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RemoveNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RemoveNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RemoveNode default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,3 +263,44 @@ func (o *RemoveNodeDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*RemoveNodeDefaultBodyDetailsItems0 remove node default body details items0 +swagger:model RemoveNodeDefaultBodyDetailsItems0 +*/ +type RemoveNodeDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/inventorypb/json/client/pmm_inventory_client.go b/api/inventorypb/json/client/pmm_inventory_api_client.go similarity index 85% rename from api/inventorypb/json/client/pmm_inventory_client.go rename to api/inventorypb/json/client/pmm_inventory_api_client.go index 97cf75463b..28861253f4 100644 --- a/api/inventorypb/json/client/pmm_inventory_client.go +++ b/api/inventorypb/json/client/pmm_inventory_api_client.go @@ -15,7 +15,7 @@ import ( "github.com/percona/pmm/api/inventorypb/json/client/services" ) -// Default PMM inventory HTTP client. +// Default PMM inventory API HTTP client. var Default = NewHTTPClient(nil) const ( @@ -30,14 +30,14 @@ const ( // DefaultSchemes are the default schemes found in Meta (info) section of spec file var DefaultSchemes = []string{"http", "https"} -// NewHTTPClient creates a new PMM inventory HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMInventory { +// 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 HTTP client, +// NewHTTPClientWithConfig creates a new PMM inventory API HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMInventory { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMInventoryAPI { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -48,14 +48,14 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMM return New(transport, formats) } -// New creates a new PMM inventory client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMInventory { +// 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(PMMInventory) + cli := new(PMMInventoryAPI) cli.Transport = transport cli.Agents = agents.New(transport, formats) cli.Nodes = nodes.New(transport, formats) @@ -102,8 +102,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// PMMInventory is a client for PMM inventory -type PMMInventory struct { +// PMMInventoryAPI is a client for PMM inventory API +type PMMInventoryAPI struct { Agents agents.ClientService Nodes nodes.ClientService @@ -114,7 +114,7 @@ type PMMInventory struct { } // SetTransport changes the transport on the client and all its subresources -func (c *PMMInventory) SetTransport(transport runtime.ClientTransport) { +func (c *PMMInventoryAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Agents.SetTransport(transport) c.Nodes.SetTransport(transport) diff --git a/api/inventorypb/json/client/services/add_external_service_parameters.go b/api/inventorypb/json/client/services/add_external_service_parameters.go index 9faf60aca9..a5352f5ccb 100644 --- a/api/inventorypb/json/client/services/add_external_service_parameters.go +++ b/api/inventorypb/json/client/services/add_external_service_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddExternalServiceParams creates a new AddExternalServiceParams object -// with the default values initialized. +// NewAddExternalServiceParams creates a new AddExternalServiceParams 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 NewAddExternalServiceParams() *AddExternalServiceParams { - var () return &AddExternalServiceParams{ - timeout: cr.DefaultTimeout, } } // NewAddExternalServiceParamsWithTimeout creates a new AddExternalServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddExternalServiceParamsWithTimeout(timeout time.Duration) *AddExternalServiceParams { - var () return &AddExternalServiceParams{ - timeout: timeout, } } // NewAddExternalServiceParamsWithContext creates a new AddExternalServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddExternalServiceParamsWithContext(ctx context.Context) *AddExternalServiceParams { - var () return &AddExternalServiceParams{ - Context: ctx, } } // NewAddExternalServiceParamsWithHTTPClient creates a new AddExternalServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddExternalServiceParamsWithHTTPClient(client *http.Client) *AddExternalServiceParams { - var () return &AddExternalServiceParams{ HTTPClient: client, } } -/*AddExternalServiceParams contains all the parameters to send to the API endpoint -for the add external service operation typically these are written to a http.Request +/* AddExternalServiceParams contains all the parameters to send to the API endpoint + for the add external service operation. + + Typically these are written to a http.Request. */ type AddExternalServiceParams struct { - /*Body*/ + // Body. Body AddExternalServiceBody timeout time.Duration @@ -68,6 +67,21 @@ type AddExternalServiceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add external service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddExternalServiceParams) WithDefaults() *AddExternalServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add external service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddExternalServiceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add external service params func (o *AddExternalServiceParams) WithTimeout(timeout time.Duration) *AddExternalServiceParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddExternalServiceParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/services/add_external_service_responses.go b/api/inventorypb/json/client/services/add_external_service_responses.go index 8cef68578a..516ef6b6c9 100644 --- a/api/inventorypb/json/client/services/add_external_service_responses.go +++ b/api/inventorypb/json/client/services/add_external_service_responses.go @@ -6,6 +6,7 @@ package services // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddExternalServiceOK() *AddExternalServiceOK { return &AddExternalServiceOK{} } -/*AddExternalServiceOK handles this case with default header values. +/* AddExternalServiceOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddExternalServiceOK struct { func (o *AddExternalServiceOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddExternalService][%d] addExternalServiceOk %+v", 200, o.Payload) } - func (o *AddExternalServiceOK) GetPayload() *AddExternalServiceOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddExternalServiceDefault(code int) *AddExternalServiceDefault { } } -/*AddExternalServiceDefault handles this case with default header values. +/* AddExternalServiceDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddExternalServiceDefault) Code() int { func (o *AddExternalServiceDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddExternalService][%d] AddExternalService default %+v", o._statusCode, o.Payload) } - func (o *AddExternalServiceDefault) GetPayload() *AddExternalServiceDefaultBody { return o.Payload } @@ -149,6 +148,11 @@ func (o *AddExternalServiceBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add external service body based on context it is used +func (o *AddExternalServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddExternalServiceBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -182,7 +186,7 @@ type AddExternalServiceDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddExternalServiceDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add external service default body @@ -200,7 +204,6 @@ func (o *AddExternalServiceDefaultBody) Validate(formats strfmt.Registry) error } func (o *AddExternalServiceDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -214,6 +217,42 @@ func (o *AddExternalServiceDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddExternalService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddExternalService default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add external service default body based on the context it is used +func (o *AddExternalServiceDefaultBody) 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 *AddExternalServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddExternalService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddExternalService default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -242,6 +281,47 @@ func (o *AddExternalServiceDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddExternalServiceDefaultBodyDetailsItems0 add external service default body details items0 +swagger:model AddExternalServiceDefaultBodyDetailsItems0 +*/ +type AddExternalServiceDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add external service default body details items0 +func (o *AddExternalServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add external service default body details items0 based on context it is used +func (o *AddExternalServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddExternalServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddExternalServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddExternalServiceDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddExternalServiceOKBody add external service OK body swagger:model AddExternalServiceOKBody */ @@ -266,7 +346,6 @@ func (o *AddExternalServiceOKBody) Validate(formats strfmt.Registry) error { } func (o *AddExternalServiceOKBody) validateExternal(formats strfmt.Registry) error { - if swag.IsZero(o.External) { // not required return nil } @@ -275,6 +354,38 @@ func (o *AddExternalServiceOKBody) validateExternal(formats strfmt.Registry) err if err := o.External.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addExternalServiceOk" + "." + "external") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addExternalServiceOk" + "." + "external") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add external service OK body based on the context it is used +func (o *AddExternalServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateExternal(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddExternalServiceOKBody) contextValidateExternal(ctx context.Context, formats strfmt.Registry) error { + + if o.External != nil { + if err := o.External.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addExternalServiceOk" + "." + "external") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addExternalServiceOk" + "." + "external") } return err } @@ -336,44 +447,13 @@ func (o *AddExternalServiceOKBodyExternal) Validate(formats strfmt.Registry) err return nil } -// MarshalBinary interface implementation -func (o *AddExternalServiceOKBodyExternal) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddExternalServiceOKBodyExternal) UnmarshalBinary(b []byte) error { - var res AddExternalServiceOKBodyExternal - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add external service OK body external based on context it is used +func (o *AddExternalServiceOKBodyExternal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddExternalServiceOKBodyExternal) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -381,8 +461,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddExternalServiceOKBodyExternal) UnmarshalBinary(b []byte) error { + var res AddExternalServiceOKBodyExternal if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/inventorypb/json/client/services/add_ha_proxy_service_parameters.go b/api/inventorypb/json/client/services/add_ha_proxy_service_parameters.go index 4ea5f06af6..ef3bab1a3d 100644 --- a/api/inventorypb/json/client/services/add_ha_proxy_service_parameters.go +++ b/api/inventorypb/json/client/services/add_ha_proxy_service_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddHAProxyServiceParams creates a new AddHAProxyServiceParams object -// with the default values initialized. +// NewAddHAProxyServiceParams creates a new AddHAProxyServiceParams 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 NewAddHAProxyServiceParams() *AddHAProxyServiceParams { - var () return &AddHAProxyServiceParams{ - timeout: cr.DefaultTimeout, } } // NewAddHAProxyServiceParamsWithTimeout creates a new AddHAProxyServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddHAProxyServiceParamsWithTimeout(timeout time.Duration) *AddHAProxyServiceParams { - var () return &AddHAProxyServiceParams{ - timeout: timeout, } } // NewAddHAProxyServiceParamsWithContext creates a new AddHAProxyServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddHAProxyServiceParamsWithContext(ctx context.Context) *AddHAProxyServiceParams { - var () return &AddHAProxyServiceParams{ - Context: ctx, } } // NewAddHAProxyServiceParamsWithHTTPClient creates a new AddHAProxyServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddHAProxyServiceParamsWithHTTPClient(client *http.Client) *AddHAProxyServiceParams { - var () return &AddHAProxyServiceParams{ HTTPClient: client, } } -/*AddHAProxyServiceParams contains all the parameters to send to the API endpoint -for the add HA proxy service operation typically these are written to a http.Request +/* AddHAProxyServiceParams contains all the parameters to send to the API endpoint + for the add HA proxy service operation. + + Typically these are written to a http.Request. */ type AddHAProxyServiceParams struct { - /*Body*/ + // Body. Body AddHAProxyServiceBody timeout time.Duration @@ -68,6 +67,21 @@ type AddHAProxyServiceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add HA proxy service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddHAProxyServiceParams) WithDefaults() *AddHAProxyServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add HA proxy service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddHAProxyServiceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add HA proxy service params func (o *AddHAProxyServiceParams) WithTimeout(timeout time.Duration) *AddHAProxyServiceParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddHAProxyServiceParams) WriteToRequest(r runtime.ClientRequest, reg st return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/services/add_ha_proxy_service_responses.go b/api/inventorypb/json/client/services/add_ha_proxy_service_responses.go index 3dc5047a37..8bf4bca93b 100644 --- a/api/inventorypb/json/client/services/add_ha_proxy_service_responses.go +++ b/api/inventorypb/json/client/services/add_ha_proxy_service_responses.go @@ -6,6 +6,7 @@ package services // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddHAProxyServiceOK() *AddHAProxyServiceOK { return &AddHAProxyServiceOK{} } -/*AddHAProxyServiceOK handles this case with default header values. +/* AddHAProxyServiceOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddHAProxyServiceOK struct { func (o *AddHAProxyServiceOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddHAProxyService][%d] addHaProxyServiceOk %+v", 200, o.Payload) } - func (o *AddHAProxyServiceOK) GetPayload() *AddHAProxyServiceOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddHAProxyServiceDefault(code int) *AddHAProxyServiceDefault { } } -/*AddHAProxyServiceDefault handles this case with default header values. +/* AddHAProxyServiceDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddHAProxyServiceDefault) Code() int { func (o *AddHAProxyServiceDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddHAProxyService][%d] AddHAProxyService default %+v", o._statusCode, o.Payload) } - func (o *AddHAProxyServiceDefault) GetPayload() *AddHAProxyServiceDefaultBody { return o.Payload } @@ -146,6 +145,11 @@ func (o *AddHAProxyServiceBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add HA proxy service body based on context it is used +func (o *AddHAProxyServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddHAProxyServiceBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -179,7 +183,7 @@ type AddHAProxyServiceDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddHAProxyServiceDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add HA proxy service default body @@ -197,7 +201,6 @@ func (o *AddHAProxyServiceDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddHAProxyServiceDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -211,6 +214,42 @@ func (o *AddHAProxyServiceDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddHAProxyService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddHAProxyService default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add HA proxy service default body based on the context it is used +func (o *AddHAProxyServiceDefaultBody) 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 *AddHAProxyServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddHAProxyService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddHAProxyService default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -239,6 +278,47 @@ func (o *AddHAProxyServiceDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddHAProxyServiceDefaultBodyDetailsItems0 add HA proxy service default body details items0 +swagger:model AddHAProxyServiceDefaultBodyDetailsItems0 +*/ +type AddHAProxyServiceDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add HA proxy service default body details items0 +func (o *AddHAProxyServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add HA proxy service default body details items0 based on context it is used +func (o *AddHAProxyServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddHAProxyServiceDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddHAProxyServiceOKBody add HA proxy service OK body swagger:model AddHAProxyServiceOKBody */ @@ -263,7 +343,6 @@ func (o *AddHAProxyServiceOKBody) Validate(formats strfmt.Registry) error { } func (o *AddHAProxyServiceOKBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required return nil } @@ -272,6 +351,38 @@ func (o *AddHAProxyServiceOKBody) validateHaproxy(formats strfmt.Registry) error if err := o.Haproxy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addHaProxyServiceOk" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addHaProxyServiceOk" + "." + "haproxy") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add HA proxy service OK body based on the context it is used +func (o *AddHAProxyServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHaproxy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddHAProxyServiceOKBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { + + if o.Haproxy != nil { + if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addHaProxyServiceOk" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addHaProxyServiceOk" + "." + "haproxy") } return err } @@ -330,6 +441,11 @@ func (o *AddHAProxyServiceOKBodyHaproxy) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this add HA proxy service OK body haproxy based on context it is used +func (o *AddHAProxyServiceOKBodyHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddHAProxyServiceOKBodyHaproxy) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/services/add_mongo_db_service_parameters.go b/api/inventorypb/json/client/services/add_mongo_db_service_parameters.go index 86577886db..c400e67468 100644 --- a/api/inventorypb/json/client/services/add_mongo_db_service_parameters.go +++ b/api/inventorypb/json/client/services/add_mongo_db_service_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddMongoDBServiceParams creates a new AddMongoDBServiceParams object -// with the default values initialized. +// NewAddMongoDBServiceParams creates a new AddMongoDBServiceParams 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 NewAddMongoDBServiceParams() *AddMongoDBServiceParams { - var () return &AddMongoDBServiceParams{ - timeout: cr.DefaultTimeout, } } // NewAddMongoDBServiceParamsWithTimeout creates a new AddMongoDBServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddMongoDBServiceParamsWithTimeout(timeout time.Duration) *AddMongoDBServiceParams { - var () return &AddMongoDBServiceParams{ - timeout: timeout, } } // NewAddMongoDBServiceParamsWithContext creates a new AddMongoDBServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddMongoDBServiceParamsWithContext(ctx context.Context) *AddMongoDBServiceParams { - var () return &AddMongoDBServiceParams{ - Context: ctx, } } // NewAddMongoDBServiceParamsWithHTTPClient creates a new AddMongoDBServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddMongoDBServiceParamsWithHTTPClient(client *http.Client) *AddMongoDBServiceParams { - var () return &AddMongoDBServiceParams{ HTTPClient: client, } } -/*AddMongoDBServiceParams contains all the parameters to send to the API endpoint -for the add mongo DB service operation typically these are written to a http.Request +/* AddMongoDBServiceParams contains all the parameters to send to the API endpoint + for the add mongo DB service operation. + + Typically these are written to a http.Request. */ type AddMongoDBServiceParams struct { - /*Body*/ + // Body. Body AddMongoDBServiceBody timeout time.Duration @@ -68,6 +67,21 @@ type AddMongoDBServiceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add mongo DB service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMongoDBServiceParams) WithDefaults() *AddMongoDBServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add mongo DB service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMongoDBServiceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add mongo DB service params func (o *AddMongoDBServiceParams) WithTimeout(timeout time.Duration) *AddMongoDBServiceParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddMongoDBServiceParams) WriteToRequest(r runtime.ClientRequest, reg st return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/services/add_mongo_db_service_responses.go b/api/inventorypb/json/client/services/add_mongo_db_service_responses.go index c1bf2e5da1..866b7381d3 100644 --- a/api/inventorypb/json/client/services/add_mongo_db_service_responses.go +++ b/api/inventorypb/json/client/services/add_mongo_db_service_responses.go @@ -6,6 +6,7 @@ package services // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddMongoDBServiceOK() *AddMongoDBServiceOK { return &AddMongoDBServiceOK{} } -/*AddMongoDBServiceOK handles this case with default header values. +/* AddMongoDBServiceOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddMongoDBServiceOK struct { func (o *AddMongoDBServiceOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddMongoDB][%d] addMongoDbServiceOk %+v", 200, o.Payload) } - func (o *AddMongoDBServiceOK) GetPayload() *AddMongoDBServiceOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddMongoDBServiceDefault(code int) *AddMongoDBServiceDefault { } } -/*AddMongoDBServiceDefault handles this case with default header values. +/* AddMongoDBServiceDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddMongoDBServiceDefault) Code() int { func (o *AddMongoDBServiceDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddMongoDB][%d] AddMongoDBService default %+v", o._statusCode, o.Payload) } - func (o *AddMongoDBServiceDefault) GetPayload() *AddMongoDBServiceDefaultBody { return o.Payload } @@ -158,6 +157,11 @@ func (o *AddMongoDBServiceBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add mongo DB service body based on context it is used +func (o *AddMongoDBServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMongoDBServiceBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -191,7 +195,7 @@ type AddMongoDBServiceDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddMongoDBServiceDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add mongo DB service default body @@ -209,7 +213,6 @@ func (o *AddMongoDBServiceDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddMongoDBServiceDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -223,6 +226,42 @@ func (o *AddMongoDBServiceDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddMongoDBService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMongoDBService default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add mongo DB service default body based on the context it is used +func (o *AddMongoDBServiceDefaultBody) 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 *AddMongoDBServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddMongoDBService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMongoDBService default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -251,6 +290,47 @@ func (o *AddMongoDBServiceDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddMongoDBServiceDefaultBodyDetailsItems0 add mongo DB service default body details items0 +swagger:model AddMongoDBServiceDefaultBodyDetailsItems0 +*/ +type AddMongoDBServiceDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add mongo DB service default body details items0 +func (o *AddMongoDBServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add mongo DB service default body details items0 based on context it is used +func (o *AddMongoDBServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddMongoDBServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddMongoDBServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddMongoDBServiceDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddMongoDBServiceOKBody add mongo DB service OK body swagger:model AddMongoDBServiceOKBody */ @@ -275,7 +355,6 @@ func (o *AddMongoDBServiceOKBody) Validate(formats strfmt.Registry) error { } func (o *AddMongoDBServiceOKBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required return nil } @@ -284,6 +363,38 @@ func (o *AddMongoDBServiceOKBody) validateMongodb(formats strfmt.Registry) error if err := o.Mongodb.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMongoDbServiceOk" + "." + "mongodb") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMongoDbServiceOk" + "." + "mongodb") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add mongo DB service OK body based on the context it is used +func (o *AddMongoDBServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMongodb(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddMongoDBServiceOKBody) contextValidateMongodb(ctx context.Context, formats strfmt.Registry) error { + + if o.Mongodb != nil { + if err := o.Mongodb.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMongoDbServiceOk" + "." + "mongodb") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMongoDbServiceOk" + "." + "mongodb") } return err } @@ -354,6 +465,11 @@ func (o *AddMongoDBServiceOKBodyMongodb) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this add mongo DB service OK body mongodb based on context it is used +func (o *AddMongoDBServiceOKBodyMongodb) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMongoDBServiceOKBodyMongodb) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/services/add_my_sql_service_parameters.go b/api/inventorypb/json/client/services/add_my_sql_service_parameters.go index ffc91b8985..ba1886ee2d 100644 --- a/api/inventorypb/json/client/services/add_my_sql_service_parameters.go +++ b/api/inventorypb/json/client/services/add_my_sql_service_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddMySQLServiceParams creates a new AddMySQLServiceParams object -// with the default values initialized. +// NewAddMySQLServiceParams creates a new AddMySQLServiceParams 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 NewAddMySQLServiceParams() *AddMySQLServiceParams { - var () return &AddMySQLServiceParams{ - timeout: cr.DefaultTimeout, } } // NewAddMySQLServiceParamsWithTimeout creates a new AddMySQLServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddMySQLServiceParamsWithTimeout(timeout time.Duration) *AddMySQLServiceParams { - var () return &AddMySQLServiceParams{ - timeout: timeout, } } // NewAddMySQLServiceParamsWithContext creates a new AddMySQLServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddMySQLServiceParamsWithContext(ctx context.Context) *AddMySQLServiceParams { - var () return &AddMySQLServiceParams{ - Context: ctx, } } // NewAddMySQLServiceParamsWithHTTPClient creates a new AddMySQLServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddMySQLServiceParamsWithHTTPClient(client *http.Client) *AddMySQLServiceParams { - var () return &AddMySQLServiceParams{ HTTPClient: client, } } -/*AddMySQLServiceParams contains all the parameters to send to the API endpoint -for the add my SQL service operation typically these are written to a http.Request +/* AddMySQLServiceParams contains all the parameters to send to the API endpoint + for the add my SQL service operation. + + Typically these are written to a http.Request. */ type AddMySQLServiceParams struct { - /*Body*/ + // Body. Body AddMySQLServiceBody timeout time.Duration @@ -68,6 +67,21 @@ type AddMySQLServiceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add my SQL service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMySQLServiceParams) WithDefaults() *AddMySQLServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add my SQL service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMySQLServiceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add my SQL service params func (o *AddMySQLServiceParams) WithTimeout(timeout time.Duration) *AddMySQLServiceParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddMySQLServiceParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/services/add_my_sql_service_responses.go b/api/inventorypb/json/client/services/add_my_sql_service_responses.go index 0aee070efc..40f73095d9 100644 --- a/api/inventorypb/json/client/services/add_my_sql_service_responses.go +++ b/api/inventorypb/json/client/services/add_my_sql_service_responses.go @@ -6,6 +6,7 @@ package services // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddMySQLServiceOK() *AddMySQLServiceOK { return &AddMySQLServiceOK{} } -/*AddMySQLServiceOK handles this case with default header values. +/* AddMySQLServiceOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddMySQLServiceOK struct { func (o *AddMySQLServiceOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddMySQL][%d] addMySqlServiceOk %+v", 200, o.Payload) } - func (o *AddMySQLServiceOK) GetPayload() *AddMySQLServiceOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddMySQLServiceDefault(code int) *AddMySQLServiceDefault { } } -/*AddMySQLServiceDefault handles this case with default header values. +/* AddMySQLServiceDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddMySQLServiceDefault) Code() int { func (o *AddMySQLServiceDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddMySQL][%d] AddMySQLService default %+v", o._statusCode, o.Payload) } - func (o *AddMySQLServiceDefault) GetPayload() *AddMySQLServiceDefaultBody { return o.Payload } @@ -158,6 +157,11 @@ func (o *AddMySQLServiceBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add my SQL service body based on context it is used +func (o *AddMySQLServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMySQLServiceBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -191,7 +195,7 @@ type AddMySQLServiceDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddMySQLServiceDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add my SQL service default body @@ -209,7 +213,6 @@ func (o *AddMySQLServiceDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddMySQLServiceDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -223,6 +226,42 @@ func (o *AddMySQLServiceDefaultBody) validateDetails(formats strfmt.Registry) er if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddMySQLService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMySQLService default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add my SQL service default body based on the context it is used +func (o *AddMySQLServiceDefaultBody) 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 *AddMySQLServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddMySQLService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMySQLService default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -251,6 +290,47 @@ func (o *AddMySQLServiceDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddMySQLServiceDefaultBodyDetailsItems0 add my SQL service default body details items0 +swagger:model AddMySQLServiceDefaultBodyDetailsItems0 +*/ +type AddMySQLServiceDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add my SQL service default body details items0 +func (o *AddMySQLServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add my SQL service default body details items0 based on context it is used +func (o *AddMySQLServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddMySQLServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddMySQLServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddMySQLServiceDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddMySQLServiceOKBody add my SQL service OK body swagger:model AddMySQLServiceOKBody */ @@ -275,7 +355,6 @@ func (o *AddMySQLServiceOKBody) Validate(formats strfmt.Registry) error { } func (o *AddMySQLServiceOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required return nil } @@ -284,6 +363,38 @@ func (o *AddMySQLServiceOKBody) validateMysql(formats strfmt.Registry) error { if err := o.Mysql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMySqlServiceOk" + "." + "mysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySqlServiceOk" + "." + "mysql") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add my SQL service OK body based on the context it is used +func (o *AddMySQLServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMysql(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddMySQLServiceOKBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { + + if o.Mysql != nil { + if err := o.Mysql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMySqlServiceOk" + "." + "mysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySqlServiceOk" + "." + "mysql") } return err } @@ -354,6 +465,11 @@ func (o *AddMySQLServiceOKBodyMysql) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add my SQL service OK body mysql based on context it is used +func (o *AddMySQLServiceOKBodyMysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMySQLServiceOKBodyMysql) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/services/add_postgre_sql_service_parameters.go b/api/inventorypb/json/client/services/add_postgre_sql_service_parameters.go index ed4eab0d4e..2f09de4ac8 100644 --- a/api/inventorypb/json/client/services/add_postgre_sql_service_parameters.go +++ b/api/inventorypb/json/client/services/add_postgre_sql_service_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddPostgreSQLServiceParams creates a new AddPostgreSQLServiceParams object -// with the default values initialized. +// NewAddPostgreSQLServiceParams creates a new AddPostgreSQLServiceParams 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 NewAddPostgreSQLServiceParams() *AddPostgreSQLServiceParams { - var () return &AddPostgreSQLServiceParams{ - timeout: cr.DefaultTimeout, } } // NewAddPostgreSQLServiceParamsWithTimeout creates a new AddPostgreSQLServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddPostgreSQLServiceParamsWithTimeout(timeout time.Duration) *AddPostgreSQLServiceParams { - var () return &AddPostgreSQLServiceParams{ - timeout: timeout, } } // NewAddPostgreSQLServiceParamsWithContext creates a new AddPostgreSQLServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddPostgreSQLServiceParamsWithContext(ctx context.Context) *AddPostgreSQLServiceParams { - var () return &AddPostgreSQLServiceParams{ - Context: ctx, } } // NewAddPostgreSQLServiceParamsWithHTTPClient creates a new AddPostgreSQLServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddPostgreSQLServiceParamsWithHTTPClient(client *http.Client) *AddPostgreSQLServiceParams { - var () return &AddPostgreSQLServiceParams{ HTTPClient: client, } } -/*AddPostgreSQLServiceParams contains all the parameters to send to the API endpoint -for the add postgre SQL service operation typically these are written to a http.Request +/* AddPostgreSQLServiceParams contains all the parameters to send to the API endpoint + for the add postgre SQL service operation. + + Typically these are written to a http.Request. */ type AddPostgreSQLServiceParams struct { - /*Body*/ + // Body. Body AddPostgreSQLServiceBody timeout time.Duration @@ -68,6 +67,21 @@ type AddPostgreSQLServiceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add postgre SQL service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddPostgreSQLServiceParams) WithDefaults() *AddPostgreSQLServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add postgre SQL service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddPostgreSQLServiceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add postgre SQL service params func (o *AddPostgreSQLServiceParams) WithTimeout(timeout time.Duration) *AddPostgreSQLServiceParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddPostgreSQLServiceParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/services/add_postgre_sql_service_responses.go b/api/inventorypb/json/client/services/add_postgre_sql_service_responses.go index fd0328bc55..398a872d44 100644 --- a/api/inventorypb/json/client/services/add_postgre_sql_service_responses.go +++ b/api/inventorypb/json/client/services/add_postgre_sql_service_responses.go @@ -6,6 +6,7 @@ package services // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddPostgreSQLServiceOK() *AddPostgreSQLServiceOK { return &AddPostgreSQLServiceOK{} } -/*AddPostgreSQLServiceOK handles this case with default header values. +/* AddPostgreSQLServiceOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddPostgreSQLServiceOK struct { func (o *AddPostgreSQLServiceOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddPostgreSQL][%d] addPostgreSqlServiceOk %+v", 200, o.Payload) } - func (o *AddPostgreSQLServiceOK) GetPayload() *AddPostgreSQLServiceOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddPostgreSQLServiceDefault(code int) *AddPostgreSQLServiceDefault { } } -/*AddPostgreSQLServiceDefault handles this case with default header values. +/* AddPostgreSQLServiceDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddPostgreSQLServiceDefault) Code() int { func (o *AddPostgreSQLServiceDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddPostgreSQL][%d] AddPostgreSQLService default %+v", o._statusCode, o.Payload) } - func (o *AddPostgreSQLServiceDefault) GetPayload() *AddPostgreSQLServiceDefaultBody { return o.Payload } @@ -158,6 +157,11 @@ func (o *AddPostgreSQLServiceBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add postgre SQL service body based on context it is used +func (o *AddPostgreSQLServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddPostgreSQLServiceBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -191,7 +195,7 @@ type AddPostgreSQLServiceDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddPostgreSQLServiceDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add postgre SQL service default body @@ -209,7 +213,6 @@ func (o *AddPostgreSQLServiceDefaultBody) Validate(formats strfmt.Registry) erro } func (o *AddPostgreSQLServiceDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -223,6 +226,42 @@ func (o *AddPostgreSQLServiceDefaultBody) validateDetails(formats strfmt.Registr if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddPostgreSQLService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddPostgreSQLService default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add postgre SQL service default body based on the context it is used +func (o *AddPostgreSQLServiceDefaultBody) 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 *AddPostgreSQLServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddPostgreSQLService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddPostgreSQLService default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -251,6 +290,47 @@ func (o *AddPostgreSQLServiceDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddPostgreSQLServiceDefaultBodyDetailsItems0 add postgre SQL service default body details items0 +swagger:model AddPostgreSQLServiceDefaultBodyDetailsItems0 +*/ +type AddPostgreSQLServiceDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add postgre SQL service default body details items0 +func (o *AddPostgreSQLServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add postgre SQL service default body details items0 based on context it is used +func (o *AddPostgreSQLServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddPostgreSQLServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddPostgreSQLServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddPostgreSQLServiceDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddPostgreSQLServiceOKBody add postgre SQL service OK body swagger:model AddPostgreSQLServiceOKBody */ @@ -275,7 +355,6 @@ func (o *AddPostgreSQLServiceOKBody) Validate(formats strfmt.Registry) error { } func (o *AddPostgreSQLServiceOKBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required return nil } @@ -284,6 +363,38 @@ func (o *AddPostgreSQLServiceOKBody) validatePostgresql(formats strfmt.Registry) if err := o.Postgresql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addPostgreSqlServiceOk" + "." + "postgresql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgreSqlServiceOk" + "." + "postgresql") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add postgre SQL service OK body based on the context it is used +func (o *AddPostgreSQLServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePostgresql(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddPostgreSQLServiceOKBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { + + if o.Postgresql != nil { + if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addPostgreSqlServiceOk" + "." + "postgresql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgreSqlServiceOk" + "." + "postgresql") } return err } @@ -357,6 +468,11 @@ func (o *AddPostgreSQLServiceOKBodyPostgresql) Validate(formats strfmt.Registry) return nil } +// ContextValidate validates this add postgre SQL service OK body postgresql based on context it is used +func (o *AddPostgreSQLServiceOKBodyPostgresql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddPostgreSQLServiceOKBodyPostgresql) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/services/add_proxy_sql_service_parameters.go b/api/inventorypb/json/client/services/add_proxy_sql_service_parameters.go index b4e536b118..365dde9006 100644 --- a/api/inventorypb/json/client/services/add_proxy_sql_service_parameters.go +++ b/api/inventorypb/json/client/services/add_proxy_sql_service_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddProxySQLServiceParams creates a new AddProxySQLServiceParams object -// with the default values initialized. +// NewAddProxySQLServiceParams creates a new AddProxySQLServiceParams 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 NewAddProxySQLServiceParams() *AddProxySQLServiceParams { - var () return &AddProxySQLServiceParams{ - timeout: cr.DefaultTimeout, } } // NewAddProxySQLServiceParamsWithTimeout creates a new AddProxySQLServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddProxySQLServiceParamsWithTimeout(timeout time.Duration) *AddProxySQLServiceParams { - var () return &AddProxySQLServiceParams{ - timeout: timeout, } } // NewAddProxySQLServiceParamsWithContext creates a new AddProxySQLServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddProxySQLServiceParamsWithContext(ctx context.Context) *AddProxySQLServiceParams { - var () return &AddProxySQLServiceParams{ - Context: ctx, } } // NewAddProxySQLServiceParamsWithHTTPClient creates a new AddProxySQLServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddProxySQLServiceParamsWithHTTPClient(client *http.Client) *AddProxySQLServiceParams { - var () return &AddProxySQLServiceParams{ HTTPClient: client, } } -/*AddProxySQLServiceParams contains all the parameters to send to the API endpoint -for the add proxy SQL service operation typically these are written to a http.Request +/* AddProxySQLServiceParams contains all the parameters to send to the API endpoint + for the add proxy SQL service operation. + + Typically these are written to a http.Request. */ type AddProxySQLServiceParams struct { - /*Body*/ + // Body. Body AddProxySQLServiceBody timeout time.Duration @@ -68,6 +67,21 @@ type AddProxySQLServiceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add proxy SQL service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddProxySQLServiceParams) WithDefaults() *AddProxySQLServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add proxy SQL service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddProxySQLServiceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add proxy SQL service params func (o *AddProxySQLServiceParams) WithTimeout(timeout time.Duration) *AddProxySQLServiceParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddProxySQLServiceParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/services/add_proxy_sql_service_responses.go b/api/inventorypb/json/client/services/add_proxy_sql_service_responses.go index a7f65fb1d7..f4b1aac5af 100644 --- a/api/inventorypb/json/client/services/add_proxy_sql_service_responses.go +++ b/api/inventorypb/json/client/services/add_proxy_sql_service_responses.go @@ -6,6 +6,7 @@ package services // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddProxySQLServiceOK() *AddProxySQLServiceOK { return &AddProxySQLServiceOK{} } -/*AddProxySQLServiceOK handles this case with default header values. +/* AddProxySQLServiceOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddProxySQLServiceOK struct { func (o *AddProxySQLServiceOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddProxySQL][%d] addProxySqlServiceOk %+v", 200, o.Payload) } - func (o *AddProxySQLServiceOK) GetPayload() *AddProxySQLServiceOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddProxySQLServiceDefault(code int) *AddProxySQLServiceDefault { } } -/*AddProxySQLServiceDefault handles this case with default header values. +/* AddProxySQLServiceDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddProxySQLServiceDefault) Code() int { func (o *AddProxySQLServiceDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/AddProxySQL][%d] AddProxySQLService default %+v", o._statusCode, o.Payload) } - func (o *AddProxySQLServiceDefault) GetPayload() *AddProxySQLServiceDefaultBody { return o.Payload } @@ -158,6 +157,11 @@ func (o *AddProxySQLServiceBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add proxy SQL service body based on context it is used +func (o *AddProxySQLServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddProxySQLServiceBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -191,7 +195,7 @@ type AddProxySQLServiceDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddProxySQLServiceDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add proxy SQL service default body @@ -209,7 +213,6 @@ func (o *AddProxySQLServiceDefaultBody) Validate(formats strfmt.Registry) error } func (o *AddProxySQLServiceDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -223,6 +226,42 @@ func (o *AddProxySQLServiceDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddProxySQLService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddProxySQLService default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add proxy SQL service default body based on the context it is used +func (o *AddProxySQLServiceDefaultBody) 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 *AddProxySQLServiceDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddProxySQLService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddProxySQLService default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -251,6 +290,47 @@ func (o *AddProxySQLServiceDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddProxySQLServiceDefaultBodyDetailsItems0 add proxy SQL service default body details items0 +swagger:model AddProxySQLServiceDefaultBodyDetailsItems0 +*/ +type AddProxySQLServiceDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add proxy SQL service default body details items0 +func (o *AddProxySQLServiceDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add proxy SQL service default body details items0 based on context it is used +func (o *AddProxySQLServiceDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddProxySQLServiceDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddProxySQLServiceDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddProxySQLServiceDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddProxySQLServiceOKBody add proxy SQL service OK body swagger:model AddProxySQLServiceOKBody */ @@ -275,7 +355,6 @@ func (o *AddProxySQLServiceOKBody) Validate(formats strfmt.Registry) error { } func (o *AddProxySQLServiceOKBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required return nil } @@ -284,6 +363,38 @@ func (o *AddProxySQLServiceOKBody) validateProxysql(formats strfmt.Registry) err if err := o.Proxysql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addProxySqlServiceOk" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addProxySqlServiceOk" + "." + "proxysql") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add proxy SQL service OK body based on the context it is used +func (o *AddProxySQLServiceOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateProxysql(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddProxySQLServiceOKBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { + + if o.Proxysql != nil { + if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addProxySqlServiceOk" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addProxySqlServiceOk" + "." + "proxysql") } return err } @@ -354,6 +465,11 @@ func (o *AddProxySQLServiceOKBodyProxysql) Validate(formats strfmt.Registry) err return nil } +// ContextValidate validates this add proxy SQL service OK body proxysql based on context it is used +func (o *AddProxySQLServiceOKBodyProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddProxySQLServiceOKBodyProxysql) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/inventorypb/json/client/services/get_service_parameters.go b/api/inventorypb/json/client/services/get_service_parameters.go index e7f2aac578..46b96f089f 100644 --- a/api/inventorypb/json/client/services/get_service_parameters.go +++ b/api/inventorypb/json/client/services/get_service_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetServiceParams creates a new GetServiceParams object -// with the default values initialized. +// 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 { - var () return &GetServiceParams{ - timeout: cr.DefaultTimeout, } } // NewGetServiceParamsWithTimeout creates a new GetServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetServiceParamsWithTimeout(timeout time.Duration) *GetServiceParams { - var () return &GetServiceParams{ - timeout: timeout, } } // NewGetServiceParamsWithContext creates a new GetServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetServiceParamsWithContext(ctx context.Context) *GetServiceParams { - var () return &GetServiceParams{ - Context: ctx, } } // NewGetServiceParamsWithHTTPClient creates a new GetServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetServiceParamsWithHTTPClient(client *http.Client) *GetServiceParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body GetServiceBody timeout time.Duration @@ -68,6 +67,21 @@ type GetServiceParams struct { 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) @@ -119,7 +133,6 @@ func (o *GetServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/services/get_service_responses.go b/api/inventorypb/json/client/services/get_service_responses.go index e1f780cbc2..26baa3a9c7 100644 --- a/api/inventorypb/json/client/services/get_service_responses.go +++ b/api/inventorypb/json/client/services/get_service_responses.go @@ -6,6 +6,7 @@ package services // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetServiceOK() *GetServiceOK { return &GetServiceOK{} } -/*GetServiceOK handles this case with default header values. +/* GetServiceOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetServiceOK struct { func (o *GetServiceOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/Get][%d] getServiceOk %+v", 200, o.Payload) } - func (o *GetServiceOK) GetPayload() *GetServiceOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetServiceDefault(code int) *GetServiceDefault { } } -/*GetServiceDefault handles this case with default header values. +/* GetServiceDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetServiceDefault) Code() int { func (o *GetServiceDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/Get][%d] GetService default %+v", o._statusCode, o.Payload) } - func (o *GetServiceDefault) GetPayload() *GetServiceDefaultBody { return o.Payload } @@ -131,6 +130,11 @@ func (o *GetServiceBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get service body based on context it is used +func (o *GetServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetServiceBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -164,7 +168,7 @@ type GetServiceDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetServiceDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get service default body @@ -182,7 +186,6 @@ func (o *GetServiceDefaultBody) Validate(formats strfmt.Registry) error { } func (o *GetServiceDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -196,6 +199,42 @@ func (o *GetServiceDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetService default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,6 +263,47 @@ func (o *GetServiceDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetServiceDefaultBodyDetailsItems0 get service default body details items0 +swagger:model GetServiceDefaultBodyDetailsItems0 +*/ +type GetServiceDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -283,7 +363,6 @@ func (o *GetServiceOKBody) Validate(formats strfmt.Registry) error { } func (o *GetServiceOKBody) validateExternal(formats strfmt.Registry) error { - if swag.IsZero(o.External) { // not required return nil } @@ -292,6 +371,8 @@ func (o *GetServiceOKBody) validateExternal(formats strfmt.Registry) error { if err := o.External.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getServiceOk" + "." + "external") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getServiceOk" + "." + "external") } return err } @@ -301,7 +382,6 @@ func (o *GetServiceOKBody) validateExternal(formats strfmt.Registry) error { } func (o *GetServiceOKBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required return nil } @@ -310,6 +390,8 @@ func (o *GetServiceOKBody) validateHaproxy(formats strfmt.Registry) error { if err := o.Haproxy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getServiceOk" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getServiceOk" + "." + "haproxy") } return err } @@ -319,7 +401,6 @@ func (o *GetServiceOKBody) validateHaproxy(formats strfmt.Registry) error { } func (o *GetServiceOKBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required return nil } @@ -328,6 +409,8 @@ func (o *GetServiceOKBody) validateMongodb(formats strfmt.Registry) error { if err := o.Mongodb.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getServiceOk" + "." + "mongodb") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getServiceOk" + "." + "mongodb") } return err } @@ -337,7 +420,6 @@ func (o *GetServiceOKBody) validateMongodb(formats strfmt.Registry) error { } func (o *GetServiceOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required return nil } @@ -346,6 +428,8 @@ func (o *GetServiceOKBody) validateMysql(formats strfmt.Registry) error { if err := o.Mysql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getServiceOk" + "." + "mysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getServiceOk" + "." + "mysql") } return err } @@ -355,7 +439,6 @@ func (o *GetServiceOKBody) validateMysql(formats strfmt.Registry) error { } func (o *GetServiceOKBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required return nil } @@ -364,6 +447,8 @@ func (o *GetServiceOKBody) validatePostgresql(formats strfmt.Registry) error { if err := o.Postgresql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getServiceOk" + "." + "postgresql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getServiceOk" + "." + "postgresql") } return err } @@ -373,7 +458,6 @@ func (o *GetServiceOKBody) validatePostgresql(formats strfmt.Registry) error { } func (o *GetServiceOKBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required return nil } @@ -382,6 +466,138 @@ func (o *GetServiceOKBody) validateProxysql(formats strfmt.Registry) error { if err := o.Proxysql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getServiceOk" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getServiceOk" + "." + "proxysql") + } + 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 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 err := o.External.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getServiceOk" + "." + "external") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Haproxy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getServiceOk" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Mongodb.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getServiceOk" + "." + "mongodb") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Mysql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getServiceOk" + "." + "mysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Postgresql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getServiceOk" + "." + "postgresql") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Proxysql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getServiceOk" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getServiceOk" + "." + "proxysql") } return err } @@ -443,6 +659,11 @@ 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 { @@ -493,6 +714,11 @@ 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 { @@ -555,6 +781,11 @@ 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 { @@ -617,6 +848,11 @@ 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 { @@ -682,6 +918,11 @@ 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 { @@ -744,6 +985,11 @@ 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 { diff --git a/api/inventorypb/json/client/services/list_services_parameters.go b/api/inventorypb/json/client/services/list_services_parameters.go index 23d7a49676..84c4a23344 100644 --- a/api/inventorypb/json/client/services/list_services_parameters.go +++ b/api/inventorypb/json/client/services/list_services_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListServicesParams creates a new ListServicesParams object -// with the default values initialized. +// 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 { - var () return &ListServicesParams{ - timeout: cr.DefaultTimeout, } } // NewListServicesParamsWithTimeout creates a new ListServicesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListServicesParamsWithTimeout(timeout time.Duration) *ListServicesParams { - var () return &ListServicesParams{ - timeout: timeout, } } // NewListServicesParamsWithContext creates a new ListServicesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListServicesParamsWithContext(ctx context.Context) *ListServicesParams { - var () return &ListServicesParams{ - Context: ctx, } } // NewListServicesParamsWithHTTPClient creates a new ListServicesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListServicesParamsWithHTTPClient(client *http.Client) *ListServicesParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body ListServicesBody timeout time.Duration @@ -68,6 +67,21 @@ type ListServicesParams struct { 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() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list services params func (o *ListServicesParams) WithTimeout(timeout time.Duration) *ListServicesParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/services/list_services_responses.go b/api/inventorypb/json/client/services/list_services_responses.go index 1782a9c3ce..1661ec64c5 100644 --- a/api/inventorypb/json/client/services/list_services_responses.go +++ b/api/inventorypb/json/client/services/list_services_responses.go @@ -6,6 +6,7 @@ package services // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListServicesOK() *ListServicesOK { return &ListServicesOK{} } -/*ListServicesOK handles this case with default header values. +/* ListServicesOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListServicesOK struct { func (o *ListServicesOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/List][%d] listServicesOk %+v", 200, o.Payload) } - func (o *ListServicesOK) GetPayload() *ListServicesOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListServicesDefault(code int) *ListServicesDefault { } } -/*ListServicesDefault handles this case with default header values. +/* ListServicesDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListServicesDefault) Code() int { func (o *ListServicesDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/List][%d] ListServices default %+v", o._statusCode, o.Payload) } - func (o *ListServicesDefault) GetPayload() *ListServicesDefaultBody { return o.Payload } @@ -119,109 +118,6 @@ func (o *ListServicesDefault) readResponse(response runtime.ClientResponse, cons return nil } -/*ExternalItems0 ExternalService represents a generic External service instance. -swagger:model ExternalItems0 -*/ -type ExternalItems0 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 external items0 -func (o *ExternalItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ExternalItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ExternalItems0) UnmarshalBinary(b []byte) error { - var res ExternalItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*HaproxyItems0 HAProxyService represents a generic HAProxy service instance. -swagger:model HaproxyItems0 -*/ -type HaproxyItems0 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 haproxy items0 -func (o *HaproxyItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *HaproxyItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *HaproxyItems0) UnmarshalBinary(b []byte) error { - var res HaproxyItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*ListServicesBody list services body swagger:model ListServicesBody */ @@ -230,12 +126,12 @@ type ListServicesBody struct { // Return only Services running on that Node. NodeID string `json:"node_id,omitempty"` + // Return only services in this external group. + ExternalGroup string `json:"external_group,omitempty"` + // ServiceType describes supported Service types. // Enum: [SERVICE_TYPE_INVALID MYSQL_SERVICE MONGODB_SERVICE POSTGRESQL_SERVICE PROXYSQL_SERVICE HAPROXY_SERVICE EXTERNAL_SERVICE] ServiceType *string `json:"service_type,omitempty"` - - // Return only services in this external group. - ExternalGroup string `json:"external_group,omitempty"` } // Validate validates this list services body @@ -297,7 +193,6 @@ func (o *ListServicesBody) validateServiceTypeEnum(path, location string, value } func (o *ListServicesBody) validateServiceType(formats strfmt.Registry) error { - if swag.IsZero(o.ServiceType) { // not required return nil } @@ -310,6 +205,11 @@ func (o *ListServicesBody) validateServiceType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list services body based on context it is used +func (o *ListServicesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ListServicesBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -343,7 +243,7 @@ type ListServicesDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ListServicesDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this list services default body @@ -361,7 +261,6 @@ func (o *ListServicesDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ListServicesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -375,6 +274,42 @@ func (o *ListServicesDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListServices default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -403,28 +338,69 @@ func (o *ListServicesDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ListServicesDefaultBodyDetailsItems0 list services default body details items0 +swagger:model ListServicesDefaultBodyDetailsItems0 +*/ +type ListServicesDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 []*MysqlItems0 `json:"mysql"` + Mysql []*ListServicesOKBodyMysqlItems0 `json:"mysql"` // mongodb - Mongodb []*MongodbItems0 `json:"mongodb"` + Mongodb []*ListServicesOKBodyMongodbItems0 `json:"mongodb"` // postgresql - Postgresql []*PostgresqlItems0 `json:"postgresql"` + Postgresql []*ListServicesOKBodyPostgresqlItems0 `json:"postgresql"` // proxysql - Proxysql []*ProxysqlItems0 `json:"proxysql"` + Proxysql []*ListServicesOKBodyProxysqlItems0 `json:"proxysql"` // haproxy - Haproxy []*HaproxyItems0 `json:"haproxy"` + Haproxy []*ListServicesOKBodyHaproxyItems0 `json:"haproxy"` // external - External []*ExternalItems0 `json:"external"` + External []*ListServicesOKBodyExternalItems0 `json:"external"` } // Validate validates this list services OK body @@ -462,7 +438,6 @@ func (o *ListServicesOKBody) Validate(formats strfmt.Registry) error { } func (o *ListServicesOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required return nil } @@ -476,6 +451,8 @@ func (o *ListServicesOKBody) validateMysql(formats strfmt.Registry) error { if err := o.Mysql[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) } return err } @@ -487,7 +464,6 @@ func (o *ListServicesOKBody) validateMysql(formats strfmt.Registry) error { } func (o *ListServicesOKBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required return nil } @@ -501,6 +477,8 @@ func (o *ListServicesOKBody) validateMongodb(formats strfmt.Registry) error { if err := o.Mongodb[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) } return err } @@ -512,7 +490,6 @@ func (o *ListServicesOKBody) validateMongodb(formats strfmt.Registry) error { } func (o *ListServicesOKBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required return nil } @@ -526,6 +503,8 @@ func (o *ListServicesOKBody) validatePostgresql(formats strfmt.Registry) error { if err := o.Postgresql[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listServicesOk" + "." + "postgresql" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listServicesOk" + "." + "postgresql" + "." + strconv.Itoa(i)) } return err } @@ -537,7 +516,6 @@ func (o *ListServicesOKBody) validatePostgresql(formats strfmt.Registry) error { } func (o *ListServicesOKBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required return nil } @@ -551,6 +529,8 @@ func (o *ListServicesOKBody) validateProxysql(formats strfmt.Registry) error { if err := o.Proxysql[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listServicesOk" + "." + "proxysql" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listServicesOk" + "." + "proxysql" + "." + strconv.Itoa(i)) } return err } @@ -562,7 +542,6 @@ func (o *ListServicesOKBody) validateProxysql(formats strfmt.Registry) error { } func (o *ListServicesOKBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required return nil } @@ -576,6 +555,8 @@ func (o *ListServicesOKBody) validateHaproxy(formats strfmt.Registry) error { if err := o.Haproxy[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listServicesOk" + "." + "haproxy" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listServicesOk" + "." + "haproxy" + "." + strconv.Itoa(i)) } return err } @@ -587,7 +568,6 @@ func (o *ListServicesOKBody) validateHaproxy(formats strfmt.Registry) error { } func (o *ListServicesOKBody) validateExternal(formats strfmt.Registry) error { - if swag.IsZero(o.External) { // not required return nil } @@ -601,6 +581,162 @@ func (o *ListServicesOKBody) validateExternal(formats strfmt.Registry) error { if err := o.External[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listServicesOk" + "." + "external" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listServicesOk" + "." + "external" + "." + 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 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 err := o.Mysql[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Mongodb[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Postgresql[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listServicesOk" + "." + "postgresql" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Proxysql[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listServicesOk" + "." + "proxysql" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Haproxy[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listServicesOk" + "." + "haproxy" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.External[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listServicesOk" + "." + "external" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listServicesOk" + "." + "external" + "." + strconv.Itoa(i)) } return err } @@ -629,10 +765,123 @@ func (o *ListServicesOKBody) UnmarshalBinary(b []byte) error { return nil } -/*MongodbItems0 MongoDBService represents a generic MongoDB instance. -swagger:model MongodbItems0 +/*ListServicesOKBodyExternalItems0 ExternalService represents a generic External service instance. +swagger:model ListServicesOKBodyExternalItems0 */ -type MongodbItems0 struct { +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"` @@ -668,13 +917,18 @@ type MongodbItems0 struct { CustomLabels map[string]string `json:"custom_labels,omitempty"` } -// Validate validates this mongodb items0 -func (o *MongodbItems0) Validate(formats strfmt.Registry) error { +// 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 *MongodbItems0) MarshalBinary() ([]byte, error) { +func (o *ListServicesOKBodyMongodbItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -682,8 +936,8 @@ func (o *MongodbItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *MongodbItems0) UnmarshalBinary(b []byte) error { - var res MongodbItems0 +func (o *ListServicesOKBodyMongodbItems0) UnmarshalBinary(b []byte) error { + var res ListServicesOKBodyMongodbItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -691,10 +945,10 @@ func (o *MongodbItems0) UnmarshalBinary(b []byte) error { return nil } -/*MysqlItems0 MySQLService represents a generic MySQL instance. -swagger:model MysqlItems0 +/*ListServicesOKBodyMysqlItems0 MySQLService represents a generic MySQL instance. +swagger:model ListServicesOKBodyMysqlItems0 */ -type MysqlItems0 struct { +type ListServicesOKBodyMysqlItems0 struct { // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -730,13 +984,18 @@ type MysqlItems0 struct { CustomLabels map[string]string `json:"custom_labels,omitempty"` } -// Validate validates this mysql items0 -func (o *MysqlItems0) Validate(formats strfmt.Registry) error { +// 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 *MysqlItems0) MarshalBinary() ([]byte, error) { +func (o *ListServicesOKBodyMysqlItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -744,8 +1003,8 @@ func (o *MysqlItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *MysqlItems0) UnmarshalBinary(b []byte) error { - var res MysqlItems0 +func (o *ListServicesOKBodyMysqlItems0) UnmarshalBinary(b []byte) error { + var res ListServicesOKBodyMysqlItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -753,10 +1012,10 @@ func (o *MysqlItems0) UnmarshalBinary(b []byte) error { return nil } -/*PostgresqlItems0 PostgreSQLService represents a generic PostgreSQL instance. -swagger:model PostgresqlItems0 +/*ListServicesOKBodyPostgresqlItems0 PostgreSQLService represents a generic PostgreSQL instance. +swagger:model ListServicesOKBodyPostgresqlItems0 */ -type PostgresqlItems0 struct { +type ListServicesOKBodyPostgresqlItems0 struct { // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -795,13 +1054,18 @@ type PostgresqlItems0 struct { CustomLabels map[string]string `json:"custom_labels,omitempty"` } -// Validate validates this postgresql items0 -func (o *PostgresqlItems0) Validate(formats strfmt.Registry) error { +// 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 *PostgresqlItems0) MarshalBinary() ([]byte, error) { +func (o *ListServicesOKBodyPostgresqlItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -809,8 +1073,8 @@ func (o *PostgresqlItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PostgresqlItems0) UnmarshalBinary(b []byte) error { - var res PostgresqlItems0 +func (o *ListServicesOKBodyPostgresqlItems0) UnmarshalBinary(b []byte) error { + var res ListServicesOKBodyPostgresqlItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -818,10 +1082,10 @@ func (o *PostgresqlItems0) UnmarshalBinary(b []byte) error { return nil } -/*ProxysqlItems0 ProxySQLService represents a generic ProxySQL instance. -swagger:model ProxysqlItems0 +/*ListServicesOKBodyProxysqlItems0 ProxySQLService represents a generic ProxySQL instance. +swagger:model ListServicesOKBodyProxysqlItems0 */ -type ProxysqlItems0 struct { +type ListServicesOKBodyProxysqlItems0 struct { // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -857,13 +1121,18 @@ type ProxysqlItems0 struct { CustomLabels map[string]string `json:"custom_labels,omitempty"` } -// Validate validates this proxysql items0 -func (o *ProxysqlItems0) Validate(formats strfmt.Registry) error { +// 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 *ProxysqlItems0) MarshalBinary() ([]byte, error) { +func (o *ListServicesOKBodyProxysqlItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -871,8 +1140,8 @@ func (o *ProxysqlItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ProxysqlItems0) UnmarshalBinary(b []byte) error { - var res ProxysqlItems0 +func (o *ListServicesOKBodyProxysqlItems0) UnmarshalBinary(b []byte) error { + var res ListServicesOKBodyProxysqlItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/inventorypb/json/client/services/remove_service_parameters.go b/api/inventorypb/json/client/services/remove_service_parameters.go index c51a4edfcd..41c79e16ef 100644 --- a/api/inventorypb/json/client/services/remove_service_parameters.go +++ b/api/inventorypb/json/client/services/remove_service_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRemoveServiceParams creates a new RemoveServiceParams object -// with the default values initialized. +// 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 { - var () return &RemoveServiceParams{ - timeout: cr.DefaultTimeout, } } // NewRemoveServiceParamsWithTimeout creates a new RemoveServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRemoveServiceParamsWithTimeout(timeout time.Duration) *RemoveServiceParams { - var () return &RemoveServiceParams{ - timeout: timeout, } } // NewRemoveServiceParamsWithContext creates a new RemoveServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRemoveServiceParamsWithContext(ctx context.Context) *RemoveServiceParams { - var () return &RemoveServiceParams{ - Context: ctx, } } // NewRemoveServiceParamsWithHTTPClient creates a new RemoveServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRemoveServiceParamsWithHTTPClient(client *http.Client) *RemoveServiceParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body RemoveServiceBody timeout time.Duration @@ -68,6 +67,21 @@ type RemoveServiceParams struct { 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) @@ -119,7 +133,6 @@ func (o *RemoveServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/inventorypb/json/client/services/remove_service_responses.go b/api/inventorypb/json/client/services/remove_service_responses.go index 1a9da392f7..5190971948 100644 --- a/api/inventorypb/json/client/services/remove_service_responses.go +++ b/api/inventorypb/json/client/services/remove_service_responses.go @@ -6,6 +6,7 @@ package services // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewRemoveServiceOK() *RemoveServiceOK { return &RemoveServiceOK{} } -/*RemoveServiceOK handles this case with default header values. +/* RemoveServiceOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type RemoveServiceOK struct { func (o *RemoveServiceOK) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/Remove][%d] removeServiceOk %+v", 200, o.Payload) } - func (o *RemoveServiceOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewRemoveServiceDefault(code int) *RemoveServiceDefault { } } -/*RemoveServiceDefault handles this case with default header values. +/* RemoveServiceDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *RemoveServiceDefault) Code() int { func (o *RemoveServiceDefault) Error() string { return fmt.Sprintf("[POST /v1/inventory/Services/Remove][%d] RemoveService default %+v", o._statusCode, o.Payload) } - func (o *RemoveServiceDefault) GetPayload() *RemoveServiceDefaultBody { return o.Payload } @@ -132,6 +131,11 @@ func (o *RemoveServiceBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this remove service body based on context it is used +func (o *RemoveServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *RemoveServiceBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -165,7 +169,7 @@ type RemoveServiceDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RemoveServiceDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this remove service default body @@ -183,7 +187,6 @@ func (o *RemoveServiceDefaultBody) Validate(formats strfmt.Registry) error { } func (o *RemoveServiceDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -197,6 +200,42 @@ func (o *RemoveServiceDefaultBody) validateDetails(formats strfmt.Registry) erro if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,3 +263,44 @@ func (o *RemoveServiceDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*RemoveServiceDefaultBodyDetailsItems0 remove service default body details items0 +swagger:model RemoveServiceDefaultBodyDetailsItems0 +*/ +type RemoveServiceDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/inventorypb/json/client/services/services_client.go b/api/inventorypb/json/client/services/services_client.go index f9a81b88e1..01ec89cf1d 100644 --- a/api/inventorypb/json/client/services/services_client.go +++ b/api/inventorypb/json/client/services/services_client.go @@ -23,25 +23,28 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddExternalService(params *AddExternalServiceParams) (*AddExternalServiceOK, error) + AddExternalService(params *AddExternalServiceParams, opts ...ClientOption) (*AddExternalServiceOK, error) - AddHAProxyService(params *AddHAProxyServiceParams) (*AddHAProxyServiceOK, error) + AddHAProxyService(params *AddHAProxyServiceParams, opts ...ClientOption) (*AddHAProxyServiceOK, error) - AddMongoDBService(params *AddMongoDBServiceParams) (*AddMongoDBServiceOK, error) + AddMongoDBService(params *AddMongoDBServiceParams, opts ...ClientOption) (*AddMongoDBServiceOK, error) - AddMySQLService(params *AddMySQLServiceParams) (*AddMySQLServiceOK, error) + AddMySQLService(params *AddMySQLServiceParams, opts ...ClientOption) (*AddMySQLServiceOK, error) - AddPostgreSQLService(params *AddPostgreSQLServiceParams) (*AddPostgreSQLServiceOK, error) + AddPostgreSQLService(params *AddPostgreSQLServiceParams, opts ...ClientOption) (*AddPostgreSQLServiceOK, error) - AddProxySQLService(params *AddProxySQLServiceParams) (*AddProxySQLServiceOK, error) + AddProxySQLService(params *AddProxySQLServiceParams, opts ...ClientOption) (*AddProxySQLServiceOK, error) - GetService(params *GetServiceParams) (*GetServiceOK, error) + GetService(params *GetServiceParams, opts ...ClientOption) (*GetServiceOK, error) - ListServices(params *ListServicesParams) (*ListServicesOK, error) + ListServices(params *ListServicesParams, opts ...ClientOption) (*ListServicesOK, error) - RemoveService(params *RemoveServiceParams) (*RemoveServiceOK, error) + RemoveService(params *RemoveServiceParams, opts ...ClientOption) (*RemoveServiceOK, error) SetTransport(transport runtime.ClientTransport) } @@ -51,13 +54,12 @@ type ClientService interface { Adds External Service. */ -func (a *Client) AddExternalService(params *AddExternalServiceParams) (*AddExternalServiceOK, error) { +func (a *Client) AddExternalService(params *AddExternalServiceParams, opts ...ClientOption) (*AddExternalServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddExternalServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddExternalService", Method: "POST", PathPattern: "/v1/inventory/Services/AddExternalService", @@ -68,7 +70,12 @@ func (a *Client) AddExternalService(params *AddExternalServiceParams) (*AddExter Reader: &AddExternalServiceReader{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 } @@ -86,13 +93,12 @@ func (a *Client) AddExternalService(params *AddExternalServiceParams) (*AddExter Adds HAProxy Service. */ -func (a *Client) AddHAProxyService(params *AddHAProxyServiceParams) (*AddHAProxyServiceOK, error) { +func (a *Client) AddHAProxyService(params *AddHAProxyServiceParams, opts ...ClientOption) (*AddHAProxyServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddHAProxyServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddHAProxyService", Method: "POST", PathPattern: "/v1/inventory/Services/AddHAProxyService", @@ -103,7 +109,12 @@ func (a *Client) AddHAProxyService(params *AddHAProxyServiceParams) (*AddHAProxy Reader: &AddHAProxyServiceReader{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 } @@ -121,13 +132,12 @@ func (a *Client) AddHAProxyService(params *AddHAProxyServiceParams) (*AddHAProxy Adds MongoDB Service. */ -func (a *Client) AddMongoDBService(params *AddMongoDBServiceParams) (*AddMongoDBServiceOK, error) { +func (a *Client) AddMongoDBService(params *AddMongoDBServiceParams, opts ...ClientOption) (*AddMongoDBServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddMongoDBServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddMongoDBService", Method: "POST", PathPattern: "/v1/inventory/Services/AddMongoDB", @@ -138,7 +148,12 @@ func (a *Client) AddMongoDBService(params *AddMongoDBServiceParams) (*AddMongoDB Reader: &AddMongoDBServiceReader{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 } @@ -156,13 +171,12 @@ func (a *Client) AddMongoDBService(params *AddMongoDBServiceParams) (*AddMongoDB Adds MySQL Service. */ -func (a *Client) AddMySQLService(params *AddMySQLServiceParams) (*AddMySQLServiceOK, error) { +func (a *Client) AddMySQLService(params *AddMySQLServiceParams, opts ...ClientOption) (*AddMySQLServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddMySQLServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddMySQLService", Method: "POST", PathPattern: "/v1/inventory/Services/AddMySQL", @@ -173,7 +187,12 @@ func (a *Client) AddMySQLService(params *AddMySQLServiceParams) (*AddMySQLServic Reader: &AddMySQLServiceReader{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 } @@ -191,13 +210,12 @@ func (a *Client) AddMySQLService(params *AddMySQLServiceParams) (*AddMySQLServic Adds PostgreSQL Service. */ -func (a *Client) AddPostgreSQLService(params *AddPostgreSQLServiceParams) (*AddPostgreSQLServiceOK, error) { +func (a *Client) AddPostgreSQLService(params *AddPostgreSQLServiceParams, opts ...ClientOption) (*AddPostgreSQLServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddPostgreSQLServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddPostgreSQLService", Method: "POST", PathPattern: "/v1/inventory/Services/AddPostgreSQL", @@ -208,7 +226,12 @@ func (a *Client) AddPostgreSQLService(params *AddPostgreSQLServiceParams) (*AddP Reader: &AddPostgreSQLServiceReader{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 } @@ -226,13 +249,12 @@ func (a *Client) AddPostgreSQLService(params *AddPostgreSQLServiceParams) (*AddP Adds ProxySQL Service. */ -func (a *Client) AddProxySQLService(params *AddProxySQLServiceParams) (*AddProxySQLServiceOK, error) { +func (a *Client) AddProxySQLService(params *AddProxySQLServiceParams, opts ...ClientOption) (*AddProxySQLServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddProxySQLServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddProxySQLService", Method: "POST", PathPattern: "/v1/inventory/Services/AddProxySQL", @@ -243,7 +265,12 @@ func (a *Client) AddProxySQLService(params *AddProxySQLServiceParams) (*AddProxy Reader: &AddProxySQLServiceReader{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 } @@ -261,13 +288,12 @@ func (a *Client) AddProxySQLService(params *AddProxySQLServiceParams) (*AddProxy Returns a single Service by ID. */ -func (a *Client) GetService(params *GetServiceParams) (*GetServiceOK, error) { +func (a *Client) GetService(params *GetServiceParams, opts ...ClientOption) (*GetServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetService", Method: "POST", PathPattern: "/v1/inventory/Services/Get", @@ -278,7 +304,12 @@ func (a *Client) GetService(params *GetServiceParams) (*GetServiceOK, error) { 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 } @@ -296,13 +327,12 @@ func (a *Client) GetService(params *GetServiceParams) (*GetServiceOK, error) { Returns a list of Services filtered by type. */ -func (a *Client) ListServices(params *ListServicesParams) (*ListServicesOK, error) { +func (a *Client) ListServices(params *ListServicesParams, opts ...ClientOption) (*ListServicesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListServicesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListServices", Method: "POST", PathPattern: "/v1/inventory/Services/List", @@ -313,7 +343,12 @@ func (a *Client) ListServices(params *ListServicesParams) (*ListServicesOK, erro 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 } @@ -331,13 +366,12 @@ func (a *Client) ListServices(params *ListServicesParams) (*ListServicesOK, erro Removes Service. */ -func (a *Client) RemoveService(params *RemoveServiceParams) (*RemoveServiceOK, error) { +func (a *Client) RemoveService(params *RemoveServiceParams, opts ...ClientOption) (*RemoveServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRemoveServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RemoveService", Method: "POST", PathPattern: "/v1/inventory/Services/Remove", @@ -348,7 +382,12 @@ func (a *Client) RemoveService(params *RemoveServiceParams) (*RemoveServiceOK, e 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 } diff --git a/api/inventorypb/json/inventorypb.json b/api/inventorypb/json/inventorypb.json index a61509b5f3..e0ab0ae6d3 100644 --- a/api/inventorypb/json/inventorypb.json +++ b/api/inventorypb/json/inventorypb.json @@ -164,11 +164,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 7 + ] } - }, - "x-order": 0 + } } } } @@ -348,8 +346,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -604,8 +601,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -622,8 +618,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -841,8 +836,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 14 + ] }, "tablestats_group_disabled": { "description": "True if tablestats group collectors are currently disabled.", @@ -885,8 +879,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } }, "table_count": { "description": "Actual table count at the moment of adding.", @@ -1049,11 +1042,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 6 + ] } - }, - "x-order": 0 + } } } } @@ -1166,8 +1157,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 0 + } } } } @@ -1379,8 +1369,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -1397,8 +1386,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -1595,8 +1583,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -1613,8 +1600,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -1799,8 +1785,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -1817,8 +1802,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -2003,8 +1987,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 12 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -2036,8 +2019,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -2234,8 +2216,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 13 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -2267,8 +2248,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -2453,8 +2433,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 9 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -2471,8 +2450,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -2647,8 +2625,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -2665,8 +2642,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -2857,11 +2833,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 6 + ] } - }, - "x-order": 0 + } } } } @@ -2965,8 +2939,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -3043,11 +3016,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 7 + ] } - }, - "x-order": 0 + } } } } @@ -3151,8 +3122,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -3222,8 +3192,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -3327,8 +3296,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -3422,8 +3390,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -3440,8 +3407,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -3545,8 +3511,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -3621,8 +3586,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 14 + ] }, "tablestats_group_disabled": { "description": "True if tablestats group collectors are currently disabled.", @@ -3665,8 +3629,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -3770,8 +3733,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -3841,11 +3803,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 6 + ] } - }, - "x-order": 0 + } } } } @@ -3949,8 +3909,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -4025,8 +3984,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -4043,8 +4001,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -4148,8 +4105,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -4224,8 +4180,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -4242,8 +4197,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -4347,8 +4301,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -4404,8 +4357,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -4422,8 +4374,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -4527,8 +4478,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -4589,8 +4539,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 12 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -4622,8 +4571,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -4727,8 +4675,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -4795,8 +4742,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 13 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -4828,8 +4774,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -4933,8 +4878,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -4995,8 +4939,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 9 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -5013,8 +4956,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -5118,8 +5060,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -5175,8 +5116,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -5193,8 +5133,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -5298,8 +5237,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 1 + } } } } @@ -5381,11 +5319,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 6 + ] } - }, - "x-order": 0 + } } } } @@ -5528,11 +5464,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 7 + ] } - }, - "x-order": 14 + } }, "external_exporter": { "description": "ExternalExporter runs on any Node type, including Remote Node.", @@ -5592,8 +5526,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 13 + } }, "mongodb_exporter": { "description": "MongoDBExporter runs on Generic or Container Node and exposes MongoDB Service metrics.", @@ -5677,8 +5610,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -5695,8 +5627,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 4 + } }, "mysqld_exporter": { "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", @@ -5761,8 +5692,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 14 + ] }, "tablestats_group_disabled": { "description": "True if tablestats group collectors are currently disabled.", @@ -5805,8 +5735,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 3 + } }, "node_exporter": { "description": "NodeExporter runs on Generic or Container Node and exposes its metrics.", @@ -5866,11 +5795,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 6 + ] } - }, - "x-order": 2 + } }, "pmm_agent": { "description": "PMMAgent runs on Generic or Container Node.", @@ -5899,8 +5826,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 0 + } }, "postgres_exporter": { "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics.", @@ -5965,8 +5891,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -5983,8 +5908,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 5 + } }, "proxysql_exporter": { "description": "ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics.", @@ -6049,8 +5973,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -6067,8 +5990,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 6 + } }, "qan_mongodb_profiler_agent": { "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server.", @@ -6114,8 +6036,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -6132,8 +6053,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 9 + } }, "qan_mysql_perfschema_agent": { "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", @@ -6184,8 +6104,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 12 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -6217,8 +6136,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 7 + } }, "qan_mysql_slowlog_agent": { "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", @@ -6275,8 +6193,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 13 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -6308,8 +6225,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 8 + } }, "qan_postgresql_pgstatements_agent": { "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", @@ -6355,8 +6271,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -6373,8 +6288,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 10 + } }, "qan_postgresql_pgstatmonitor_agent": { "description": "QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", @@ -6425,8 +6339,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 9 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -6443,8 +6356,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 11 + } }, "rds_exporter": { "description": "RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics.", @@ -6516,11 +6428,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 6 + ] } - }, - "x-order": 12 + } }, "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.", @@ -6548,11 +6458,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 2 + ] } - }, - "x-order": 1 + } } } } @@ -6636,8 +6544,7 @@ "RDS_EXPORTER", "EXTERNAL_EXPORTER", "AZURE_DATABASE_EXPORTER" - ], - "x-order": 3 + ] }, "node_id": { "description": "Return only Agents that provide insights for that Node.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", @@ -6731,8 +6638,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 7 + ] } } }, @@ -6886,8 +6792,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -6973,8 +6878,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 14 + ] }, "tablestats_group_disabled": { "description": "True if tablestats group collectors are currently disabled.", @@ -7081,8 +6985,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 6 + ] } } }, @@ -7186,8 +7089,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -7273,8 +7175,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -7341,8 +7242,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -7414,8 +7314,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 12 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -7508,8 +7407,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 13 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -7591,8 +7489,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -7664,8 +7561,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 9 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -7758,8 +7654,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 6 + ] } } }, @@ -7793,8 +7688,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 2 + ] } } }, @@ -8054,8 +7948,7 @@ "type": "string", "x-order": 7 } - }, - "x-order": 0 + } } } } @@ -8223,8 +8116,7 @@ "type": "string", "x-order": 6 } - }, - "x-order": 0 + } } } } @@ -8372,8 +8264,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -8521,8 +8412,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -8670,8 +8560,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } } } } @@ -8806,8 +8695,7 @@ "type": "string", "x-order": 7 } - }, - "x-order": 1 + } }, "generic": { "description": "GenericNode represents a bare metal server or virtual machine.", @@ -8861,8 +8749,7 @@ "type": "string", "x-order": 6 } - }, - "x-order": 0 + } }, "remote": { "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", @@ -8906,8 +8793,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 2 + } }, "remote_azure_database": { "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", @@ -8951,8 +8837,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 4 + } }, "remote_rds": { "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", @@ -8996,8 +8881,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 3 + } } } } @@ -9071,8 +8955,7 @@ "REMOTE_NODE", "REMOTE_RDS_NODE", "REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 + ] } } } @@ -9584,8 +9467,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 0 + } } } } @@ -9733,8 +9615,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 0 + } } } } @@ -9914,8 +9795,7 @@ "type": "string", "x-order": 5 } - }, - "x-order": 0 + } } } } @@ -10095,8 +9975,7 @@ "type": "string", "x-order": 5 } - }, - "x-order": 0 + } } } } @@ -10281,8 +10160,7 @@ "type": "string", "x-order": 6 } - }, - "x-order": 0 + } } } } @@ -10462,8 +10340,7 @@ "type": "string", "x-order": 5 } - }, - "x-order": 0 + } } } } @@ -10588,8 +10465,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 5 + } }, "haproxy": { "description": "HAProxyService represents a generic HAProxy service instance.", @@ -10633,8 +10509,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 4 + } }, "mongodb": { "description": "MongoDBService represents a generic MongoDB instance.", @@ -10694,8 +10569,7 @@ "type": "string", "x-order": 5 } - }, - "x-order": 1 + } }, "mysql": { "description": "MySQLService represents a generic MySQL instance.", @@ -10755,8 +10629,7 @@ "type": "string", "x-order": 5 } - }, - "x-order": 0 + } }, "postgresql": { "description": "PostgreSQLService represents a generic PostgreSQL instance.", @@ -10821,8 +10694,7 @@ "type": "string", "x-order": 6 } - }, - "x-order": 2 + } }, "proxysql": { "description": "ProxySQLService represents a generic ProxySQL instance.", @@ -10882,8 +10754,7 @@ "type": "string", "x-order": 5 } - }, - "x-order": 3 + } } } } @@ -10968,8 +10839,7 @@ "PROXYSQL_SERVICE", "HAPROXY_SERVICE", "EXTERNAL_SERVICE" - ], - "x-order": 1 + ] } } } diff --git a/api/inventorypb/nodes.pb.go b/api/inventorypb/nodes.pb.go index 965cc72fd9..ce5ded6909 100644 --- a/api/inventorypb/nodes.pb.go +++ b/api/inventorypb/nodes.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: inventorypb/nodes.proto diff --git a/api/inventorypb/services.pb.go b/api/inventorypb/services.pb.go index 70a6fbf83a..61b4ca931f 100644 --- a/api/inventorypb/services.pb.go +++ b/api/inventorypb/services.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: inventorypb/services.proto diff --git a/api/managementpb/actions.pb.go b/api/managementpb/actions.pb.go index af445fbab1..2a9aaa1317 100644 --- a/api/managementpb/actions.pb.go +++ b/api/managementpb/actions.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/actions.proto diff --git a/api/managementpb/annotation.pb.go b/api/managementpb/annotation.pb.go index db5b6b71f7..c389c34ff4 100644 --- a/api/managementpb/annotation.pb.go +++ b/api/managementpb/annotation.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/annotation.proto diff --git a/api/managementpb/azure/azure.pb.go b/api/managementpb/azure/azure.pb.go index b2cc79d489..9348892849 100644 --- a/api/managementpb/azure/azure.pb.go +++ b/api/managementpb/azure/azure.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/azure/azure.proto diff --git a/api/managementpb/azure/json/client/azure_database/add_azure_database_parameters.go b/api/managementpb/azure/json/client/azure_database/add_azure_database_parameters.go index 2ed061b214..d91c5e5fe9 100644 --- a/api/managementpb/azure/json/client/azure_database/add_azure_database_parameters.go +++ b/api/managementpb/azure/json/client/azure_database/add_azure_database_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddAzureDatabaseParams creates a new AddAzureDatabaseParams object -// with the default values initialized. +// 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 { - var () return &AddAzureDatabaseParams{ - timeout: cr.DefaultTimeout, } } // NewAddAzureDatabaseParamsWithTimeout creates a new AddAzureDatabaseParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddAzureDatabaseParamsWithTimeout(timeout time.Duration) *AddAzureDatabaseParams { - var () return &AddAzureDatabaseParams{ - timeout: timeout, } } // NewAddAzureDatabaseParamsWithContext creates a new AddAzureDatabaseParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddAzureDatabaseParamsWithContext(ctx context.Context) *AddAzureDatabaseParams { - var () return &AddAzureDatabaseParams{ - Context: ctx, } } // NewAddAzureDatabaseParamsWithHTTPClient creates a new AddAzureDatabaseParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddAzureDatabaseParamsWithHTTPClient(client *http.Client) *AddAzureDatabaseParams { - var () 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 +/* 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. Body AddAzureDatabaseBody timeout time.Duration @@ -68,6 +67,21 @@ type AddAzureDatabaseParams struct { 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) @@ -119,7 +133,6 @@ func (o *AddAzureDatabaseParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/azure/json/client/azure_database/add_azure_database_responses.go b/api/managementpb/azure/json/client/azure_database/add_azure_database_responses.go index 5991850490..92928a437f 100644 --- a/api/managementpb/azure/json/client/azure_database/add_azure_database_responses.go +++ b/api/managementpb/azure/json/client/azure_database/add_azure_database_responses.go @@ -6,6 +6,7 @@ package azure_database // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddAzureDatabaseOK() *AddAzureDatabaseOK { return &AddAzureDatabaseOK{} } -/*AddAzureDatabaseOK handles this case with default header values. +/* AddAzureDatabaseOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddAzureDatabaseOK struct { func (o *AddAzureDatabaseOK) Error() string { return fmt.Sprintf("[POST /v1/management/azure/AzureDatabase/Add][%d] addAzureDatabaseOk %+v", 200, o.Payload) } - func (o *AddAzureDatabaseOK) GetPayload() interface{} { return o.Payload } @@ -82,7 +82,7 @@ func NewAddAzureDatabaseDefault(code int) *AddAzureDatabaseDefault { } } -/*AddAzureDatabaseDefault handles this case with default header values. +/* AddAzureDatabaseDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddAzureDatabaseDefault) Code() int { func (o *AddAzureDatabaseDefault) Error() string { return fmt.Sprintf("[POST /v1/management/azure/AzureDatabase/Add][%d] AddAzureDatabase default %+v", o._statusCode, o.Payload) } - func (o *AddAzureDatabaseDefault) GetPayload() *AddAzureDatabaseDefaultBody { return o.Payload } @@ -252,7 +251,6 @@ func (o *AddAzureDatabaseBody) validateTypeEnum(path, location string, value str } func (o *AddAzureDatabaseBody) validateType(formats strfmt.Registry) error { - if swag.IsZero(o.Type) { // not required return nil } @@ -265,6 +263,11 @@ func (o *AddAzureDatabaseBody) validateType(formats strfmt.Registry) error { 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 { @@ -298,7 +301,7 @@ type AddAzureDatabaseDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddAzureDatabaseDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add azure database default body @@ -316,7 +319,6 @@ func (o *AddAzureDatabaseDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddAzureDatabaseDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -330,6 +332,42 @@ func (o *AddAzureDatabaseDefaultBody) validateDetails(formats strfmt.Registry) e if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -358,10 +396,10 @@ func (o *AddAzureDatabaseDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*AddAzureDatabaseDefaultBodyDetailsItems0 add azure database default body details items0 +swagger:model AddAzureDatabaseDefaultBodyDetailsItems0 */ -type DetailsItems0 struct { +type AddAzureDatabaseDefaultBodyDetailsItems0 struct { // type url TypeURL string `json:"type_url,omitempty"` @@ -371,13 +409,18 @@ type DetailsItems0 struct { Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// 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 *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddAzureDatabaseDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -385,8 +428,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddAzureDatabaseDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddAzureDatabaseDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/azure/json/client/azure_database/azure_database_client.go b/api/managementpb/azure/json/client/azure_database/azure_database_client.go index 3da42197b7..19f55b208f 100644 --- a/api/managementpb/azure/json/client/azure_database/azure_database_client.go +++ b/api/managementpb/azure/json/client/azure_database/azure_database_client.go @@ -23,11 +23,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddAzureDatabase(params *AddAzureDatabaseParams) (*AddAzureDatabaseOK, error) + AddAzureDatabase(params *AddAzureDatabaseParams, opts ...ClientOption) (*AddAzureDatabaseOK, error) - DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams) (*DiscoverAzureDatabaseOK, error) + DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams, opts ...ClientOption) (*DiscoverAzureDatabaseOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { /* AddAzureDatabase adds azure database adds azure database instance */ -func (a *Client) AddAzureDatabase(params *AddAzureDatabaseParams) (*AddAzureDatabaseOK, error) { +func (a *Client) AddAzureDatabase(params *AddAzureDatabaseParams, opts ...ClientOption) (*AddAzureDatabaseOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddAzureDatabaseParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddAzureDatabase", Method: "POST", PathPattern: "/v1/management/azure/AzureDatabase/Add", @@ -52,7 +54,12 @@ func (a *Client) AddAzureDatabase(params *AddAzureDatabaseParams) (*AddAzureData 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 } @@ -68,13 +75,12 @@ func (a *Client) AddAzureDatabase(params *AddAzureDatabaseParams) (*AddAzureData /* DiscoverAzureDatabase discovers azure database discovers azure database for my SQL maria DB and postgre SQL server instances */ -func (a *Client) DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams) (*DiscoverAzureDatabaseOK, error) { +func (a *Client) DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams, opts ...ClientOption) (*DiscoverAzureDatabaseOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDiscoverAzureDatabaseParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "DiscoverAzureDatabase", Method: "POST", PathPattern: "/v1/management/azure/AzureDatabase/Discover", @@ -85,7 +91,12 @@ func (a *Client) DiscoverAzureDatabase(params *DiscoverAzureDatabaseParams) (*Di 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 } diff --git a/api/managementpb/azure/json/client/azure_database/discover_azure_database_parameters.go b/api/managementpb/azure/json/client/azure_database/discover_azure_database_parameters.go index 1895c2316f..191ea477ef 100644 --- a/api/managementpb/azure/json/client/azure_database/discover_azure_database_parameters.go +++ b/api/managementpb/azure/json/client/azure_database/discover_azure_database_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDiscoverAzureDatabaseParams creates a new DiscoverAzureDatabaseParams object -// with the default values initialized. +// 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 { - var () return &DiscoverAzureDatabaseParams{ - timeout: cr.DefaultTimeout, } } // NewDiscoverAzureDatabaseParamsWithTimeout creates a new DiscoverAzureDatabaseParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDiscoverAzureDatabaseParamsWithTimeout(timeout time.Duration) *DiscoverAzureDatabaseParams { - var () return &DiscoverAzureDatabaseParams{ - timeout: timeout, } } // NewDiscoverAzureDatabaseParamsWithContext creates a new DiscoverAzureDatabaseParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDiscoverAzureDatabaseParamsWithContext(ctx context.Context) *DiscoverAzureDatabaseParams { - var () return &DiscoverAzureDatabaseParams{ - Context: ctx, } } // NewDiscoverAzureDatabaseParamsWithHTTPClient creates a new DiscoverAzureDatabaseParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDiscoverAzureDatabaseParamsWithHTTPClient(client *http.Client) *DiscoverAzureDatabaseParams { - var () 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 +/* 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*/ + // Body. Body DiscoverAzureDatabaseBody timeout time.Duration @@ -68,6 +67,21 @@ type DiscoverAzureDatabaseParams struct { 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) @@ -119,7 +133,6 @@ func (o *DiscoverAzureDatabaseParams) WriteToRequest(r runtime.ClientRequest, re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/azure/json/client/azure_database/discover_azure_database_responses.go b/api/managementpb/azure/json/client/azure_database/discover_azure_database_responses.go index f57b41f60a..76b18b2b47 100644 --- a/api/managementpb/azure/json/client/azure_database/discover_azure_database_responses.go +++ b/api/managementpb/azure/json/client/azure_database/discover_azure_database_responses.go @@ -6,6 +6,7 @@ package azure_database // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewDiscoverAzureDatabaseOK() *DiscoverAzureDatabaseOK { return &DiscoverAzureDatabaseOK{} } -/*DiscoverAzureDatabaseOK handles this case with default header values. +/* DiscoverAzureDatabaseOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type DiscoverAzureDatabaseOK struct { func (o *DiscoverAzureDatabaseOK) Error() string { return fmt.Sprintf("[POST /v1/management/azure/AzureDatabase/Discover][%d] discoverAzureDatabaseOk %+v", 200, o.Payload) } - func (o *DiscoverAzureDatabaseOK) GetPayload() *DiscoverAzureDatabaseOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewDiscoverAzureDatabaseDefault(code int) *DiscoverAzureDatabaseDefault { } } -/*DiscoverAzureDatabaseDefault handles this case with default header values. +/* DiscoverAzureDatabaseDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *DiscoverAzureDatabaseDefault) Code() int { func (o *DiscoverAzureDatabaseDefault) Error() string { return fmt.Sprintf("[POST /v1/management/azure/AzureDatabase/Discover][%d] DiscoverAzureDatabase default %+v", o._statusCode, o.Payload) } - func (o *DiscoverAzureDatabaseDefault) GetPayload() *DiscoverAzureDatabaseDefaultBody { return o.Payload } @@ -119,125 +118,6 @@ func (o *DiscoverAzureDatabaseDefault) readResponse(response runtime.ClientRespo return nil } -/*AzureDatabaseInstanceItems0 DiscoverAzureDatabaseInstance models an unique Azure Database instance for the list of instances returned by Discovery. -swagger:model AzureDatabaseInstanceItems0 -*/ -type AzureDatabaseInstanceItems0 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_INVALID 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 azure database instance items0 -func (o *AzureDatabaseInstanceItems0) 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 azureDatabaseInstanceItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DISCOVER_AZURE_DATABASE_TYPE_INVALID","DISCOVER_AZURE_DATABASE_TYPE_MYSQL","DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - azureDatabaseInstanceItems0TypeTypePropEnum = append(azureDatabaseInstanceItems0TypeTypePropEnum, v) - } -} - -const ( - - // AzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEINVALID captures enum value "DISCOVER_AZURE_DATABASE_TYPE_INVALID" - AzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEINVALID string = "DISCOVER_AZURE_DATABASE_TYPE_INVALID" - - // AzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEMYSQL captures enum value "DISCOVER_AZURE_DATABASE_TYPE_MYSQL" - AzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEMYSQL string = "DISCOVER_AZURE_DATABASE_TYPE_MYSQL" - - // AzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEPOSTGRESQL captures enum value "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" - AzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEPOSTGRESQL string = "DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL" -) - -// prop value enum -func (o *AzureDatabaseInstanceItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, azureDatabaseInstanceItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AzureDatabaseInstanceItems0) 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 -} - -// MarshalBinary interface implementation -func (o *AzureDatabaseInstanceItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AzureDatabaseInstanceItems0) UnmarshalBinary(b []byte) error { - var res AzureDatabaseInstanceItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*DiscoverAzureDatabaseBody DiscoverAzureDatabaseRequest discover azure databases request. swagger:model DiscoverAzureDatabaseBody */ @@ -261,6 +141,11 @@ 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 { @@ -294,7 +179,7 @@ type DiscoverAzureDatabaseDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*DiscoverAzureDatabaseDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this discover azure database default body @@ -312,7 +197,6 @@ func (o *DiscoverAzureDatabaseDefaultBody) Validate(formats strfmt.Registry) err } func (o *DiscoverAzureDatabaseDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -326,6 +210,42 @@ func (o *DiscoverAzureDatabaseDefaultBody) validateDetails(formats strfmt.Regist if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("DiscoverAzureDatabase default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -354,13 +274,54 @@ func (o *DiscoverAzureDatabaseDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*DiscoverAzureDatabaseDefaultBodyDetailsItems0 discover azure database default body details items0 +swagger:model DiscoverAzureDatabaseDefaultBodyDetailsItems0 +*/ +type DiscoverAzureDatabaseDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 []*AzureDatabaseInstanceItems0 `json:"azure_database_instance"` + AzureDatabaseInstance []*DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0 `json:"azure_database_instance"` } // Validate validates this discover azure database OK body @@ -378,7 +339,6 @@ func (o *DiscoverAzureDatabaseOKBody) Validate(formats strfmt.Registry) error { } func (o *DiscoverAzureDatabaseOKBody) validateAzureDatabaseInstance(formats strfmt.Registry) error { - if swag.IsZero(o.AzureDatabaseInstance) { // not required return nil } @@ -392,6 +352,42 @@ func (o *DiscoverAzureDatabaseOKBody) validateAzureDatabaseInstance(formats strf if err := o.AzureDatabaseInstance[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.AzureDatabaseInstance[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("discoverAzureDatabaseOk" + "." + "azure_database_instance" + "." + strconv.Itoa(i)) } return err } @@ -419,3 +415,126 @@ func (o *DiscoverAzureDatabaseOKBody) UnmarshalBinary(b []byte) error { *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_INVALID 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 []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DISCOVER_AZURE_DATABASE_TYPE_INVALID","DISCOVER_AZURE_DATABASE_TYPE_MYSQL","DISCOVER_AZURE_DATABASE_TYPE_POSTGRESQL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + discoverAzureDatabaseOkBodyAzureDatabaseInstanceItems0TypeTypePropEnum = append(discoverAzureDatabaseOkBodyAzureDatabaseInstanceItems0TypeTypePropEnum, v) + } +} + +const ( + + // DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEINVALID captures enum value "DISCOVER_AZURE_DATABASE_TYPE_INVALID" + DiscoverAzureDatabaseOKBodyAzureDatabaseInstanceItems0TypeDISCOVERAZUREDATABASETYPEINVALID string = "DISCOVER_AZURE_DATABASE_TYPE_INVALID" + + // 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/managementpb/azure/json/client/pmm_d_baa_s_client.go b/api/managementpb/azure/json/client/pmm_d_baa_s_api_client.go similarity index 85% rename from api/managementpb/azure/json/client/pmm_d_baa_s_client.go rename to api/managementpb/azure/json/client/pmm_d_baa_s_api_client.go index 7e04305e46..f245309618 100644 --- a/api/managementpb/azure/json/client/pmm_d_baa_s_client.go +++ b/api/managementpb/azure/json/client/pmm_d_baa_s_api_client.go @@ -13,7 +13,7 @@ import ( "github.com/percona/pmm/api/managementpb/azure/json/client/azure_database" ) -// Default PMM d baa s HTTP client. +// Default PMM d baa s API HTTP client. var Default = NewHTTPClient(nil) const ( @@ -28,14 +28,14 @@ const ( // DefaultSchemes are the default schemes found in Meta (info) section of spec file var DefaultSchemes = []string{"http", "https"} -// NewHTTPClient creates a new PMM d baa s HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMDBaaS { +// NewHTTPClient creates a new PMM d baa s API HTTP client. +func NewHTTPClient(formats strfmt.Registry) *PMMDBaaSAPI { return NewHTTPClientWithConfig(formats, nil) } -// NewHTTPClientWithConfig creates a new PMM d baa s HTTP client, +// NewHTTPClientWithConfig creates a new PMM d baa s API HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMDBaaS { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMDBaaSAPI { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -46,14 +46,14 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMM return New(transport, formats) } -// New creates a new PMM d baa s client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMDBaaS { +// New creates a new PMM d baa s API client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMDBaaSAPI { // ensure nullable parameters have default if formats == nil { formats = strfmt.Default } - cli := new(PMMDBaaS) + cli := new(PMMDBaaSAPI) cli.Transport = transport cli.AzureDatabase = azure_database.New(transport, formats) return cli @@ -98,15 +98,15 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// PMMDBaaS is a client for PMM d baa s -type PMMDBaaS struct { +// PMMDBaaSAPI is a client for PMM d baa s API +type PMMDBaaSAPI struct { AzureDatabase azure_database.ClientService Transport runtime.ClientTransport } // SetTransport changes the transport on the client and all its subresources -func (c *PMMDBaaS) SetTransport(transport runtime.ClientTransport) { +func (c *PMMDBaaSAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.AzureDatabase.SetTransport(transport) } diff --git a/api/managementpb/backup/artifacts.pb.go b/api/managementpb/backup/artifacts.pb.go index 4821adb2b1..919e8aaa00 100644 --- a/api/managementpb/backup/artifacts.pb.go +++ b/api/managementpb/backup/artifacts.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/backup/artifacts.proto diff --git a/api/managementpb/backup/backups.pb.go b/api/managementpb/backup/backups.pb.go index d796175112..126097d8d3 100644 --- a/api/managementpb/backup/backups.pb.go +++ b/api/managementpb/backup/backups.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/backup/backups.proto diff --git a/api/managementpb/backup/common.pb.go b/api/managementpb/backup/common.pb.go index ca470a7aa9..6dbfd975c7 100644 --- a/api/managementpb/backup/common.pb.go +++ b/api/managementpb/backup/common.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/backup/common.proto diff --git a/api/managementpb/backup/errors.pb.go b/api/managementpb/backup/errors.pb.go index b67524d438..2ad32192cf 100644 --- a/api/managementpb/backup/errors.pb.go +++ b/api/managementpb/backup/errors.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/backup/errors.proto diff --git a/api/managementpb/backup/json/backup.json b/api/managementpb/backup/json/backup.json index e77d103722..a1ad1972bf 100644 --- a/api/managementpb/backup/json/backup.json +++ b/api/managementpb/backup/json/backup.json @@ -141,8 +141,7 @@ "DATA_MODEL_INVALID", "PHYSICAL", "LOGICAL" - ], - "x-order": 7 + ] }, "location_id": { "description": "Machine-readable location ID.", @@ -163,8 +162,7 @@ "SNAPSHOT", "INCREMENTAL", "PITR" - ], - "x-order": 10 + ] }, "name": { "type": "string", @@ -194,8 +192,7 @@ "BACKUP_STATUS_ERROR", "BACKUP_STATUS_DELETING", "BACKUP_STATUS_FAILED_TO_DELETE" - ], - "x-order": 8 + ] }, "vendor": { "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", @@ -717,8 +714,7 @@ "DATA_MODEL_INVALID", "PHYSICAL", "LOGICAL" - ], - "x-order": 12 + ] }, "description": { "description": "Description.", @@ -755,8 +751,7 @@ "SNAPSHOT", "INCREMENTAL", "PITR" - ], - "x-order": 17 + ] }, "name": { "description": "Artifact name.", @@ -1063,8 +1058,7 @@ "SNAPSHOT", "INCREMENTAL", "PITR" - ], - "x-order": 10 + ] }, "name": { "description": "Name of backup.", @@ -1297,8 +1291,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 2 + } }, "pmm_server_config": { "description": "PMMServerLocationConfig represents file system config inside pmm-server.", @@ -1308,8 +1301,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 3 + } }, "s3_config": { "description": "S3LocationConfig represents S3 bucket configuration.", @@ -1331,8 +1323,7 @@ "type": "string", "x-order": 2 } - }, - "x-order": 4 + } } } } @@ -1431,8 +1422,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 3 + } }, "pmm_server_config": { "description": "PMMServerLocationConfig represents file system config inside pmm-server.", @@ -1442,8 +1432,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 4 + } }, "s3_config": { "description": "S3LocationConfig represents S3 bucket configuration.", @@ -1465,8 +1454,7 @@ "type": "string", "x-order": 2 } - }, - "x-order": 5 + } } } } @@ -1573,8 +1561,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 3 + } }, "pmm_server_config": { "description": "PMMServerLocationConfig represents file system config inside pmm-server.", @@ -1584,8 +1571,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 4 + } }, "s3_config": { "description": "S3LocationConfig represents S3 bucket configuration.", @@ -1607,8 +1593,7 @@ "type": "string", "x-order": 2 } - }, - "x-order": 5 + } } } }, @@ -1760,8 +1745,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 0 + } }, "pmm_server_config": { "description": "PMMServerLocationConfig represents file system config inside pmm-server.", @@ -1771,8 +1755,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 1 + } }, "s3_config": { "description": "S3LocationConfig represents S3 bucket configuration.", @@ -1794,8 +1777,7 @@ "type": "string", "x-order": 2 } - }, - "x-order": 2 + } } } } @@ -1892,8 +1874,7 @@ "DATA_MODEL_INVALID", "PHYSICAL", "LOGICAL" - ], - "x-order": 8 + ] }, "finished_at": { "description": "Restore finish time.", @@ -1946,8 +1927,7 @@ "RESTORE_STATUS_IN_PROGRESS", "RESTORE_STATUS_SUCCESS", "RESTORE_STATUS_ERROR" - ], - "x-order": 9 + ] }, "vendor": { "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", diff --git a/api/managementpb/backup/json/client/artifacts/artifacts_client.go b/api/managementpb/backup/json/client/artifacts/artifacts_client.go index 586685db1a..e96d88d2f6 100644 --- a/api/managementpb/backup/json/client/artifacts/artifacts_client.go +++ b/api/managementpb/backup/json/client/artifacts/artifacts_client.go @@ -23,11 +23,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - DeleteArtifact(params *DeleteArtifactParams) (*DeleteArtifactOK, error) + DeleteArtifact(params *DeleteArtifactParams, opts ...ClientOption) (*DeleteArtifactOK, error) - ListArtifacts(params *ListArtifactsParams) (*ListArtifactsOK, error) + ListArtifacts(params *ListArtifactsParams, opts ...ClientOption) (*ListArtifactsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { /* DeleteArtifact deletes artifact deletes specified artifact */ -func (a *Client) DeleteArtifact(params *DeleteArtifactParams) (*DeleteArtifactOK, error) { +func (a *Client) DeleteArtifact(params *DeleteArtifactParams, opts ...ClientOption) (*DeleteArtifactOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteArtifactParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "DeleteArtifact", Method: "POST", PathPattern: "/v1/management/backup/Artifacts/Delete", @@ -52,7 +54,12 @@ func (a *Client) DeleteArtifact(params *DeleteArtifactParams) (*DeleteArtifactOK 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 } @@ -68,13 +75,12 @@ func (a *Client) DeleteArtifact(params *DeleteArtifactParams) (*DeleteArtifactOK /* ListArtifacts lists artifacts returns a list of all backup artifacts */ -func (a *Client) ListArtifacts(params *ListArtifactsParams) (*ListArtifactsOK, error) { +func (a *Client) ListArtifacts(params *ListArtifactsParams, opts ...ClientOption) (*ListArtifactsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListArtifactsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListArtifacts", Method: "POST", PathPattern: "/v1/management/backup/Artifacts/List", @@ -85,7 +91,12 @@ func (a *Client) ListArtifacts(params *ListArtifactsParams) (*ListArtifactsOK, e 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 } diff --git a/api/managementpb/backup/json/client/artifacts/delete_artifact_parameters.go b/api/managementpb/backup/json/client/artifacts/delete_artifact_parameters.go index 612af3b20b..b96f5c198d 100644 --- a/api/managementpb/backup/json/client/artifacts/delete_artifact_parameters.go +++ b/api/managementpb/backup/json/client/artifacts/delete_artifact_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteArtifactParams creates a new DeleteArtifactParams object -// with the default values initialized. +// 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 { - var () return &DeleteArtifactParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteArtifactParamsWithTimeout creates a new DeleteArtifactParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteArtifactParamsWithTimeout(timeout time.Duration) *DeleteArtifactParams { - var () return &DeleteArtifactParams{ - timeout: timeout, } } // NewDeleteArtifactParamsWithContext creates a new DeleteArtifactParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteArtifactParamsWithContext(ctx context.Context) *DeleteArtifactParams { - var () return &DeleteArtifactParams{ - Context: ctx, } } // NewDeleteArtifactParamsWithHTTPClient creates a new DeleteArtifactParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteArtifactParamsWithHTTPClient(client *http.Client) *DeleteArtifactParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body DeleteArtifactBody timeout time.Duration @@ -68,6 +67,21 @@ type DeleteArtifactParams struct { 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) @@ -119,7 +133,6 @@ func (o *DeleteArtifactParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/artifacts/delete_artifact_responses.go b/api/managementpb/backup/json/client/artifacts/delete_artifact_responses.go index 9c7c6ec3b1..b69d4b801e 100644 --- a/api/managementpb/backup/json/client/artifacts/delete_artifact_responses.go +++ b/api/managementpb/backup/json/client/artifacts/delete_artifact_responses.go @@ -6,6 +6,7 @@ package artifacts // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewDeleteArtifactOK() *DeleteArtifactOK { return &DeleteArtifactOK{} } -/*DeleteArtifactOK handles this case with default header values. +/* DeleteArtifactOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type DeleteArtifactOK struct { func (o *DeleteArtifactOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Artifacts/Delete][%d] deleteArtifactOk %+v", 200, o.Payload) } - func (o *DeleteArtifactOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewDeleteArtifactDefault(code int) *DeleteArtifactDefault { } } -/*DeleteArtifactDefault handles this case with default header values. +/* DeleteArtifactDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *DeleteArtifactDefault) Code() int { func (o *DeleteArtifactDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Artifacts/Delete][%d] DeleteArtifact default %+v", o._statusCode, o.Payload) } - func (o *DeleteArtifactDefault) GetPayload() *DeleteArtifactDefaultBody { return o.Payload } @@ -132,6 +131,11 @@ func (o *DeleteArtifactBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this delete artifact body based on context it is used +func (o *DeleteArtifactBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *DeleteArtifactBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -165,7 +169,7 @@ type DeleteArtifactDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*DeleteArtifactDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this delete artifact default body @@ -183,7 +187,6 @@ func (o *DeleteArtifactDefaultBody) Validate(formats strfmt.Registry) error { } func (o *DeleteArtifactDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -197,6 +200,42 @@ func (o *DeleteArtifactDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("DeleteArtifact default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DeleteArtifact default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("DeleteArtifact default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -225,10 +264,10 @@ func (o *DeleteArtifactDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*DeleteArtifactDefaultBodyDetailsItems0 delete artifact default body details items0 +swagger:model DeleteArtifactDefaultBodyDetailsItems0 */ -type DetailsItems0 struct { +type DeleteArtifactDefaultBodyDetailsItems0 struct { // type url TypeURL string `json:"type_url,omitempty"` @@ -238,13 +277,18 @@ type DetailsItems0 struct { Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// 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 *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *DeleteArtifactDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -252,8 +296,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *DeleteArtifactDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res DeleteArtifactDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/backup/json/client/artifacts/list_artifacts_parameters.go b/api/managementpb/backup/json/client/artifacts/list_artifacts_parameters.go index de5daae08b..d6e36c24f0 100644 --- a/api/managementpb/backup/json/client/artifacts/list_artifacts_parameters.go +++ b/api/managementpb/backup/json/client/artifacts/list_artifacts_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListArtifactsParams creates a new ListArtifactsParams object -// with the default values initialized. +// 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 { - var () return &ListArtifactsParams{ - timeout: cr.DefaultTimeout, } } // NewListArtifactsParamsWithTimeout creates a new ListArtifactsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListArtifactsParamsWithTimeout(timeout time.Duration) *ListArtifactsParams { - var () return &ListArtifactsParams{ - timeout: timeout, } } // NewListArtifactsParamsWithContext creates a new ListArtifactsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListArtifactsParamsWithContext(ctx context.Context) *ListArtifactsParams { - var () return &ListArtifactsParams{ - Context: ctx, } } // NewListArtifactsParamsWithHTTPClient creates a new ListArtifactsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListArtifactsParamsWithHTTPClient(client *http.Client) *ListArtifactsParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type ListArtifactsParams struct { 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) @@ -119,7 +133,6 @@ func (o *ListArtifactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/managementpb/backup/json/client/artifacts/list_artifacts_responses.go b/api/managementpb/backup/json/client/artifacts/list_artifacts_responses.go index 7745e661a2..090df02f7f 100644 --- a/api/managementpb/backup/json/client/artifacts/list_artifacts_responses.go +++ b/api/managementpb/backup/json/client/artifacts/list_artifacts_responses.go @@ -6,6 +6,7 @@ package artifacts // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListArtifactsOK() *ListArtifactsOK { return &ListArtifactsOK{} } -/*ListArtifactsOK handles this case with default header values. +/* ListArtifactsOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListArtifactsOK struct { func (o *ListArtifactsOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Artifacts/List][%d] listArtifactsOk %+v", 200, o.Payload) } - func (o *ListArtifactsOK) GetPayload() *ListArtifactsOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListArtifactsDefault(code int) *ListArtifactsDefault { } } -/*ListArtifactsDefault handles this case with default header values. +/* ListArtifactsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListArtifactsDefault) Code() int { func (o *ListArtifactsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Artifacts/List][%d] ListArtifacts default %+v", o._statusCode, o.Payload) } - func (o *ListArtifactsDefault) GetPayload() *ListArtifactsDefaultBody { return o.Payload } @@ -119,184 +118,328 @@ func (o *ListArtifactsDefault) readResponse(response runtime.ClientResponse, con return nil } -/*ArtifactsItems0 Artifact represents single backup artifact. -swagger:model ArtifactsItems0 +/*ListArtifactsDefaultBody list artifacts default body +swagger:model ListArtifactsDefaultBody */ -type ArtifactsItems0 struct { +type ListArtifactsDefaultBody struct { - // Machine-readable artifact ID. - ArtifactID string `json:"artifact_id,omitempty"` + // error + Error string `json:"error,omitempty"` - // Artifact name - Name string `json:"name,omitempty"` + // code + Code int32 `json:"code,omitempty"` - // Database vendor e.g. PostgreSQL, MongoDB, MySQL. - Vendor string `json:"vendor,omitempty"` + // message + Message string `json:"message,omitempty"` - // Machine-readable location ID. - LocationID string `json:"location_id,omitempty"` + // details + Details []*ListArtifactsDefaultBodyDetailsItems0 `json:"details"` +} - // Location name. - LocationName string `json:"location_name,omitempty"` +// Validate validates this list artifacts default body +func (o *ListArtifactsDefaultBody) Validate(formats strfmt.Registry) error { + var res []error - // Machine-readable service ID. - ServiceID string `json:"service_id,omitempty"` + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } - // Service name. - ServiceName string `json:"service_name,omitempty"` + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} - // DataModel is a model used for performing a backup. - // Enum: [DATA_MODEL_INVALID PHYSICAL LOGICAL] - DataModel *string `json:"data_model,omitempty"` +func (o *ListArtifactsDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil + } - // BackupStatus shows the current status of execution of backup. - // Enum: [BACKUP_STATUS_INVALID BACKUP_STATUS_PENDING BACKUP_STATUS_IN_PROGRESS BACKUP_STATUS_PAUSED BACKUP_STATUS_SUCCESS BACKUP_STATUS_ERROR BACKUP_STATUS_DELETING BACKUP_STATUS_FAILED_TO_DELETE] - Status *string `json:"status,omitempty"` + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } - // Artifact creation time. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListArtifacts default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListArtifacts default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } - // BackupMode specifies backup mode. - // Enum: [BACKUP_MODE_INVALID SNAPSHOT INCREMENTAL PITR] - Mode *string `json:"mode,omitempty"` + } + + return nil } -// Validate validates this artifacts items0 -func (o *ArtifactsItems0) Validate(formats strfmt.Registry) error { +// 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.validateDataModel(formats); err != nil { + if err := o.contextValidateDetails(ctx, 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 *ListArtifactsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListArtifacts default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListArtifacts default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } - if err := o.validateCreatedAt(formats); err != nil { - res = append(res, err) } - if err := o.validateMode(formats); err != nil { - res = append(res, err) + return nil +} + +// MarshalBinary interface implementation +func (o *ListArtifactsDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil } + return swag.WriteJSON(o) +} - if len(res) > 0 { - return errors.CompositeValidationError(res...) +// 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 } -var artifactsItems0TypeDataModelPropEnum []interface{} +/*ListArtifactsDefaultBodyDetailsItems0 list artifacts default body details items0 +swagger:model ListArtifactsDefaultBodyDetailsItems0 +*/ +type ListArtifactsDefaultBodyDetailsItems0 struct { -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DATA_MODEL_INVALID","PHYSICAL","LOGICAL"]`), &res); err != nil { - panic(err) + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 } - for _, v := range res { - artifactsItems0TypeDataModelPropEnum = append(artifactsItems0TypeDataModelPropEnum, v) + 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 } -const ( +/*ListArtifactsOKBody list artifacts OK body +swagger:model ListArtifactsOKBody +*/ +type ListArtifactsOKBody struct { - // ArtifactsItems0DataModelDATAMODELINVALID captures enum value "DATA_MODEL_INVALID" - ArtifactsItems0DataModelDATAMODELINVALID string = "DATA_MODEL_INVALID" + // artifacts + Artifacts []*ListArtifactsOKBodyArtifactsItems0 `json:"artifacts"` +} - // ArtifactsItems0DataModelPHYSICAL captures enum value "PHYSICAL" - ArtifactsItems0DataModelPHYSICAL string = "PHYSICAL" +// Validate validates this list artifacts OK body +func (o *ListArtifactsOKBody) Validate(formats strfmt.Registry) error { + var res []error - // ArtifactsItems0DataModelLOGICAL captures enum value "LOGICAL" - ArtifactsItems0DataModelLOGICAL string = "LOGICAL" -) + if err := o.validateArtifacts(formats); err != nil { + res = append(res, err) + } -// prop value enum -func (o *ArtifactsItems0) validateDataModelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, artifactsItems0TypeDataModelPropEnum, true); err != nil { - return err + if len(res) > 0 { + return errors.CompositeValidationError(res...) } return nil } -func (o *ArtifactsItems0) validateDataModel(formats strfmt.Registry) error { - - if swag.IsZero(o.DataModel) { // not required +func (o *ListArtifactsOKBody) validateArtifacts(formats strfmt.Registry) error { + if swag.IsZero(o.Artifacts) { // not required return nil } - // value enum - if err := o.validateDataModelEnum("data_model", "body", *o.DataModel); err != nil { - return err + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listArtifactsOk" + "." + "artifacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listArtifactsOk" + "." + "artifacts" + "." + strconv.Itoa(i)) + } + return err + } + } + } return nil } -var artifactsItems0TypeStatusPropEnum []interface{} +// 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 -func init() { - var res []string - if err := json.Unmarshal([]byte(`["BACKUP_STATUS_INVALID","BACKUP_STATUS_PENDING","BACKUP_STATUS_IN_PROGRESS","BACKUP_STATUS_PAUSED","BACKUP_STATUS_SUCCESS","BACKUP_STATUS_ERROR","BACKUP_STATUS_DELETING","BACKUP_STATUS_FAILED_TO_DELETE"]`), &res); err != nil { - panic(err) + if err := o.contextValidateArtifacts(ctx, formats); err != nil { + res = append(res, err) } - for _, v := range res { - artifactsItems0TypeStatusPropEnum = append(artifactsItems0TypeStatusPropEnum, v) + + if len(res) > 0 { + return errors.CompositeValidationError(res...) } + return nil } -const ( - - // ArtifactsItems0StatusBACKUPSTATUSINVALID captures enum value "BACKUP_STATUS_INVALID" - ArtifactsItems0StatusBACKUPSTATUSINVALID string = "BACKUP_STATUS_INVALID" - - // ArtifactsItems0StatusBACKUPSTATUSPENDING captures enum value "BACKUP_STATUS_PENDING" - ArtifactsItems0StatusBACKUPSTATUSPENDING string = "BACKUP_STATUS_PENDING" +func (o *ListArtifactsOKBody) contextValidateArtifacts(ctx context.Context, formats strfmt.Registry) error { - // ArtifactsItems0StatusBACKUPSTATUSINPROGRESS captures enum value "BACKUP_STATUS_IN_PROGRESS" - ArtifactsItems0StatusBACKUPSTATUSINPROGRESS string = "BACKUP_STATUS_IN_PROGRESS" - - // ArtifactsItems0StatusBACKUPSTATUSPAUSED captures enum value "BACKUP_STATUS_PAUSED" - ArtifactsItems0StatusBACKUPSTATUSPAUSED string = "BACKUP_STATUS_PAUSED" + for i := 0; i < len(o.Artifacts); i++ { - // ArtifactsItems0StatusBACKUPSTATUSSUCCESS captures enum value "BACKUP_STATUS_SUCCESS" - ArtifactsItems0StatusBACKUPSTATUSSUCCESS string = "BACKUP_STATUS_SUCCESS" + if o.Artifacts[i] != nil { + if err := o.Artifacts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listArtifactsOk" + "." + "artifacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listArtifactsOk" + "." + "artifacts" + "." + strconv.Itoa(i)) + } + return err + } + } - // ArtifactsItems0StatusBACKUPSTATUSERROR captures enum value "BACKUP_STATUS_ERROR" - ArtifactsItems0StatusBACKUPSTATUSERROR string = "BACKUP_STATUS_ERROR" + } - // ArtifactsItems0StatusBACKUPSTATUSDELETING captures enum value "BACKUP_STATUS_DELETING" - ArtifactsItems0StatusBACKUPSTATUSDELETING string = "BACKUP_STATUS_DELETING" + return nil +} - // ArtifactsItems0StatusBACKUPSTATUSFAILEDTODELETE captures enum value "BACKUP_STATUS_FAILED_TO_DELETE" - ArtifactsItems0StatusBACKUPSTATUSFAILEDTODELETE string = "BACKUP_STATUS_FAILED_TO_DELETE" -) +// MarshalBinary interface implementation +func (o *ListArtifactsOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} -// prop value enum -func (o *ArtifactsItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, artifactsItems0TypeStatusPropEnum, true); err != nil { +// 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 } -func (o *ArtifactsItems0) validateStatus(formats strfmt.Registry) error { +/*ListArtifactsOKBodyArtifactsItems0 Artifact represents single backup artifact. +swagger:model ListArtifactsOKBodyArtifactsItems0 +*/ +type ListArtifactsOKBodyArtifactsItems0 struct { - if swag.IsZero(o.Status) { // not required - return nil + // 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"` + + // Artifact creation time. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // DataModel is a model used for performing a backup. + // Enum: [DATA_MODEL_INVALID PHYSICAL LOGICAL] + DataModel *string `json:"data_model,omitempty"` + + // BackupMode specifies backup mode. + // Enum: [BACKUP_MODE_INVALID SNAPSHOT INCREMENTAL PITR] + Mode *string `json:"mode,omitempty"` + + // BackupStatus shows the current status of execution of backup. + // Enum: [BACKUP_STATUS_INVALID BACKUP_STATUS_PENDING BACKUP_STATUS_IN_PROGRESS BACKUP_STATUS_PAUSED BACKUP_STATUS_SUCCESS BACKUP_STATUS_ERROR BACKUP_STATUS_DELETING BACKUP_STATUS_FAILED_TO_DELETE] + Status *string `json:"status,omitempty"` +} + +// Validate validates this list artifacts OK body artifacts items0 +func (o *ListArtifactsOKBodyArtifactsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCreatedAt(formats); err != nil { + res = append(res, err) } - // value enum - if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { - return 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.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } return nil } -func (o *ArtifactsItems0) validateCreatedAt(formats strfmt.Registry) error { - +func (o *ListArtifactsOKBodyArtifactsItems0) validateCreatedAt(formats strfmt.Registry) error { if swag.IsZero(o.CreatedAt) { // not required return nil } @@ -308,198 +451,166 @@ func (o *ArtifactsItems0) validateCreatedAt(formats strfmt.Registry) error { return nil } -var artifactsItems0TypeModePropEnum []interface{} +var listArtifactsOkBodyArtifactsItems0TypeDataModelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["BACKUP_MODE_INVALID","SNAPSHOT","INCREMENTAL","PITR"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["DATA_MODEL_INVALID","PHYSICAL","LOGICAL"]`), &res); err != nil { panic(err) } for _, v := range res { - artifactsItems0TypeModePropEnum = append(artifactsItems0TypeModePropEnum, v) + listArtifactsOkBodyArtifactsItems0TypeDataModelPropEnum = append(listArtifactsOkBodyArtifactsItems0TypeDataModelPropEnum, v) } } const ( - // ArtifactsItems0ModeBACKUPMODEINVALID captures enum value "BACKUP_MODE_INVALID" - ArtifactsItems0ModeBACKUPMODEINVALID string = "BACKUP_MODE_INVALID" - - // ArtifactsItems0ModeSNAPSHOT captures enum value "SNAPSHOT" - ArtifactsItems0ModeSNAPSHOT string = "SNAPSHOT" + // ListArtifactsOKBodyArtifactsItems0DataModelDATAMODELINVALID captures enum value "DATA_MODEL_INVALID" + ListArtifactsOKBodyArtifactsItems0DataModelDATAMODELINVALID string = "DATA_MODEL_INVALID" - // ArtifactsItems0ModeINCREMENTAL captures enum value "INCREMENTAL" - ArtifactsItems0ModeINCREMENTAL string = "INCREMENTAL" + // ListArtifactsOKBodyArtifactsItems0DataModelPHYSICAL captures enum value "PHYSICAL" + ListArtifactsOKBodyArtifactsItems0DataModelPHYSICAL string = "PHYSICAL" - // ArtifactsItems0ModePITR captures enum value "PITR" - ArtifactsItems0ModePITR string = "PITR" + // ListArtifactsOKBodyArtifactsItems0DataModelLOGICAL captures enum value "LOGICAL" + ListArtifactsOKBodyArtifactsItems0DataModelLOGICAL string = "LOGICAL" ) // prop value enum -func (o *ArtifactsItems0) validateModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, artifactsItems0TypeModePropEnum, true); err != nil { +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 *ArtifactsItems0) validateMode(formats strfmt.Registry) error { - - if swag.IsZero(o.Mode) { // not required +func (o *ListArtifactsOKBodyArtifactsItems0) validateDataModel(formats strfmt.Registry) error { + if swag.IsZero(o.DataModel) { // not required return nil } // value enum - if err := o.validateModeEnum("mode", "body", *o.Mode); err != nil { + if err := o.validateDataModelEnum("data_model", "body", *o.DataModel); err != nil { return err } return nil } -// MarshalBinary interface implementation -func (o *ArtifactsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} +var listArtifactsOkBodyArtifactsItems0TypeModePropEnum []interface{} -// UnmarshalBinary interface implementation -func (o *ArtifactsItems0) UnmarshalBinary(b []byte) error { - var res ArtifactsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err +func init() { + var res []string + if err := json.Unmarshal([]byte(`["BACKUP_MODE_INVALID","SNAPSHOT","INCREMENTAL","PITR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listArtifactsOkBodyArtifactsItems0TypeModePropEnum = append(listArtifactsOkBodyArtifactsItems0TypeModePropEnum, v) } - *o = res - return nil } -/*ListArtifactsDefaultBody list artifacts default body -swagger:model ListArtifactsDefaultBody -*/ -type ListArtifactsDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` +const ( - // message - Message string `json:"message,omitempty"` + // ListArtifactsOKBodyArtifactsItems0ModeBACKUPMODEINVALID captures enum value "BACKUP_MODE_INVALID" + ListArtifactsOKBodyArtifactsItems0ModeBACKUPMODEINVALID string = "BACKUP_MODE_INVALID" - // details - Details []*DetailsItems0 `json:"details"` -} + // ListArtifactsOKBodyArtifactsItems0ModeSNAPSHOT captures enum value "SNAPSHOT" + ListArtifactsOKBodyArtifactsItems0ModeSNAPSHOT string = "SNAPSHOT" -// Validate validates this list artifacts default body -func (o *ListArtifactsDefaultBody) Validate(formats strfmt.Registry) error { - var res []error + // ListArtifactsOKBodyArtifactsItems0ModeINCREMENTAL captures enum value "INCREMENTAL" + ListArtifactsOKBodyArtifactsItems0ModeINCREMENTAL string = "INCREMENTAL" - if err := o.validateDetails(formats); err != nil { - res = append(res, err) - } + // ListArtifactsOKBodyArtifactsItems0ModePITR captures enum value "PITR" + ListArtifactsOKBodyArtifactsItems0ModePITR string = "PITR" +) - if len(res) > 0 { - return errors.CompositeValidationError(res...) +// 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 *ListArtifactsDefaultBody) validateDetails(formats strfmt.Registry) error { - - if swag.IsZero(o.Details) { // not required +func (o *ListArtifactsOKBodyArtifactsItems0) validateMode(formats strfmt.Registry) error { + if swag.IsZero(o.Mode) { // not required return nil } - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ListArtifacts default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - + // value enum + if err := o.validateModeEnum("mode", "body", *o.Mode); err != nil { + return err } return nil } -// MarshalBinary interface implementation -func (o *ListArtifactsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} +var listArtifactsOkBodyArtifactsItems0TypeStatusPropEnum []interface{} -// UnmarshalBinary interface implementation -func (o *ListArtifactsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListArtifactsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err +func init() { + var res []string + if err := json.Unmarshal([]byte(`["BACKUP_STATUS_INVALID","BACKUP_STATUS_PENDING","BACKUP_STATUS_IN_PROGRESS","BACKUP_STATUS_PAUSED","BACKUP_STATUS_SUCCESS","BACKUP_STATUS_ERROR","BACKUP_STATUS_DELETING","BACKUP_STATUS_FAILED_TO_DELETE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listArtifactsOkBodyArtifactsItems0TypeStatusPropEnum = append(listArtifactsOkBodyArtifactsItems0TypeStatusPropEnum, v) } - *o = res - return nil } -/*ListArtifactsOKBody list artifacts OK body -swagger:model ListArtifactsOKBody -*/ -type ListArtifactsOKBody struct { +const ( - // artifacts - Artifacts []*ArtifactsItems0 `json:"artifacts"` -} + // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSINVALID captures enum value "BACKUP_STATUS_INVALID" + ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSINVALID string = "BACKUP_STATUS_INVALID" -// Validate validates this list artifacts OK body -func (o *ListArtifactsOKBody) Validate(formats strfmt.Registry) error { - var res []error + // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSPENDING captures enum value "BACKUP_STATUS_PENDING" + ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSPENDING string = "BACKUP_STATUS_PENDING" - if err := o.validateArtifacts(formats); err != nil { - res = append(res, err) - } + // ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSINPROGRESS captures enum value "BACKUP_STATUS_IN_PROGRESS" + ListArtifactsOKBodyArtifactsItems0StatusBACKUPSTATUSINPROGRESS string = "BACKUP_STATUS_IN_PROGRESS" - if len(res) > 0 { - return errors.CompositeValidationError(res...) + // 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" +) + +// 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 *ListArtifactsOKBody) validateArtifacts(formats strfmt.Registry) error { - - if swag.IsZero(o.Artifacts) { // not required +func (o *ListArtifactsOKBodyArtifactsItems0) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // 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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listArtifactsOk" + "." + "artifacts" + "." + strconv.Itoa(i)) - } - return err - } - } - + // value enum + if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { + return err } return nil } +// ContextValidate validates this list artifacts OK body artifacts items0 based on context it is used +func (o *ListArtifactsOKBodyArtifactsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *ListArtifactsOKBody) MarshalBinary() ([]byte, error) { +func (o *ListArtifactsOKBodyArtifactsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -507,8 +618,8 @@ func (o *ListArtifactsOKBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListArtifactsOKBody) UnmarshalBinary(b []byte) error { - var res ListArtifactsOKBody +func (o *ListArtifactsOKBodyArtifactsItems0) UnmarshalBinary(b []byte) error { + var res ListArtifactsOKBodyArtifactsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/backups_client.go b/api/managementpb/backup/json/client/backups/backups_client.go index 18f1a07afc..d7c1212c75 100644 --- a/api/managementpb/backup/json/client/backups/backups_client.go +++ b/api/managementpb/backup/json/client/backups/backups_client.go @@ -23,23 +23,26 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - ChangeScheduledBackup(params *ChangeScheduledBackupParams) (*ChangeScheduledBackupOK, error) + ChangeScheduledBackup(params *ChangeScheduledBackupParams, opts ...ClientOption) (*ChangeScheduledBackupOK, error) - GetLogs(params *GetLogsParams) (*GetLogsOK, error) + GetLogs(params *GetLogsParams, opts ...ClientOption) (*GetLogsOK, error) - ListArtifactCompatibleServices(params *ListArtifactCompatibleServicesParams) (*ListArtifactCompatibleServicesOK, error) + ListArtifactCompatibleServices(params *ListArtifactCompatibleServicesParams, opts ...ClientOption) (*ListArtifactCompatibleServicesOK, error) - ListScheduledBackups(params *ListScheduledBackupsParams) (*ListScheduledBackupsOK, error) + ListScheduledBackups(params *ListScheduledBackupsParams, opts ...ClientOption) (*ListScheduledBackupsOK, error) - RemoveScheduledBackup(params *RemoveScheduledBackupParams) (*RemoveScheduledBackupOK, error) + RemoveScheduledBackup(params *RemoveScheduledBackupParams, opts ...ClientOption) (*RemoveScheduledBackupOK, error) - RestoreBackup(params *RestoreBackupParams) (*RestoreBackupOK, error) + RestoreBackup(params *RestoreBackupParams, opts ...ClientOption) (*RestoreBackupOK, error) - ScheduleBackup(params *ScheduleBackupParams) (*ScheduleBackupOK, error) + ScheduleBackup(params *ScheduleBackupParams, opts ...ClientOption) (*ScheduleBackupOK, error) - StartBackup(params *StartBackupParams) (*StartBackupOK, error) + StartBackup(params *StartBackupParams, opts ...ClientOption) (*StartBackupOK, error) SetTransport(transport runtime.ClientTransport) } @@ -47,13 +50,12 @@ type ClientService interface { /* ChangeScheduledBackup changes scheduled backup changes existing scheduled backup */ -func (a *Client) ChangeScheduledBackup(params *ChangeScheduledBackupParams) (*ChangeScheduledBackupOK, error) { +func (a *Client) ChangeScheduledBackup(params *ChangeScheduledBackupParams, opts ...ClientOption) (*ChangeScheduledBackupOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeScheduledBackupParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeScheduledBackup", Method: "POST", PathPattern: "/v1/management/backup/Backups/ChangeScheduled", @@ -64,7 +66,12 @@ func (a *Client) ChangeScheduledBackup(params *ChangeScheduledBackupParams) (*Ch 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 } @@ -80,13 +87,12 @@ func (a *Client) ChangeScheduledBackup(params *ChangeScheduledBackupParams) (*Ch /* GetLogs gets logs returns logs for provided artifact */ -func (a *Client) GetLogs(params *GetLogsParams) (*GetLogsOK, error) { +func (a *Client) GetLogs(params *GetLogsParams, opts ...ClientOption) (*GetLogsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetLogsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetLogs", Method: "POST", PathPattern: "/v1/management/backup/Backups/GetLogs", @@ -97,7 +103,12 @@ func (a *Client) GetLogs(params *GetLogsParams) (*GetLogsOK, error) { 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 } @@ -113,13 +124,12 @@ func (a *Client) GetLogs(params *GetLogsParams) (*GetLogsOK, error) { /* ListArtifactCompatibleServices lists artifact compatible services lists compatible services for restoring a backup */ -func (a *Client) ListArtifactCompatibleServices(params *ListArtifactCompatibleServicesParams) (*ListArtifactCompatibleServicesOK, error) { +func (a *Client) ListArtifactCompatibleServices(params *ListArtifactCompatibleServicesParams, opts ...ClientOption) (*ListArtifactCompatibleServicesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListArtifactCompatibleServicesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListArtifactCompatibleServices", Method: "POST", PathPattern: "/v1/management/backup/Backups/ListArtifactCompatibleServices", @@ -130,7 +140,12 @@ func (a *Client) ListArtifactCompatibleServices(params *ListArtifactCompatibleSe 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 } @@ -146,13 +161,12 @@ func (a *Client) ListArtifactCompatibleServices(params *ListArtifactCompatibleSe /* ListScheduledBackups lists scheduled backups returns all scheduled backups */ -func (a *Client) ListScheduledBackups(params *ListScheduledBackupsParams) (*ListScheduledBackupsOK, error) { +func (a *Client) ListScheduledBackups(params *ListScheduledBackupsParams, opts ...ClientOption) (*ListScheduledBackupsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListScheduledBackupsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListScheduledBackups", Method: "POST", PathPattern: "/v1/management/backup/Backups/ListScheduled", @@ -163,7 +177,12 @@ func (a *Client) ListScheduledBackups(params *ListScheduledBackupsParams) (*List 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 } @@ -179,13 +198,12 @@ func (a *Client) ListScheduledBackups(params *ListScheduledBackupsParams) (*List /* RemoveScheduledBackup removes scheduled backup removes existing scheduled backup */ -func (a *Client) RemoveScheduledBackup(params *RemoveScheduledBackupParams) (*RemoveScheduledBackupOK, error) { +func (a *Client) RemoveScheduledBackup(params *RemoveScheduledBackupParams, opts ...ClientOption) (*RemoveScheduledBackupOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRemoveScheduledBackupParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RemoveScheduledBackup", Method: "POST", PathPattern: "/v1/management/backup/Backups/RemoveScheduled", @@ -196,7 +214,12 @@ func (a *Client) RemoveScheduledBackup(params *RemoveScheduledBackupParams) (*Re 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 } @@ -218,13 +241,12 @@ 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) (*RestoreBackupOK, error) { +func (a *Client) RestoreBackup(params *RestoreBackupParams, opts ...ClientOption) (*RestoreBackupOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRestoreBackupParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RestoreBackup", Method: "POST", PathPattern: "/v1/management/backup/Backups/Restore", @@ -235,7 +257,12 @@ func (a *Client) RestoreBackup(params *RestoreBackupParams) (*RestoreBackupOK, e 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 } @@ -251,13 +278,12 @@ func (a *Client) RestoreBackup(params *RestoreBackupParams) (*RestoreBackupOK, e /* ScheduleBackup schedules backup schedules repeated backup */ -func (a *Client) ScheduleBackup(params *ScheduleBackupParams) (*ScheduleBackupOK, error) { +func (a *Client) ScheduleBackup(params *ScheduleBackupParams, opts ...ClientOption) (*ScheduleBackupOK, error) { // TODO: Validate the params before sending if params == nil { params = NewScheduleBackupParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ScheduleBackup", Method: "POST", PathPattern: "/v1/management/backup/Backups/Schedule", @@ -268,7 +294,12 @@ func (a *Client) ScheduleBackup(params *ScheduleBackupParams) (*ScheduleBackupOK 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 } @@ -289,13 +320,12 @@ 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) (*StartBackupOK, error) { +func (a *Client) StartBackup(params *StartBackupParams, opts ...ClientOption) (*StartBackupOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartBackupParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartBackup", Method: "POST", PathPattern: "/v1/management/backup/Backups/Start", @@ -306,7 +336,12 @@ func (a *Client) StartBackup(params *StartBackupParams) (*StartBackupOK, error) 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 } diff --git a/api/managementpb/backup/json/client/backups/change_scheduled_backup_parameters.go b/api/managementpb/backup/json/client/backups/change_scheduled_backup_parameters.go index ea18740d67..bc564c7b96 100644 --- a/api/managementpb/backup/json/client/backups/change_scheduled_backup_parameters.go +++ b/api/managementpb/backup/json/client/backups/change_scheduled_backup_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeScheduledBackupParams creates a new ChangeScheduledBackupParams object -// with the default values initialized. +// 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 { - var () return &ChangeScheduledBackupParams{ - timeout: cr.DefaultTimeout, } } // NewChangeScheduledBackupParamsWithTimeout creates a new ChangeScheduledBackupParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeScheduledBackupParamsWithTimeout(timeout time.Duration) *ChangeScheduledBackupParams { - var () return &ChangeScheduledBackupParams{ - timeout: timeout, } } // NewChangeScheduledBackupParamsWithContext creates a new ChangeScheduledBackupParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeScheduledBackupParamsWithContext(ctx context.Context) *ChangeScheduledBackupParams { - var () return &ChangeScheduledBackupParams{ - Context: ctx, } } // NewChangeScheduledBackupParamsWithHTTPClient creates a new ChangeScheduledBackupParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeScheduledBackupParamsWithHTTPClient(client *http.Client) *ChangeScheduledBackupParams { - var () 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 +/* 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. Body ChangeScheduledBackupBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeScheduledBackupParams struct { 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) @@ -119,7 +133,6 @@ func (o *ChangeScheduledBackupParams) WriteToRequest(r runtime.ClientRequest, re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/change_scheduled_backup_responses.go b/api/managementpb/backup/json/client/backups/change_scheduled_backup_responses.go index bb3529b3b8..fa5256f988 100644 --- a/api/managementpb/backup/json/client/backups/change_scheduled_backup_responses.go +++ b/api/managementpb/backup/json/client/backups/change_scheduled_backup_responses.go @@ -6,6 +6,7 @@ package backups // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -48,7 +49,7 @@ func NewChangeScheduledBackupOK() *ChangeScheduledBackupOK { return &ChangeScheduledBackupOK{} } -/*ChangeScheduledBackupOK handles this case with default header values. +/* ChangeScheduledBackupOK describes a response with status code 200, with default header values. A successful response. */ @@ -59,7 +60,6 @@ type ChangeScheduledBackupOK struct { func (o *ChangeScheduledBackupOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/ChangeScheduled][%d] changeScheduledBackupOk %+v", 200, o.Payload) } - func (o *ChangeScheduledBackupOK) GetPayload() interface{} { return o.Payload } @@ -81,7 +81,7 @@ func NewChangeScheduledBackupDefault(code int) *ChangeScheduledBackupDefault { } } -/*ChangeScheduledBackupDefault handles this case with default header values. +/* ChangeScheduledBackupDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -99,7 +99,6 @@ func (o *ChangeScheduledBackupDefault) Code() int { func (o *ChangeScheduledBackupDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/ChangeScheduled][%d] ChangeScheduledBackup default %+v", o._statusCode, o.Payload) } - func (o *ChangeScheduledBackupDefault) GetPayload() *ChangeScheduledBackupDefaultBody { return o.Payload } @@ -165,7 +164,6 @@ func (o *ChangeScheduledBackupBody) Validate(formats strfmt.Registry) error { } func (o *ChangeScheduledBackupBody) validateStartTime(formats strfmt.Registry) error { - if swag.IsZero(o.StartTime) { // not required return nil } @@ -177,6 +175,11 @@ func (o *ChangeScheduledBackupBody) validateStartTime(formats strfmt.Registry) e 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 { @@ -210,7 +213,7 @@ type ChangeScheduledBackupDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeScheduledBackupDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change scheduled backup default body @@ -228,7 +231,6 @@ func (o *ChangeScheduledBackupDefaultBody) Validate(formats strfmt.Registry) err } func (o *ChangeScheduledBackupDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -242,6 +244,42 @@ func (o *ChangeScheduledBackupDefaultBody) validateDetails(formats strfmt.Regist if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -270,10 +308,10 @@ func (o *ChangeScheduledBackupDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*ChangeScheduledBackupDefaultBodyDetailsItems0 change scheduled backup default body details items0 +swagger:model ChangeScheduledBackupDefaultBodyDetailsItems0 */ -type DetailsItems0 struct { +type ChangeScheduledBackupDefaultBodyDetailsItems0 struct { // type url TypeURL string `json:"type_url,omitempty"` @@ -283,13 +321,18 @@ type DetailsItems0 struct { Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// 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 *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *ChangeScheduledBackupDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -297,8 +340,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *ChangeScheduledBackupDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeScheduledBackupDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/get_logs_parameters.go b/api/managementpb/backup/json/client/backups/get_logs_parameters.go index 7550bb102c..b42f1ca7dd 100644 --- a/api/managementpb/backup/json/client/backups/get_logs_parameters.go +++ b/api/managementpb/backup/json/client/backups/get_logs_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLogsParams creates a new GetLogsParams object -// with the default values initialized. +// 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 { - var () return &GetLogsParams{ - timeout: cr.DefaultTimeout, } } // NewGetLogsParamsWithTimeout creates a new GetLogsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetLogsParamsWithTimeout(timeout time.Duration) *GetLogsParams { - var () return &GetLogsParams{ - timeout: timeout, } } // NewGetLogsParamsWithContext creates a new GetLogsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetLogsParamsWithContext(ctx context.Context) *GetLogsParams { - var () return &GetLogsParams{ - Context: ctx, } } // NewGetLogsParamsWithHTTPClient creates a new GetLogsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetLogsParamsWithHTTPClient(client *http.Client) *GetLogsParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body GetLogsBody timeout time.Duration @@ -68,6 +67,21 @@ type GetLogsParams struct { 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) @@ -119,7 +133,6 @@ func (o *GetLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/get_logs_responses.go b/api/managementpb/backup/json/client/backups/get_logs_responses.go index 27b4ba7fc4..137747d074 100644 --- a/api/managementpb/backup/json/client/backups/get_logs_responses.go +++ b/api/managementpb/backup/json/client/backups/get_logs_responses.go @@ -6,6 +6,7 @@ package backups // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetLogsOK() *GetLogsOK { return &GetLogsOK{} } -/*GetLogsOK handles this case with default header values. +/* GetLogsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetLogsOK struct { func (o *GetLogsOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/GetLogs][%d] getLogsOk %+v", 200, o.Payload) } - func (o *GetLogsOK) GetPayload() *GetLogsOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetLogsDefault(code int) *GetLogsDefault { } } -/*GetLogsDefault handles this case with default header values. +/* GetLogsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetLogsDefault) Code() int { func (o *GetLogsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/GetLogs][%d] GetLogs default %+v", o._statusCode, o.Payload) } - func (o *GetLogsDefault) GetPayload() *GetLogsDefaultBody { return o.Payload } @@ -137,6 +136,11 @@ func (o *GetLogsBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get logs body based on context it is used +func (o *GetLogsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetLogsBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -170,7 +174,7 @@ type GetLogsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetLogsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get logs default body @@ -188,7 +192,6 @@ func (o *GetLogsDefaultBody) Validate(formats strfmt.Registry) error { } func (o *GetLogsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -202,6 +205,42 @@ func (o *GetLogsDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetLogs default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetLogs default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetLogs default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -230,13 +269,54 @@ func (o *GetLogsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetLogsDefaultBodyDetailsItems0 get logs default body details items0 +swagger:model GetLogsDefaultBodyDetailsItems0 +*/ +type GetLogsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 []*LogsItems0 `json:"logs"` + Logs []*GetLogsOKBodyLogsItems0 `json:"logs"` // end End bool `json:"end,omitempty"` @@ -257,7 +337,6 @@ func (o *GetLogsOKBody) Validate(formats strfmt.Registry) error { } func (o *GetLogsOKBody) validateLogs(formats strfmt.Registry) error { - if swag.IsZero(o.Logs) { // not required return nil } @@ -271,6 +350,42 @@ func (o *GetLogsOKBody) validateLogs(formats strfmt.Registry) error { if err := o.Logs[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Logs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) } return err } @@ -299,10 +414,10 @@ func (o *GetLogsOKBody) UnmarshalBinary(b []byte) error { return nil } -/*LogsItems0 LogChunk represent one chunk of logs. -swagger:model LogsItems0 +/*GetLogsOKBodyLogsItems0 LogChunk represent one chunk of logs. +swagger:model GetLogsOKBodyLogsItems0 */ -type LogsItems0 struct { +type GetLogsOKBodyLogsItems0 struct { // chunk id ChunkID int64 `json:"chunk_id,omitempty"` @@ -311,13 +426,18 @@ type LogsItems0 struct { Data string `json:"data,omitempty"` } -// Validate validates this logs items0 -func (o *LogsItems0) Validate(formats strfmt.Registry) error { +// 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 *LogsItems0) MarshalBinary() ([]byte, error) { +func (o *GetLogsOKBodyLogsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -325,8 +445,8 @@ func (o *LogsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *LogsItems0) UnmarshalBinary(b []byte) error { - var res LogsItems0 +func (o *GetLogsOKBodyLogsItems0) UnmarshalBinary(b []byte) error { + var res GetLogsOKBodyLogsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/list_artifact_compatible_services_parameters.go b/api/managementpb/backup/json/client/backups/list_artifact_compatible_services_parameters.go index 911841099b..99dd02f7b7 100644 --- a/api/managementpb/backup/json/client/backups/list_artifact_compatible_services_parameters.go +++ b/api/managementpb/backup/json/client/backups/list_artifact_compatible_services_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListArtifactCompatibleServicesParams creates a new ListArtifactCompatibleServicesParams object -// with the default values initialized. +// 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 { - var () return &ListArtifactCompatibleServicesParams{ - timeout: cr.DefaultTimeout, } } // NewListArtifactCompatibleServicesParamsWithTimeout creates a new ListArtifactCompatibleServicesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListArtifactCompatibleServicesParamsWithTimeout(timeout time.Duration) *ListArtifactCompatibleServicesParams { - var () return &ListArtifactCompatibleServicesParams{ - timeout: timeout, } } // NewListArtifactCompatibleServicesParamsWithContext creates a new ListArtifactCompatibleServicesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListArtifactCompatibleServicesParamsWithContext(ctx context.Context) *ListArtifactCompatibleServicesParams { - var () return &ListArtifactCompatibleServicesParams{ - Context: ctx, } } // NewListArtifactCompatibleServicesParamsWithHTTPClient creates a new ListArtifactCompatibleServicesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListArtifactCompatibleServicesParamsWithHTTPClient(client *http.Client) *ListArtifactCompatibleServicesParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body ListArtifactCompatibleServicesBody timeout time.Duration @@ -68,6 +67,21 @@ type ListArtifactCompatibleServicesParams struct { 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) @@ -119,7 +133,6 @@ func (o *ListArtifactCompatibleServicesParams) WriteToRequest(r runtime.ClientRe return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/list_artifact_compatible_services_responses.go b/api/managementpb/backup/json/client/backups/list_artifact_compatible_services_responses.go index 5bdb6e86ec..c1acbb54d3 100644 --- a/api/managementpb/backup/json/client/backups/list_artifact_compatible_services_responses.go +++ b/api/managementpb/backup/json/client/backups/list_artifact_compatible_services_responses.go @@ -6,6 +6,7 @@ package backups // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewListArtifactCompatibleServicesOK() *ListArtifactCompatibleServicesOK { return &ListArtifactCompatibleServicesOK{} } -/*ListArtifactCompatibleServicesOK handles this case with default header values. +/* ListArtifactCompatibleServicesOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ListArtifactCompatibleServicesOK struct { func (o *ListArtifactCompatibleServicesOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/ListArtifactCompatibleServices][%d] listArtifactCompatibleServicesOk %+v", 200, o.Payload) } - func (o *ListArtifactCompatibleServicesOK) GetPayload() *ListArtifactCompatibleServicesOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewListArtifactCompatibleServicesDefault(code int) *ListArtifactCompatibleS } } -/*ListArtifactCompatibleServicesDefault handles this case with default header values. +/* ListArtifactCompatibleServicesDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *ListArtifactCompatibleServicesDefault) Code() int { func (o *ListArtifactCompatibleServicesDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/ListArtifactCompatibleServices][%d] ListArtifactCompatibleServices default %+v", o._statusCode, o.Payload) } - func (o *ListArtifactCompatibleServicesDefault) GetPayload() *ListArtifactCompatibleServicesDefaultBody { return o.Payload } @@ -131,6 +130,11 @@ func (o *ListArtifactCompatibleServicesBody) Validate(formats strfmt.Registry) e return nil } +// ContextValidate validates this list artifact compatible services body based on context it is used +func (o *ListArtifactCompatibleServicesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ListArtifactCompatibleServicesBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -164,7 +168,7 @@ type ListArtifactCompatibleServicesDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ListArtifactCompatibleServicesDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this list artifact compatible services default body @@ -182,7 +186,6 @@ func (o *ListArtifactCompatibleServicesDefaultBody) Validate(formats strfmt.Regi } func (o *ListArtifactCompatibleServicesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -196,6 +199,42 @@ func (o *ListArtifactCompatibleServicesDefaultBody) validateDetails(formats strf if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListArtifactCompatibleServices default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListArtifactCompatibleServices default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListArtifactCompatibleServices default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,16 +263,57 @@ func (o *ListArtifactCompatibleServicesDefaultBody) UnmarshalBinary(b []byte) er return nil } +/*ListArtifactCompatibleServicesDefaultBodyDetailsItems0 list artifact compatible services default body details items0 +swagger:model ListArtifactCompatibleServicesDefaultBodyDetailsItems0 +*/ +type ListArtifactCompatibleServicesDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 []*MysqlItems0 `json:"mysql"` + Mysql []*ListArtifactCompatibleServicesOKBodyMysqlItems0 `json:"mysql"` // mongodb - Mongodb []*MongodbItems0 `json:"mongodb"` + Mongodb []*ListArtifactCompatibleServicesOKBodyMongodbItems0 `json:"mongodb"` } // Validate validates this list artifact compatible services OK body @@ -255,7 +335,6 @@ func (o *ListArtifactCompatibleServicesOKBody) Validate(formats strfmt.Registry) } func (o *ListArtifactCompatibleServicesOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required return nil } @@ -269,6 +348,8 @@ func (o *ListArtifactCompatibleServicesOKBody) validateMysql(formats strfmt.Regi if err := o.Mysql[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listArtifactCompatibleServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listArtifactCompatibleServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) } return err } @@ -280,7 +361,6 @@ func (o *ListArtifactCompatibleServicesOKBody) validateMysql(formats strfmt.Regi } func (o *ListArtifactCompatibleServicesOKBody) validateMongodb(formats strfmt.Registry) error { - if swag.IsZero(o.Mongodb) { // not required return nil } @@ -294,6 +374,66 @@ func (o *ListArtifactCompatibleServicesOKBody) validateMongodb(formats strfmt.Re if err := o.Mongodb[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listArtifactCompatibleServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Mysql[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listArtifactCompatibleServicesOk" + "." + "mysql" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Mongodb[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listArtifactCompatibleServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listArtifactCompatibleServicesOk" + "." + "mongodb" + "." + strconv.Itoa(i)) } return err } @@ -322,10 +462,10 @@ func (o *ListArtifactCompatibleServicesOKBody) UnmarshalBinary(b []byte) error { return nil } -/*MongodbItems0 MongoDBService represents a generic MongoDB instance. -swagger:model MongodbItems0 +/*ListArtifactCompatibleServicesOKBodyMongodbItems0 MongoDBService represents a generic MongoDB instance. +swagger:model ListArtifactCompatibleServicesOKBodyMongodbItems0 */ -type MongodbItems0 struct { +type ListArtifactCompatibleServicesOKBodyMongodbItems0 struct { // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -361,13 +501,18 @@ type MongodbItems0 struct { CustomLabels map[string]string `json:"custom_labels,omitempty"` } -// Validate validates this mongodb items0 -func (o *MongodbItems0) Validate(formats strfmt.Registry) error { +// 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 *MongodbItems0) MarshalBinary() ([]byte, error) { +func (o *ListArtifactCompatibleServicesOKBodyMongodbItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -375,8 +520,8 @@ func (o *MongodbItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *MongodbItems0) UnmarshalBinary(b []byte) error { - var res MongodbItems0 +func (o *ListArtifactCompatibleServicesOKBodyMongodbItems0) UnmarshalBinary(b []byte) error { + var res ListArtifactCompatibleServicesOKBodyMongodbItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -384,10 +529,10 @@ func (o *MongodbItems0) UnmarshalBinary(b []byte) error { return nil } -/*MysqlItems0 MySQLService represents a generic MySQL instance. -swagger:model MysqlItems0 +/*ListArtifactCompatibleServicesOKBodyMysqlItems0 MySQLService represents a generic MySQL instance. +swagger:model ListArtifactCompatibleServicesOKBodyMysqlItems0 */ -type MysqlItems0 struct { +type ListArtifactCompatibleServicesOKBodyMysqlItems0 struct { // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` @@ -423,13 +568,18 @@ type MysqlItems0 struct { CustomLabels map[string]string `json:"custom_labels,omitempty"` } -// Validate validates this mysql items0 -func (o *MysqlItems0) Validate(formats strfmt.Registry) error { +// 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 *MysqlItems0) MarshalBinary() ([]byte, error) { +func (o *ListArtifactCompatibleServicesOKBodyMysqlItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -437,8 +587,8 @@ func (o *MysqlItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *MysqlItems0) UnmarshalBinary(b []byte) error { - var res MysqlItems0 +func (o *ListArtifactCompatibleServicesOKBodyMysqlItems0) UnmarshalBinary(b []byte) error { + var res ListArtifactCompatibleServicesOKBodyMysqlItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/list_scheduled_backups_parameters.go b/api/managementpb/backup/json/client/backups/list_scheduled_backups_parameters.go index 103f90dd1f..b154f81b5e 100644 --- a/api/managementpb/backup/json/client/backups/list_scheduled_backups_parameters.go +++ b/api/managementpb/backup/json/client/backups/list_scheduled_backups_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListScheduledBackupsParams creates a new ListScheduledBackupsParams object -// with the default values initialized. +// 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 { - var () return &ListScheduledBackupsParams{ - timeout: cr.DefaultTimeout, } } // NewListScheduledBackupsParamsWithTimeout creates a new ListScheduledBackupsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListScheduledBackupsParamsWithTimeout(timeout time.Duration) *ListScheduledBackupsParams { - var () return &ListScheduledBackupsParams{ - timeout: timeout, } } // NewListScheduledBackupsParamsWithContext creates a new ListScheduledBackupsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListScheduledBackupsParamsWithContext(ctx context.Context) *ListScheduledBackupsParams { - var () return &ListScheduledBackupsParams{ - Context: ctx, } } // NewListScheduledBackupsParamsWithHTTPClient creates a new ListScheduledBackupsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListScheduledBackupsParamsWithHTTPClient(client *http.Client) *ListScheduledBackupsParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type ListScheduledBackupsParams struct { 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) @@ -119,7 +133,6 @@ func (o *ListScheduledBackupsParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/managementpb/backup/json/client/backups/list_scheduled_backups_responses.go b/api/managementpb/backup/json/client/backups/list_scheduled_backups_responses.go index d2046b09ac..30b0d25b03 100644 --- a/api/managementpb/backup/json/client/backups/list_scheduled_backups_responses.go +++ b/api/managementpb/backup/json/client/backups/list_scheduled_backups_responses.go @@ -6,6 +6,7 @@ package backups // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListScheduledBackupsOK() *ListScheduledBackupsOK { return &ListScheduledBackupsOK{} } -/*ListScheduledBackupsOK handles this case with default header values. +/* ListScheduledBackupsOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListScheduledBackupsOK struct { func (o *ListScheduledBackupsOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/ListScheduled][%d] listScheduledBackupsOk %+v", 200, o.Payload) } - func (o *ListScheduledBackupsOK) GetPayload() *ListScheduledBackupsOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListScheduledBackupsDefault(code int) *ListScheduledBackupsDefault { } } -/*ListScheduledBackupsDefault handles this case with default header values. +/* ListScheduledBackupsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListScheduledBackupsDefault) Code() int { func (o *ListScheduledBackupsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/ListScheduled][%d] ListScheduledBackups default %+v", o._statusCode, o.Payload) } - func (o *ListScheduledBackupsDefault) GetPayload() *ListScheduledBackupsDefaultBody { return o.Payload } @@ -134,7 +133,7 @@ type ListScheduledBackupsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ListScheduledBackupsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this list scheduled backups default body @@ -152,7 +151,6 @@ func (o *ListScheduledBackupsDefaultBody) Validate(formats strfmt.Registry) erro } func (o *ListScheduledBackupsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -166,6 +164,42 @@ func (o *ListScheduledBackupsDefaultBody) validateDetails(formats strfmt.Registr if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListScheduledBackups default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListScheduledBackups default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListScheduledBackups default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -194,13 +228,54 @@ func (o *ListScheduledBackupsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ListScheduledBackupsDefaultBodyDetailsItems0 list scheduled backups default body details items0 +swagger:model ListScheduledBackupsDefaultBodyDetailsItems0 +*/ +type ListScheduledBackupsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 []*ScheduledBackupsItems0 `json:"scheduled_backups"` + ScheduledBackups []*ListScheduledBackupsOKBodyScheduledBackupsItems0 `json:"scheduled_backups"` } // Validate validates this list scheduled backups OK body @@ -218,7 +293,6 @@ func (o *ListScheduledBackupsOKBody) Validate(formats strfmt.Registry) error { } func (o *ListScheduledBackupsOKBody) validateScheduledBackups(formats strfmt.Registry) error { - if swag.IsZero(o.ScheduledBackups) { // not required return nil } @@ -232,6 +306,42 @@ func (o *ListScheduledBackupsOKBody) validateScheduledBackups(formats strfmt.Reg if err := o.ScheduledBackups[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listScheduledBackupsOk" + "." + "scheduled_backups" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.ScheduledBackups[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listScheduledBackupsOk" + "." + "scheduled_backups" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listScheduledBackupsOk" + "." + "scheduled_backups" + "." + strconv.Itoa(i)) } return err } @@ -260,10 +370,10 @@ func (o *ListScheduledBackupsOKBody) UnmarshalBinary(b []byte) error { return nil } -/*ScheduledBackupsItems0 ScheduledBackup represents scheduled task for backup. -swagger:model ScheduledBackupsItems0 +/*ListScheduledBackupsOKBodyScheduledBackupsItems0 ScheduledBackup represents scheduled task for backup. +swagger:model ListScheduledBackupsOKBodyScheduledBackupsItems0 */ -type ScheduledBackupsItems0 struct { +type ListScheduledBackupsOKBodyScheduledBackupsItems0 struct { // Machine-readable ID. ScheduledBackupID string `json:"scheduled_backup_id,omitempty"` @@ -302,10 +412,6 @@ type ScheduledBackupsItems0 struct { // If scheduling is enabled. Enabled bool `json:"enabled,omitempty"` - // DataModel is a model used for performing a backup. - // Enum: [DATA_MODEL_INVALID PHYSICAL LOGICAL] - DataModel *string `json:"data_model,omitempty"` - // Database vendor e.g. PostgreSQL, MongoDB, MySQL. Vendor string `json:"vendor,omitempty"` @@ -320,28 +426,32 @@ type ScheduledBackupsItems0 struct { // How many artifacts keep. 0 - unlimited. Retention int64 `json:"retention,omitempty"` + // DataModel is a model used for performing a backup. + // Enum: [DATA_MODEL_INVALID PHYSICAL LOGICAL] + DataModel *string `json:"data_model,omitempty"` + // BackupMode specifies backup mode. // Enum: [BACKUP_MODE_INVALID SNAPSHOT INCREMENTAL PITR] Mode *string `json:"mode,omitempty"` } -// Validate validates this scheduled backups items0 -func (o *ScheduledBackupsItems0) Validate(formats strfmt.Registry) error { +// 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 { + if err := o.validateLastRun(formats); err != nil { res = append(res, err) } - if err := o.validateLastRun(formats); err != nil { + if err := o.validateNextRun(formats); err != nil { res = append(res, err) } - if err := o.validateNextRun(formats); err != nil { + if err := o.validateDataModel(formats); err != nil { res = append(res, err) } @@ -355,8 +465,7 @@ func (o *ScheduledBackupsItems0) Validate(formats strfmt.Registry) error { return nil } -func (o *ScheduledBackupsItems0) validateStartTime(formats strfmt.Registry) error { - +func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) validateStartTime(formats strfmt.Registry) error { if swag.IsZero(o.StartTime) { // not required return nil } @@ -368,7 +477,31 @@ func (o *ScheduledBackupsItems0) validateStartTime(formats strfmt.Registry) erro return nil } -var scheduledBackupsItems0TypeDataModelPropEnum []interface{} +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 +} + +var listScheduledBackupsOkBodyScheduledBackupsItems0TypeDataModelPropEnum []interface{} func init() { var res []string @@ -376,32 +509,31 @@ func init() { panic(err) } for _, v := range res { - scheduledBackupsItems0TypeDataModelPropEnum = append(scheduledBackupsItems0TypeDataModelPropEnum, v) + listScheduledBackupsOkBodyScheduledBackupsItems0TypeDataModelPropEnum = append(listScheduledBackupsOkBodyScheduledBackupsItems0TypeDataModelPropEnum, v) } } const ( - // ScheduledBackupsItems0DataModelDATAMODELINVALID captures enum value "DATA_MODEL_INVALID" - ScheduledBackupsItems0DataModelDATAMODELINVALID string = "DATA_MODEL_INVALID" + // ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelDATAMODELINVALID captures enum value "DATA_MODEL_INVALID" + ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelDATAMODELINVALID string = "DATA_MODEL_INVALID" - // ScheduledBackupsItems0DataModelPHYSICAL captures enum value "PHYSICAL" - ScheduledBackupsItems0DataModelPHYSICAL string = "PHYSICAL" + // ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelPHYSICAL captures enum value "PHYSICAL" + ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelPHYSICAL string = "PHYSICAL" - // ScheduledBackupsItems0DataModelLOGICAL captures enum value "LOGICAL" - ScheduledBackupsItems0DataModelLOGICAL string = "LOGICAL" + // ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelLOGICAL captures enum value "LOGICAL" + ListScheduledBackupsOKBodyScheduledBackupsItems0DataModelLOGICAL string = "LOGICAL" ) // prop value enum -func (o *ScheduledBackupsItems0) validateDataModelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, scheduledBackupsItems0TypeDataModelPropEnum, true); err != nil { +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 *ScheduledBackupsItems0) validateDataModel(formats strfmt.Registry) error { - +func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) validateDataModel(formats strfmt.Registry) error { if swag.IsZero(o.DataModel) { // not required return nil } @@ -414,33 +546,7 @@ func (o *ScheduledBackupsItems0) validateDataModel(formats strfmt.Registry) erro return nil } -func (o *ScheduledBackupsItems0) 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 *ScheduledBackupsItems0) 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 -} - -var scheduledBackupsItems0TypeModePropEnum []interface{} +var listScheduledBackupsOkBodyScheduledBackupsItems0TypeModePropEnum []interface{} func init() { var res []string @@ -448,35 +554,34 @@ func init() { panic(err) } for _, v := range res { - scheduledBackupsItems0TypeModePropEnum = append(scheduledBackupsItems0TypeModePropEnum, v) + listScheduledBackupsOkBodyScheduledBackupsItems0TypeModePropEnum = append(listScheduledBackupsOkBodyScheduledBackupsItems0TypeModePropEnum, v) } } const ( - // ScheduledBackupsItems0ModeBACKUPMODEINVALID captures enum value "BACKUP_MODE_INVALID" - ScheduledBackupsItems0ModeBACKUPMODEINVALID string = "BACKUP_MODE_INVALID" + // ListScheduledBackupsOKBodyScheduledBackupsItems0ModeBACKUPMODEINVALID captures enum value "BACKUP_MODE_INVALID" + ListScheduledBackupsOKBodyScheduledBackupsItems0ModeBACKUPMODEINVALID string = "BACKUP_MODE_INVALID" - // ScheduledBackupsItems0ModeSNAPSHOT captures enum value "SNAPSHOT" - ScheduledBackupsItems0ModeSNAPSHOT string = "SNAPSHOT" + // ListScheduledBackupsOKBodyScheduledBackupsItems0ModeSNAPSHOT captures enum value "SNAPSHOT" + ListScheduledBackupsOKBodyScheduledBackupsItems0ModeSNAPSHOT string = "SNAPSHOT" - // ScheduledBackupsItems0ModeINCREMENTAL captures enum value "INCREMENTAL" - ScheduledBackupsItems0ModeINCREMENTAL string = "INCREMENTAL" + // ListScheduledBackupsOKBodyScheduledBackupsItems0ModeINCREMENTAL captures enum value "INCREMENTAL" + ListScheduledBackupsOKBodyScheduledBackupsItems0ModeINCREMENTAL string = "INCREMENTAL" - // ScheduledBackupsItems0ModePITR captures enum value "PITR" - ScheduledBackupsItems0ModePITR string = "PITR" + // ListScheduledBackupsOKBodyScheduledBackupsItems0ModePITR captures enum value "PITR" + ListScheduledBackupsOKBodyScheduledBackupsItems0ModePITR string = "PITR" ) // prop value enum -func (o *ScheduledBackupsItems0) validateModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, scheduledBackupsItems0TypeModePropEnum, true); err != nil { +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 *ScheduledBackupsItems0) validateMode(formats strfmt.Registry) error { - +func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) validateMode(formats strfmt.Registry) error { if swag.IsZero(o.Mode) { // not required return nil } @@ -489,8 +594,13 @@ func (o *ScheduledBackupsItems0) validateMode(formats strfmt.Registry) error { 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 *ScheduledBackupsItems0) MarshalBinary() ([]byte, error) { +func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -498,8 +608,8 @@ func (o *ScheduledBackupsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ScheduledBackupsItems0) UnmarshalBinary(b []byte) error { - var res ScheduledBackupsItems0 +func (o *ListScheduledBackupsOKBodyScheduledBackupsItems0) UnmarshalBinary(b []byte) error { + var res ListScheduledBackupsOKBodyScheduledBackupsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/remove_scheduled_backup_parameters.go b/api/managementpb/backup/json/client/backups/remove_scheduled_backup_parameters.go index d9c8b4b2f1..ce350f8f30 100644 --- a/api/managementpb/backup/json/client/backups/remove_scheduled_backup_parameters.go +++ b/api/managementpb/backup/json/client/backups/remove_scheduled_backup_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRemoveScheduledBackupParams creates a new RemoveScheduledBackupParams object -// with the default values initialized. +// 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 { - var () return &RemoveScheduledBackupParams{ - timeout: cr.DefaultTimeout, } } // NewRemoveScheduledBackupParamsWithTimeout creates a new RemoveScheduledBackupParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRemoveScheduledBackupParamsWithTimeout(timeout time.Duration) *RemoveScheduledBackupParams { - var () return &RemoveScheduledBackupParams{ - timeout: timeout, } } // NewRemoveScheduledBackupParamsWithContext creates a new RemoveScheduledBackupParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRemoveScheduledBackupParamsWithContext(ctx context.Context) *RemoveScheduledBackupParams { - var () return &RemoveScheduledBackupParams{ - Context: ctx, } } // NewRemoveScheduledBackupParamsWithHTTPClient creates a new RemoveScheduledBackupParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRemoveScheduledBackupParamsWithHTTPClient(client *http.Client) *RemoveScheduledBackupParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body RemoveScheduledBackupBody timeout time.Duration @@ -68,6 +67,21 @@ type RemoveScheduledBackupParams struct { 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) @@ -119,7 +133,6 @@ func (o *RemoveScheduledBackupParams) WriteToRequest(r runtime.ClientRequest, re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/remove_scheduled_backup_responses.go b/api/managementpb/backup/json/client/backups/remove_scheduled_backup_responses.go index f26560eb24..2f7c6f4a84 100644 --- a/api/managementpb/backup/json/client/backups/remove_scheduled_backup_responses.go +++ b/api/managementpb/backup/json/client/backups/remove_scheduled_backup_responses.go @@ -6,6 +6,7 @@ package backups // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewRemoveScheduledBackupOK() *RemoveScheduledBackupOK { return &RemoveScheduledBackupOK{} } -/*RemoveScheduledBackupOK handles this case with default header values. +/* RemoveScheduledBackupOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type RemoveScheduledBackupOK struct { func (o *RemoveScheduledBackupOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/RemoveScheduled][%d] removeScheduledBackupOk %+v", 200, o.Payload) } - func (o *RemoveScheduledBackupOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewRemoveScheduledBackupDefault(code int) *RemoveScheduledBackupDefault { } } -/*RemoveScheduledBackupDefault handles this case with default header values. +/* RemoveScheduledBackupDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *RemoveScheduledBackupDefault) Code() int { func (o *RemoveScheduledBackupDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/RemoveScheduled][%d] RemoveScheduledBackup default %+v", o._statusCode, o.Payload) } - func (o *RemoveScheduledBackupDefault) GetPayload() *RemoveScheduledBackupDefaultBody { return o.Payload } @@ -129,6 +128,11 @@ func (o *RemoveScheduledBackupBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this remove scheduled backup body based on context it is used +func (o *RemoveScheduledBackupBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *RemoveScheduledBackupBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -162,7 +166,7 @@ type RemoveScheduledBackupDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RemoveScheduledBackupDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this remove scheduled backup default body @@ -180,7 +184,6 @@ func (o *RemoveScheduledBackupDefaultBody) Validate(formats strfmt.Registry) err } func (o *RemoveScheduledBackupDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -194,6 +197,42 @@ func (o *RemoveScheduledBackupDefaultBody) validateDetails(formats strfmt.Regist if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RemoveScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RemoveScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RemoveScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -221,3 +260,44 @@ func (o *RemoveScheduledBackupDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*RemoveScheduledBackupDefaultBodyDetailsItems0 remove scheduled backup default body details items0 +swagger:model RemoveScheduledBackupDefaultBodyDetailsItems0 +*/ +type RemoveScheduledBackupDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/managementpb/backup/json/client/backups/restore_backup_parameters.go b/api/managementpb/backup/json/client/backups/restore_backup_parameters.go index 48a32d72dc..1e07e0d24f 100644 --- a/api/managementpb/backup/json/client/backups/restore_backup_parameters.go +++ b/api/managementpb/backup/json/client/backups/restore_backup_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRestoreBackupParams creates a new RestoreBackupParams object -// with the default values initialized. +// 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 { - var () return &RestoreBackupParams{ - timeout: cr.DefaultTimeout, } } // NewRestoreBackupParamsWithTimeout creates a new RestoreBackupParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRestoreBackupParamsWithTimeout(timeout time.Duration) *RestoreBackupParams { - var () return &RestoreBackupParams{ - timeout: timeout, } } // NewRestoreBackupParamsWithContext creates a new RestoreBackupParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRestoreBackupParamsWithContext(ctx context.Context) *RestoreBackupParams { - var () return &RestoreBackupParams{ - Context: ctx, } } // NewRestoreBackupParamsWithHTTPClient creates a new RestoreBackupParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRestoreBackupParamsWithHTTPClient(client *http.Client) *RestoreBackupParams { - var () 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 +/* 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. Body RestoreBackupBody timeout time.Duration @@ -68,6 +67,21 @@ type RestoreBackupParams struct { 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) @@ -119,7 +133,6 @@ func (o *RestoreBackupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/restore_backup_responses.go b/api/managementpb/backup/json/client/backups/restore_backup_responses.go index 601f84a71d..a59e640896 100644 --- a/api/managementpb/backup/json/client/backups/restore_backup_responses.go +++ b/api/managementpb/backup/json/client/backups/restore_backup_responses.go @@ -6,6 +6,7 @@ package backups // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewRestoreBackupOK() *RestoreBackupOK { return &RestoreBackupOK{} } -/*RestoreBackupOK handles this case with default header values. +/* RestoreBackupOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type RestoreBackupOK struct { func (o *RestoreBackupOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/Restore][%d] restoreBackupOk %+v", 200, o.Payload) } - func (o *RestoreBackupOK) GetPayload() *RestoreBackupOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewRestoreBackupDefault(code int) *RestoreBackupDefault { } } -/*RestoreBackupDefault handles this case with default header values. +/* RestoreBackupDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *RestoreBackupDefault) Code() int { func (o *RestoreBackupDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/Restore][%d] RestoreBackup default %+v", o._statusCode, o.Payload) } - func (o *RestoreBackupDefault) GetPayload() *RestoreBackupDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ func (o *RestoreBackupBody) Validate(formats strfmt.Registry) error { 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 { @@ -167,7 +171,7 @@ type RestoreBackupDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RestoreBackupDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this restore backup default body @@ -185,7 +189,6 @@ func (o *RestoreBackupDefaultBody) Validate(formats strfmt.Registry) error { } func (o *RestoreBackupDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *RestoreBackupDefaultBody) validateDetails(formats strfmt.Registry) erro if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RestoreBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RestoreBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RestoreBackup default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,6 +266,47 @@ func (o *RestoreBackupDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*RestoreBackupDefaultBodyDetailsItems0 restore backup default body details items0 +swagger:model RestoreBackupDefaultBodyDetailsItems0 +*/ +type RestoreBackupDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -241,6 +321,11 @@ 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 { diff --git a/api/managementpb/backup/json/client/backups/schedule_backup_parameters.go b/api/managementpb/backup/json/client/backups/schedule_backup_parameters.go index 016015242c..013bbdc305 100644 --- a/api/managementpb/backup/json/client/backups/schedule_backup_parameters.go +++ b/api/managementpb/backup/json/client/backups/schedule_backup_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewScheduleBackupParams creates a new ScheduleBackupParams object -// with the default values initialized. +// 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 { - var () return &ScheduleBackupParams{ - timeout: cr.DefaultTimeout, } } // NewScheduleBackupParamsWithTimeout creates a new ScheduleBackupParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewScheduleBackupParamsWithTimeout(timeout time.Duration) *ScheduleBackupParams { - var () return &ScheduleBackupParams{ - timeout: timeout, } } // NewScheduleBackupParamsWithContext creates a new ScheduleBackupParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewScheduleBackupParamsWithContext(ctx context.Context) *ScheduleBackupParams { - var () return &ScheduleBackupParams{ - Context: ctx, } } // NewScheduleBackupParamsWithHTTPClient creates a new ScheduleBackupParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewScheduleBackupParamsWithHTTPClient(client *http.Client) *ScheduleBackupParams { - var () 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 +/* 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. Body ScheduleBackupBody timeout time.Duration @@ -68,6 +67,21 @@ type ScheduleBackupParams struct { 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) @@ -119,7 +133,6 @@ func (o *ScheduleBackupParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/schedule_backup_responses.go b/api/managementpb/backup/json/client/backups/schedule_backup_responses.go index be8cd7dcdd..a93b7c2039 100644 --- a/api/managementpb/backup/json/client/backups/schedule_backup_responses.go +++ b/api/managementpb/backup/json/client/backups/schedule_backup_responses.go @@ -6,6 +6,7 @@ package backups // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewScheduleBackupOK() *ScheduleBackupOK { return &ScheduleBackupOK{} } -/*ScheduleBackupOK handles this case with default header values. +/* ScheduleBackupOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ScheduleBackupOK struct { func (o *ScheduleBackupOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/Schedule][%d] scheduleBackupOk %+v", 200, o.Payload) } - func (o *ScheduleBackupOK) GetPayload() *ScheduleBackupOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewScheduleBackupDefault(code int) *ScheduleBackupDefault { } } -/*ScheduleBackupDefault handles this case with default header values. +/* ScheduleBackupDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ScheduleBackupDefault) Code() int { func (o *ScheduleBackupDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/Schedule][%d] ScheduleBackup default %+v", o._statusCode, o.Payload) } - func (o *ScheduleBackupDefault) GetPayload() *ScheduleBackupDefaultBody { return o.Payload } @@ -179,7 +178,6 @@ func (o *ScheduleBackupBody) Validate(formats strfmt.Registry) error { } func (o *ScheduleBackupBody) validateStartTime(formats strfmt.Registry) error { - if swag.IsZero(o.StartTime) { // not required return nil } @@ -227,7 +225,6 @@ func (o *ScheduleBackupBody) validateModeEnum(path, location string, value strin } func (o *ScheduleBackupBody) validateMode(formats strfmt.Registry) error { - if swag.IsZero(o.Mode) { // not required return nil } @@ -240,6 +237,11 @@ func (o *ScheduleBackupBody) validateMode(formats strfmt.Registry) error { 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 { @@ -273,7 +275,7 @@ type ScheduleBackupDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ScheduleBackupDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this schedule backup default body @@ -291,7 +293,6 @@ func (o *ScheduleBackupDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ScheduleBackupDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -305,6 +306,42 @@ func (o *ScheduleBackupDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ScheduleBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ScheduleBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ScheduleBackup default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -333,6 +370,47 @@ func (o *ScheduleBackupDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ScheduleBackupDefaultBodyDetailsItems0 schedule backup default body details items0 +swagger:model ScheduleBackupDefaultBodyDetailsItems0 +*/ +type ScheduleBackupDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -347,6 +425,11 @@ 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 { diff --git a/api/managementpb/backup/json/client/backups/start_backup_parameters.go b/api/managementpb/backup/json/client/backups/start_backup_parameters.go index 732a0770c6..4e153695db 100644 --- a/api/managementpb/backup/json/client/backups/start_backup_parameters.go +++ b/api/managementpb/backup/json/client/backups/start_backup_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartBackupParams creates a new StartBackupParams object -// with the default values initialized. +// 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 { - var () return &StartBackupParams{ - timeout: cr.DefaultTimeout, } } // NewStartBackupParamsWithTimeout creates a new StartBackupParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartBackupParamsWithTimeout(timeout time.Duration) *StartBackupParams { - var () return &StartBackupParams{ - timeout: timeout, } } // NewStartBackupParamsWithContext creates a new StartBackupParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartBackupParamsWithContext(ctx context.Context) *StartBackupParams { - var () return &StartBackupParams{ - Context: ctx, } } // NewStartBackupParamsWithHTTPClient creates a new StartBackupParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartBackupParamsWithHTTPClient(client *http.Client) *StartBackupParams { - var () 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 +/* 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. Body StartBackupBody timeout time.Duration @@ -68,6 +67,21 @@ type StartBackupParams struct { 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) @@ -119,7 +133,6 @@ func (o *StartBackupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/backups/start_backup_responses.go b/api/managementpb/backup/json/client/backups/start_backup_responses.go index 9ea6364e26..9c2a7c8408 100644 --- a/api/managementpb/backup/json/client/backups/start_backup_responses.go +++ b/api/managementpb/backup/json/client/backups/start_backup_responses.go @@ -6,6 +6,7 @@ package backups // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartBackupOK() *StartBackupOK { return &StartBackupOK{} } -/*StartBackupOK handles this case with default header values. +/* StartBackupOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartBackupOK struct { func (o *StartBackupOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/Start][%d] startBackupOk %+v", 200, o.Payload) } - func (o *StartBackupOK) GetPayload() *StartBackupOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartBackupDefault(code int) *StartBackupDefault { } } -/*StartBackupDefault handles this case with default header values. +/* StartBackupDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartBackupDefault) Code() int { func (o *StartBackupDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Backups/Start][%d] StartBackup default %+v", o._statusCode, o.Payload) } - func (o *StartBackupDefault) GetPayload() *StartBackupDefaultBody { return o.Payload } @@ -146,6 +145,11 @@ func (o *StartBackupBody) Validate(formats strfmt.Registry) error { 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 { @@ -179,7 +183,7 @@ type StartBackupDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartBackupDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start backup default body @@ -197,7 +201,6 @@ func (o *StartBackupDefaultBody) Validate(formats strfmt.Registry) error { } func (o *StartBackupDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -211,6 +214,42 @@ func (o *StartBackupDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartBackup default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -239,6 +278,47 @@ func (o *StartBackupDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*StartBackupDefaultBodyDetailsItems0 start backup default body details items0 +swagger:model StartBackupDefaultBodyDetailsItems0 +*/ +type StartBackupDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -253,6 +333,11 @@ 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 { diff --git a/api/managementpb/backup/json/client/locations/add_location_parameters.go b/api/managementpb/backup/json/client/locations/add_location_parameters.go index 5a50718574..c068845f38 100644 --- a/api/managementpb/backup/json/client/locations/add_location_parameters.go +++ b/api/managementpb/backup/json/client/locations/add_location_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddLocationParams creates a new AddLocationParams object -// with the default values initialized. +// 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 { - var () return &AddLocationParams{ - timeout: cr.DefaultTimeout, } } // NewAddLocationParamsWithTimeout creates a new AddLocationParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddLocationParamsWithTimeout(timeout time.Duration) *AddLocationParams { - var () return &AddLocationParams{ - timeout: timeout, } } // NewAddLocationParamsWithContext creates a new AddLocationParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddLocationParamsWithContext(ctx context.Context) *AddLocationParams { - var () return &AddLocationParams{ - Context: ctx, } } // NewAddLocationParamsWithHTTPClient creates a new AddLocationParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddLocationParamsWithHTTPClient(client *http.Client) *AddLocationParams { - var () 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 +/* 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. Body AddLocationBody timeout time.Duration @@ -68,6 +67,21 @@ type AddLocationParams struct { 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) @@ -119,7 +133,6 @@ func (o *AddLocationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/locations/add_location_responses.go b/api/managementpb/backup/json/client/locations/add_location_responses.go index dab3cdbf7f..0dd72aa0a9 100644 --- a/api/managementpb/backup/json/client/locations/add_location_responses.go +++ b/api/managementpb/backup/json/client/locations/add_location_responses.go @@ -6,6 +6,7 @@ package locations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddLocationOK() *AddLocationOK { return &AddLocationOK{} } -/*AddLocationOK handles this case with default header values. +/* AddLocationOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddLocationOK struct { func (o *AddLocationOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Locations/Add][%d] addLocationOk %+v", 200, o.Payload) } - func (o *AddLocationOK) GetPayload() *AddLocationOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddLocationDefault(code int) *AddLocationDefault { } } -/*AddLocationDefault handles this case with default header values. +/* AddLocationDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddLocationDefault) Code() int { func (o *AddLocationDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Locations/Add][%d] AddLocation default %+v", o._statusCode, o.Payload) } - func (o *AddLocationDefault) GetPayload() *AddLocationDefaultBody { return o.Payload } @@ -161,7 +160,6 @@ func (o *AddLocationBody) Validate(formats strfmt.Registry) error { } func (o *AddLocationBody) validatePMMClientConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PMMClientConfig) { // not required return nil } @@ -170,6 +168,8 @@ func (o *AddLocationBody) validatePMMClientConfig(formats strfmt.Registry) error if err := o.PMMClientConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "pmm_client_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_client_config") } return err } @@ -179,7 +179,6 @@ func (o *AddLocationBody) validatePMMClientConfig(formats strfmt.Registry) error } func (o *AddLocationBody) validatePMMServerConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PMMServerConfig) { // not required return nil } @@ -188,6 +187,8 @@ func (o *AddLocationBody) validatePMMServerConfig(formats strfmt.Registry) error if err := o.PMMServerConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "pmm_server_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_server_config") } return err } @@ -197,7 +198,6 @@ func (o *AddLocationBody) validatePMMServerConfig(formats strfmt.Registry) error } func (o *AddLocationBody) validateS3Config(formats strfmt.Registry) error { - if swag.IsZero(o.S3Config) { // not required return nil } @@ -206,6 +206,78 @@ func (o *AddLocationBody) validateS3Config(formats strfmt.Registry) error { if err := o.S3Config.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "s3_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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.contextValidatePMMClientConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePMMServerConfig(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) contextValidatePMMClientConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PMMClientConfig != nil { + if err := o.PMMClientConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "pmm_client_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_client_config") + } + return err + } + } + + return nil +} + +func (o *AddLocationBody) contextValidatePMMServerConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PMMServerConfig != nil { + if err := o.PMMServerConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "pmm_server_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_server_config") + } + return err + } + } + + return nil +} + +func (o *AddLocationBody) contextValidateS3Config(ctx context.Context, formats strfmt.Registry) error { + + if o.S3Config != nil { + if err := o.S3Config.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "s3_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "s3_config") } return err } @@ -247,7 +319,7 @@ type AddLocationDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddLocationDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add location default body @@ -265,7 +337,6 @@ func (o *AddLocationDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddLocationDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -279,6 +350,42 @@ func (o *AddLocationDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddLocation default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddLocation default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddLocation default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -307,6 +414,47 @@ func (o *AddLocationDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddLocationDefaultBodyDetailsItems0 add location default body details items0 +swagger:model AddLocationDefaultBodyDetailsItems0 +*/ +type AddLocationDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -321,6 +469,11 @@ 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 { @@ -353,6 +506,11 @@ func (o *AddLocationParamsBodyPMMClientConfig) Validate(formats strfmt.Registry) return nil } +// ContextValidate validates this add location params body PMM client config based on context it is used +func (o *AddLocationParamsBodyPMMClientConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddLocationParamsBodyPMMClientConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -385,6 +543,11 @@ func (o *AddLocationParamsBodyPMMServerConfig) Validate(formats strfmt.Registry) return nil } +// ContextValidate validates this add location params body PMM server config based on context it is used +func (o *AddLocationParamsBodyPMMServerConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddLocationParamsBodyPMMServerConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -426,44 +589,13 @@ func (o *AddLocationParamsBodyS3Config) Validate(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 -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// 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 *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddLocationParamsBodyS3Config) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -471,8 +603,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddLocationParamsBodyS3Config) UnmarshalBinary(b []byte) error { + var res AddLocationParamsBodyS3Config if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/backup/json/client/locations/change_location_parameters.go b/api/managementpb/backup/json/client/locations/change_location_parameters.go index 91378afdf4..914da543f5 100644 --- a/api/managementpb/backup/json/client/locations/change_location_parameters.go +++ b/api/managementpb/backup/json/client/locations/change_location_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeLocationParams creates a new ChangeLocationParams object -// with the default values initialized. +// 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 { - var () return &ChangeLocationParams{ - timeout: cr.DefaultTimeout, } } // NewChangeLocationParamsWithTimeout creates a new ChangeLocationParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeLocationParamsWithTimeout(timeout time.Duration) *ChangeLocationParams { - var () return &ChangeLocationParams{ - timeout: timeout, } } // NewChangeLocationParamsWithContext creates a new ChangeLocationParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeLocationParamsWithContext(ctx context.Context) *ChangeLocationParams { - var () return &ChangeLocationParams{ - Context: ctx, } } // NewChangeLocationParamsWithHTTPClient creates a new ChangeLocationParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeLocationParamsWithHTTPClient(client *http.Client) *ChangeLocationParams { - var () 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 +/* 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. Body ChangeLocationBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeLocationParams struct { 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) @@ -119,7 +133,6 @@ func (o *ChangeLocationParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/locations/change_location_responses.go b/api/managementpb/backup/json/client/locations/change_location_responses.go index f32bd613b6..034fcbb7a3 100644 --- a/api/managementpb/backup/json/client/locations/change_location_responses.go +++ b/api/managementpb/backup/json/client/locations/change_location_responses.go @@ -6,6 +6,7 @@ package locations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewChangeLocationOK() *ChangeLocationOK { return &ChangeLocationOK{} } -/*ChangeLocationOK handles this case with default header values. +/* ChangeLocationOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ChangeLocationOK struct { func (o *ChangeLocationOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Locations/Change][%d] changeLocationOk %+v", 200, o.Payload) } - func (o *ChangeLocationOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewChangeLocationDefault(code int) *ChangeLocationDefault { } } -/*ChangeLocationDefault handles this case with default header values. +/* ChangeLocationDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *ChangeLocationDefault) Code() int { func (o *ChangeLocationDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Locations/Change][%d] ChangeLocation default %+v", o._statusCode, o.Payload) } - func (o *ChangeLocationDefault) GetPayload() *ChangeLocationDefaultBody { return o.Payload } @@ -162,7 +161,6 @@ func (o *ChangeLocationBody) Validate(formats strfmt.Registry) error { } func (o *ChangeLocationBody) validatePMMClientConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PMMClientConfig) { // not required return nil } @@ -171,6 +169,8 @@ func (o *ChangeLocationBody) validatePMMClientConfig(formats strfmt.Registry) er if err := o.PMMClientConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "pmm_client_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_client_config") } return err } @@ -180,7 +180,6 @@ func (o *ChangeLocationBody) validatePMMClientConfig(formats strfmt.Registry) er } func (o *ChangeLocationBody) validatePMMServerConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PMMServerConfig) { // not required return nil } @@ -189,6 +188,8 @@ func (o *ChangeLocationBody) validatePMMServerConfig(formats strfmt.Registry) er if err := o.PMMServerConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "pmm_server_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_server_config") } return err } @@ -198,7 +199,6 @@ func (o *ChangeLocationBody) validatePMMServerConfig(formats strfmt.Registry) er } func (o *ChangeLocationBody) validateS3Config(formats strfmt.Registry) error { - if swag.IsZero(o.S3Config) { // not required return nil } @@ -207,6 +207,78 @@ func (o *ChangeLocationBody) validateS3Config(formats strfmt.Registry) error { if err := o.S3Config.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "s3_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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.contextValidatePMMClientConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePMMServerConfig(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) contextValidatePMMClientConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PMMClientConfig != nil { + if err := o.PMMClientConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "pmm_client_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_client_config") + } + return err + } + } + + return nil +} + +func (o *ChangeLocationBody) contextValidatePMMServerConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PMMServerConfig != nil { + if err := o.PMMServerConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "pmm_server_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_server_config") + } + return err + } + } + + return nil +} + +func (o *ChangeLocationBody) contextValidateS3Config(ctx context.Context, formats strfmt.Registry) error { + + if o.S3Config != nil { + if err := o.S3Config.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "s3_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "s3_config") } return err } @@ -248,7 +320,7 @@ type ChangeLocationDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeLocationDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change location default body @@ -266,7 +338,6 @@ func (o *ChangeLocationDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ChangeLocationDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -280,6 +351,42 @@ func (o *ChangeLocationDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeLocation default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeLocation default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeLocation default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -308,6 +415,47 @@ func (o *ChangeLocationDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangeLocationDefaultBodyDetailsItems0 change location default body details items0 +swagger:model ChangeLocationDefaultBodyDetailsItems0 +*/ +type ChangeLocationDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 +} + /*ChangeLocationParamsBodyPMMClientConfig PMMClientLocationConfig represents file system config inside pmm-client. swagger:model ChangeLocationParamsBodyPMMClientConfig */ @@ -322,6 +470,11 @@ func (o *ChangeLocationParamsBodyPMMClientConfig) Validate(formats strfmt.Regist return nil } +// ContextValidate validates this change location params body PMM client config based on context it is used +func (o *ChangeLocationParamsBodyPMMClientConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeLocationParamsBodyPMMClientConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -354,6 +507,11 @@ func (o *ChangeLocationParamsBodyPMMServerConfig) Validate(formats strfmt.Regist return nil } +// ContextValidate validates this change location params body PMM server config based on context it is used +func (o *ChangeLocationParamsBodyPMMServerConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeLocationParamsBodyPMMServerConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -395,6 +553,11 @@ func (o *ChangeLocationParamsBodyS3Config) Validate(formats strfmt.Registry) err 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 { diff --git a/api/managementpb/backup/json/client/locations/list_locations_parameters.go b/api/managementpb/backup/json/client/locations/list_locations_parameters.go index 984466615e..dd468ab4f0 100644 --- a/api/managementpb/backup/json/client/locations/list_locations_parameters.go +++ b/api/managementpb/backup/json/client/locations/list_locations_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListLocationsParams creates a new ListLocationsParams object -// with the default values initialized. +// 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 { - var () return &ListLocationsParams{ - timeout: cr.DefaultTimeout, } } // NewListLocationsParamsWithTimeout creates a new ListLocationsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListLocationsParamsWithTimeout(timeout time.Duration) *ListLocationsParams { - var () return &ListLocationsParams{ - timeout: timeout, } } // NewListLocationsParamsWithContext creates a new ListLocationsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListLocationsParamsWithContext(ctx context.Context) *ListLocationsParams { - var () return &ListLocationsParams{ - Context: ctx, } } // NewListLocationsParamsWithHTTPClient creates a new ListLocationsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListLocationsParamsWithHTTPClient(client *http.Client) *ListLocationsParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type ListLocationsParams struct { 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) @@ -119,7 +133,6 @@ func (o *ListLocationsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/managementpb/backup/json/client/locations/list_locations_responses.go b/api/managementpb/backup/json/client/locations/list_locations_responses.go index daf135129e..08d921f16b 100644 --- a/api/managementpb/backup/json/client/locations/list_locations_responses.go +++ b/api/managementpb/backup/json/client/locations/list_locations_responses.go @@ -6,6 +6,7 @@ package locations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewListLocationsOK() *ListLocationsOK { return &ListLocationsOK{} } -/*ListLocationsOK handles this case with default header values. +/* ListLocationsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ListLocationsOK struct { func (o *ListLocationsOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Locations/List][%d] listLocationsOk %+v", 200, o.Payload) } - func (o *ListLocationsOK) GetPayload() *ListLocationsOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewListLocationsDefault(code int) *ListLocationsDefault { } } -/*ListLocationsDefault handles this case with default header values. +/* ListLocationsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *ListLocationsDefault) Code() int { func (o *ListLocationsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Locations/List][%d] ListLocations default %+v", o._statusCode, o.Payload) } - func (o *ListLocationsDefault) GetPayload() *ListLocationsDefaultBody { return o.Payload } @@ -132,7 +131,7 @@ type ListLocationsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ListLocationsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this list locations default body @@ -150,7 +149,6 @@ func (o *ListLocationsDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ListLocationsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -164,6 +162,42 @@ func (o *ListLocationsDefaultBody) validateDetails(formats strfmt.Registry) erro if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListLocations default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListLocations default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListLocations default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -192,13 +226,54 @@ func (o *ListLocationsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ListLocationsDefaultBodyDetailsItems0 list locations default body details items0 +swagger:model ListLocationsDefaultBodyDetailsItems0 +*/ +type ListLocationsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 []*LocationsItems0 `json:"locations"` + Locations []*ListLocationsOKBodyLocationsItems0 `json:"locations"` } // Validate validates this list locations OK body @@ -216,7 +291,6 @@ func (o *ListLocationsOKBody) Validate(formats strfmt.Registry) error { } func (o *ListLocationsOKBody) validateLocations(formats strfmt.Registry) error { - if swag.IsZero(o.Locations) { // not required return nil } @@ -230,6 +304,42 @@ func (o *ListLocationsOKBody) validateLocations(formats strfmt.Registry) error { if err := o.Locations[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listLocationsOk" + "." + "locations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Locations[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listLocationsOk" + "." + "locations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listLocationsOk" + "." + "locations" + "." + strconv.Itoa(i)) } return err } @@ -258,10 +368,10 @@ func (o *ListLocationsOKBody) UnmarshalBinary(b []byte) error { return nil } -/*LocationsItems0 Location represents single Backup Location. -swagger:model LocationsItems0 +/*ListLocationsOKBodyLocationsItems0 Location represents single Backup Location. +swagger:model ListLocationsOKBodyLocationsItems0 */ -type LocationsItems0 struct { +type ListLocationsOKBodyLocationsItems0 struct { // Machine-readable ID. LocationID string `json:"location_id,omitempty"` @@ -273,17 +383,17 @@ type LocationsItems0 struct { Description string `json:"description,omitempty"` // pmm client config - PMMClientConfig *LocationsItems0PMMClientConfig `json:"pmm_client_config,omitempty"` + PMMClientConfig *ListLocationsOKBodyLocationsItems0PMMClientConfig `json:"pmm_client_config,omitempty"` // pmm server config - PMMServerConfig *LocationsItems0PMMServerConfig `json:"pmm_server_config,omitempty"` + PMMServerConfig *ListLocationsOKBodyLocationsItems0PMMServerConfig `json:"pmm_server_config,omitempty"` // s3 config - S3Config *LocationsItems0S3Config `json:"s3_config,omitempty"` + S3Config *ListLocationsOKBodyLocationsItems0S3Config `json:"s3_config,omitempty"` } -// Validate validates this locations items0 -func (o *LocationsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list locations OK body locations items0 +func (o *ListLocationsOKBodyLocationsItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validatePMMClientConfig(formats); err != nil { @@ -304,8 +414,7 @@ func (o *LocationsItems0) Validate(formats strfmt.Registry) error { return nil } -func (o *LocationsItems0) validatePMMClientConfig(formats strfmt.Registry) error { - +func (o *ListLocationsOKBodyLocationsItems0) validatePMMClientConfig(formats strfmt.Registry) error { if swag.IsZero(o.PMMClientConfig) { // not required return nil } @@ -314,6 +423,8 @@ func (o *LocationsItems0) validatePMMClientConfig(formats strfmt.Registry) error if err := o.PMMClientConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pmm_client_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pmm_client_config") } return err } @@ -322,8 +433,7 @@ func (o *LocationsItems0) validatePMMClientConfig(formats strfmt.Registry) error return nil } -func (o *LocationsItems0) validatePMMServerConfig(formats strfmt.Registry) error { - +func (o *ListLocationsOKBodyLocationsItems0) validatePMMServerConfig(formats strfmt.Registry) error { if swag.IsZero(o.PMMServerConfig) { // not required return nil } @@ -332,6 +442,8 @@ func (o *LocationsItems0) validatePMMServerConfig(formats strfmt.Registry) error if err := o.PMMServerConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pmm_server_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pmm_server_config") } return err } @@ -340,8 +452,7 @@ func (o *LocationsItems0) validatePMMServerConfig(formats strfmt.Registry) error return nil } -func (o *LocationsItems0) validateS3Config(formats strfmt.Registry) error { - +func (o *ListLocationsOKBodyLocationsItems0) validateS3Config(formats strfmt.Registry) error { if swag.IsZero(o.S3Config) { // not required return nil } @@ -350,6 +461,78 @@ func (o *LocationsItems0) validateS3Config(formats strfmt.Registry) error { if err := o.S3Config.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("s3_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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.contextValidatePMMClientConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePMMServerConfig(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) contextValidatePMMClientConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PMMClientConfig != nil { + if err := o.PMMClientConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pmm_client_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pmm_client_config") + } + return err + } + } + + return nil +} + +func (o *ListLocationsOKBodyLocationsItems0) contextValidatePMMServerConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PMMServerConfig != nil { + if err := o.PMMServerConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pmm_server_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pmm_server_config") + } + return err + } + } + + return nil +} + +func (o *ListLocationsOKBodyLocationsItems0) contextValidateS3Config(ctx context.Context, formats strfmt.Registry) error { + + if o.S3Config != nil { + if err := o.S3Config.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("s3_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("s3_config") } return err } @@ -359,7 +542,7 @@ func (o *LocationsItems0) validateS3Config(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (o *LocationsItems0) MarshalBinary() ([]byte, error) { +func (o *ListLocationsOKBodyLocationsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -367,8 +550,8 @@ func (o *LocationsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *LocationsItems0) UnmarshalBinary(b []byte) error { - var res LocationsItems0 +func (o *ListLocationsOKBodyLocationsItems0) UnmarshalBinary(b []byte) error { + var res ListLocationsOKBodyLocationsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -376,22 +559,27 @@ func (o *LocationsItems0) UnmarshalBinary(b []byte) error { return nil } -/*LocationsItems0PMMClientConfig PMMClientLocationConfig represents file system config inside pmm-client. -swagger:model LocationsItems0PMMClientConfig +/*ListLocationsOKBodyLocationsItems0PMMClientConfig PMMClientLocationConfig represents file system config inside pmm-client. +swagger:model ListLocationsOKBodyLocationsItems0PMMClientConfig */ -type LocationsItems0PMMClientConfig struct { +type ListLocationsOKBodyLocationsItems0PMMClientConfig struct { // path Path string `json:"path,omitempty"` } -// Validate validates this locations items0 PMM client config -func (o *LocationsItems0PMMClientConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list locations OK body locations items0 PMM client config +func (o *ListLocationsOKBodyLocationsItems0PMMClientConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list locations OK body locations items0 PMM client config based on context it is used +func (o *ListLocationsOKBodyLocationsItems0PMMClientConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *LocationsItems0PMMClientConfig) MarshalBinary() ([]byte, error) { +func (o *ListLocationsOKBodyLocationsItems0PMMClientConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -399,8 +587,8 @@ func (o *LocationsItems0PMMClientConfig) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *LocationsItems0PMMClientConfig) UnmarshalBinary(b []byte) error { - var res LocationsItems0PMMClientConfig +func (o *ListLocationsOKBodyLocationsItems0PMMClientConfig) UnmarshalBinary(b []byte) error { + var res ListLocationsOKBodyLocationsItems0PMMClientConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -408,22 +596,27 @@ func (o *LocationsItems0PMMClientConfig) UnmarshalBinary(b []byte) error { return nil } -/*LocationsItems0PMMServerConfig PMMServerLocationConfig represents file system config inside pmm-server. -swagger:model LocationsItems0PMMServerConfig +/*ListLocationsOKBodyLocationsItems0PMMServerConfig PMMServerLocationConfig represents file system config inside pmm-server. +swagger:model ListLocationsOKBodyLocationsItems0PMMServerConfig */ -type LocationsItems0PMMServerConfig struct { +type ListLocationsOKBodyLocationsItems0PMMServerConfig struct { // path Path string `json:"path,omitempty"` } -// Validate validates this locations items0 PMM server config -func (o *LocationsItems0PMMServerConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list locations OK body locations items0 PMM server config +func (o *ListLocationsOKBodyLocationsItems0PMMServerConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list locations OK body locations items0 PMM server config based on context it is used +func (o *ListLocationsOKBodyLocationsItems0PMMServerConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *LocationsItems0PMMServerConfig) MarshalBinary() ([]byte, error) { +func (o *ListLocationsOKBodyLocationsItems0PMMServerConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -431,8 +624,8 @@ func (o *LocationsItems0PMMServerConfig) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *LocationsItems0PMMServerConfig) UnmarshalBinary(b []byte) error { - var res LocationsItems0PMMServerConfig +func (o *ListLocationsOKBodyLocationsItems0PMMServerConfig) UnmarshalBinary(b []byte) error { + var res ListLocationsOKBodyLocationsItems0PMMServerConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -440,10 +633,10 @@ func (o *LocationsItems0PMMServerConfig) UnmarshalBinary(b []byte) error { return nil } -/*LocationsItems0S3Config S3LocationConfig represents S3 bucket configuration. -swagger:model LocationsItems0S3Config +/*ListLocationsOKBodyLocationsItems0S3Config S3LocationConfig represents S3 bucket configuration. +swagger:model ListLocationsOKBodyLocationsItems0S3Config */ -type LocationsItems0S3Config struct { +type ListLocationsOKBodyLocationsItems0S3Config struct { // endpoint Endpoint string `json:"endpoint,omitempty"` @@ -458,13 +651,18 @@ type LocationsItems0S3Config struct { BucketName string `json:"bucket_name,omitempty"` } -// Validate validates this locations items0 s3 config -func (o *LocationsItems0S3Config) Validate(formats strfmt.Registry) error { +// 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 *LocationsItems0S3Config) MarshalBinary() ([]byte, error) { +func (o *ListLocationsOKBodyLocationsItems0S3Config) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -472,8 +670,8 @@ func (o *LocationsItems0S3Config) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *LocationsItems0S3Config) UnmarshalBinary(b []byte) error { - var res LocationsItems0S3Config +func (o *ListLocationsOKBodyLocationsItems0S3Config) UnmarshalBinary(b []byte) error { + var res ListLocationsOKBodyLocationsItems0S3Config if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/backup/json/client/locations/locations_client.go b/api/managementpb/backup/json/client/locations/locations_client.go index ea6c5c12de..79ab67cc7a 100644 --- a/api/managementpb/backup/json/client/locations/locations_client.go +++ b/api/managementpb/backup/json/client/locations/locations_client.go @@ -23,17 +23,20 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddLocation(params *AddLocationParams) (*AddLocationOK, error) + AddLocation(params *AddLocationParams, opts ...ClientOption) (*AddLocationOK, error) - ChangeLocation(params *ChangeLocationParams) (*ChangeLocationOK, error) + ChangeLocation(params *ChangeLocationParams, opts ...ClientOption) (*ChangeLocationOK, error) - ListLocations(params *ListLocationsParams) (*ListLocationsOK, error) + ListLocations(params *ListLocationsParams, opts ...ClientOption) (*ListLocationsOK, error) - RemoveLocation(params *RemoveLocationParams) (*RemoveLocationOK, error) + RemoveLocation(params *RemoveLocationParams, opts ...ClientOption) (*RemoveLocationOK, error) - TestLocationConfig(params *TestLocationConfigParams) (*TestLocationConfigOK, error) + TestLocationConfig(params *TestLocationConfigParams, opts ...ClientOption) (*TestLocationConfigOK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { /* AddLocation adds location adds backup location */ -func (a *Client) AddLocation(params *AddLocationParams) (*AddLocationOK, error) { +func (a *Client) AddLocation(params *AddLocationParams, opts ...ClientOption) (*AddLocationOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddLocationParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddLocation", Method: "POST", PathPattern: "/v1/management/backup/Locations/Add", @@ -58,7 +60,12 @@ func (a *Client) AddLocation(params *AddLocationParams) (*AddLocationOK, error) 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 } @@ -74,13 +81,12 @@ func (a *Client) AddLocation(params *AddLocationParams) (*AddLocationOK, error) /* ChangeLocation changes location changes backup location */ -func (a *Client) ChangeLocation(params *ChangeLocationParams) (*ChangeLocationOK, error) { +func (a *Client) ChangeLocation(params *ChangeLocationParams, opts ...ClientOption) (*ChangeLocationOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeLocationParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeLocation", Method: "POST", PathPattern: "/v1/management/backup/Locations/Change", @@ -91,7 +97,12 @@ func (a *Client) ChangeLocation(params *ChangeLocationParams) (*ChangeLocationOK 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 } @@ -107,13 +118,12 @@ func (a *Client) ChangeLocation(params *ChangeLocationParams) (*ChangeLocationOK /* ListLocations lists locations returns a list of all backup locations */ -func (a *Client) ListLocations(params *ListLocationsParams) (*ListLocationsOK, error) { +func (a *Client) ListLocations(params *ListLocationsParams, opts ...ClientOption) (*ListLocationsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListLocationsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListLocations", Method: "POST", PathPattern: "/v1/management/backup/Locations/List", @@ -124,7 +134,12 @@ func (a *Client) ListLocations(params *ListLocationsParams) (*ListLocationsOK, e 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 } @@ -140,13 +155,12 @@ func (a *Client) ListLocations(params *ListLocationsParams) (*ListLocationsOK, e /* RemoveLocation removes location removes existing backup location */ -func (a *Client) RemoveLocation(params *RemoveLocationParams) (*RemoveLocationOK, error) { +func (a *Client) RemoveLocation(params *RemoveLocationParams, opts ...ClientOption) (*RemoveLocationOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRemoveLocationParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RemoveLocation", Method: "POST", PathPattern: "/v1/management/backup/Locations/Remove", @@ -157,7 +171,12 @@ func (a *Client) RemoveLocation(params *RemoveLocationParams) (*RemoveLocationOK 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 } @@ -173,13 +192,12 @@ func (a *Client) RemoveLocation(params *RemoveLocationParams) (*RemoveLocationOK /* TestLocationConfig tests location config tests backup location and credentials */ -func (a *Client) TestLocationConfig(params *TestLocationConfigParams) (*TestLocationConfigOK, error) { +func (a *Client) TestLocationConfig(params *TestLocationConfigParams, opts ...ClientOption) (*TestLocationConfigOK, error) { // TODO: Validate the params before sending if params == nil { params = NewTestLocationConfigParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "TestLocationConfig", Method: "POST", PathPattern: "/v1/management/backup/Locations/TestConfig", @@ -190,7 +208,12 @@ func (a *Client) TestLocationConfig(params *TestLocationConfigParams) (*TestLoca 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 } diff --git a/api/managementpb/backup/json/client/locations/remove_location_parameters.go b/api/managementpb/backup/json/client/locations/remove_location_parameters.go index 793410ed6c..4b58ab00e4 100644 --- a/api/managementpb/backup/json/client/locations/remove_location_parameters.go +++ b/api/managementpb/backup/json/client/locations/remove_location_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRemoveLocationParams creates a new RemoveLocationParams object -// with the default values initialized. +// 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 { - var () return &RemoveLocationParams{ - timeout: cr.DefaultTimeout, } } // NewRemoveLocationParamsWithTimeout creates a new RemoveLocationParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRemoveLocationParamsWithTimeout(timeout time.Duration) *RemoveLocationParams { - var () return &RemoveLocationParams{ - timeout: timeout, } } // NewRemoveLocationParamsWithContext creates a new RemoveLocationParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRemoveLocationParamsWithContext(ctx context.Context) *RemoveLocationParams { - var () return &RemoveLocationParams{ - Context: ctx, } } // NewRemoveLocationParamsWithHTTPClient creates a new RemoveLocationParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRemoveLocationParamsWithHTTPClient(client *http.Client) *RemoveLocationParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body RemoveLocationBody timeout time.Duration @@ -68,6 +67,21 @@ type RemoveLocationParams struct { 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) @@ -119,7 +133,6 @@ func (o *RemoveLocationParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/locations/remove_location_responses.go b/api/managementpb/backup/json/client/locations/remove_location_responses.go index fe904cc67f..f669f31890 100644 --- a/api/managementpb/backup/json/client/locations/remove_location_responses.go +++ b/api/managementpb/backup/json/client/locations/remove_location_responses.go @@ -6,6 +6,7 @@ package locations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewRemoveLocationOK() *RemoveLocationOK { return &RemoveLocationOK{} } -/*RemoveLocationOK handles this case with default header values. +/* RemoveLocationOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type RemoveLocationOK struct { func (o *RemoveLocationOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Locations/Remove][%d] removeLocationOk %+v", 200, o.Payload) } - func (o *RemoveLocationOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewRemoveLocationDefault(code int) *RemoveLocationDefault { } } -/*RemoveLocationDefault handles this case with default header values. +/* RemoveLocationDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *RemoveLocationDefault) Code() int { func (o *RemoveLocationDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Locations/Remove][%d] RemoveLocation default %+v", o._statusCode, o.Payload) } - func (o *RemoveLocationDefault) GetPayload() *RemoveLocationDefaultBody { return o.Payload } @@ -132,6 +131,11 @@ func (o *RemoveLocationBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this remove location body based on context it is used +func (o *RemoveLocationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *RemoveLocationBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -165,7 +169,7 @@ type RemoveLocationDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RemoveLocationDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this remove location default body @@ -183,7 +187,6 @@ func (o *RemoveLocationDefaultBody) Validate(formats strfmt.Registry) error { } func (o *RemoveLocationDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -197,6 +200,42 @@ func (o *RemoveLocationDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RemoveLocation default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RemoveLocation default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RemoveLocation default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,3 +263,44 @@ func (o *RemoveLocationDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*RemoveLocationDefaultBodyDetailsItems0 remove location default body details items0 +swagger:model RemoveLocationDefaultBodyDetailsItems0 +*/ +type RemoveLocationDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/managementpb/backup/json/client/locations/test_location_config_parameters.go b/api/managementpb/backup/json/client/locations/test_location_config_parameters.go index fa42cb89c1..0daa25bc1e 100644 --- a/api/managementpb/backup/json/client/locations/test_location_config_parameters.go +++ b/api/managementpb/backup/json/client/locations/test_location_config_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewTestLocationConfigParams creates a new TestLocationConfigParams object -// with the default values initialized. +// 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 { - var () return &TestLocationConfigParams{ - timeout: cr.DefaultTimeout, } } // NewTestLocationConfigParamsWithTimeout creates a new TestLocationConfigParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewTestLocationConfigParamsWithTimeout(timeout time.Duration) *TestLocationConfigParams { - var () return &TestLocationConfigParams{ - timeout: timeout, } } // NewTestLocationConfigParamsWithContext creates a new TestLocationConfigParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewTestLocationConfigParamsWithContext(ctx context.Context) *TestLocationConfigParams { - var () return &TestLocationConfigParams{ - Context: ctx, } } // NewTestLocationConfigParamsWithHTTPClient creates a new TestLocationConfigParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewTestLocationConfigParamsWithHTTPClient(client *http.Client) *TestLocationConfigParams { - var () 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 +/* 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. Body TestLocationConfigBody timeout time.Duration @@ -68,6 +67,21 @@ type TestLocationConfigParams struct { 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) @@ -119,7 +133,6 @@ func (o *TestLocationConfigParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/backup/json/client/locations/test_location_config_responses.go b/api/managementpb/backup/json/client/locations/test_location_config_responses.go index 7223c8c9cc..d3af154e38 100644 --- a/api/managementpb/backup/json/client/locations/test_location_config_responses.go +++ b/api/managementpb/backup/json/client/locations/test_location_config_responses.go @@ -6,6 +6,7 @@ package locations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewTestLocationConfigOK() *TestLocationConfigOK { return &TestLocationConfigOK{} } -/*TestLocationConfigOK handles this case with default header values. +/* TestLocationConfigOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type TestLocationConfigOK struct { func (o *TestLocationConfigOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Locations/TestConfig][%d] testLocationConfigOk %+v", 200, o.Payload) } - func (o *TestLocationConfigOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewTestLocationConfigDefault(code int) *TestLocationConfigDefault { } } -/*TestLocationConfigDefault handles this case with default header values. +/* TestLocationConfigDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *TestLocationConfigDefault) Code() int { func (o *TestLocationConfigDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/Locations/TestConfig][%d] TestLocationConfig default %+v", o._statusCode, o.Payload) } - func (o *TestLocationConfigDefault) GetPayload() *TestLocationConfigDefaultBody { return o.Payload } @@ -153,7 +152,6 @@ func (o *TestLocationConfigBody) Validate(formats strfmt.Registry) error { } func (o *TestLocationConfigBody) validatePMMClientConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PMMClientConfig) { // not required return nil } @@ -162,6 +160,8 @@ func (o *TestLocationConfigBody) validatePMMClientConfig(formats strfmt.Registry if err := o.PMMClientConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "pmm_client_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_client_config") } return err } @@ -171,7 +171,6 @@ func (o *TestLocationConfigBody) validatePMMClientConfig(formats strfmt.Registry } func (o *TestLocationConfigBody) validatePMMServerConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PMMServerConfig) { // not required return nil } @@ -180,6 +179,8 @@ func (o *TestLocationConfigBody) validatePMMServerConfig(formats strfmt.Registry if err := o.PMMServerConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "pmm_server_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_server_config") } return err } @@ -189,7 +190,6 @@ func (o *TestLocationConfigBody) validatePMMServerConfig(formats strfmt.Registry } func (o *TestLocationConfigBody) validateS3Config(formats strfmt.Registry) error { - if swag.IsZero(o.S3Config) { // not required return nil } @@ -198,6 +198,78 @@ func (o *TestLocationConfigBody) validateS3Config(formats strfmt.Registry) error if err := o.S3Config.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "s3_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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.contextValidatePMMClientConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePMMServerConfig(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) contextValidatePMMClientConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PMMClientConfig != nil { + if err := o.PMMClientConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "pmm_client_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_client_config") + } + return err + } + } + + return nil +} + +func (o *TestLocationConfigBody) contextValidatePMMServerConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PMMServerConfig != nil { + if err := o.PMMServerConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "pmm_server_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pmm_server_config") + } + return err + } + } + + return nil +} + +func (o *TestLocationConfigBody) contextValidateS3Config(ctx context.Context, formats strfmt.Registry) error { + + if o.S3Config != nil { + if err := o.S3Config.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "s3_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "s3_config") } return err } @@ -239,7 +311,7 @@ type TestLocationConfigDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*TestLocationConfigDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this test location config default body @@ -257,7 +329,6 @@ func (o *TestLocationConfigDefaultBody) Validate(formats strfmt.Registry) error } func (o *TestLocationConfigDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -271,6 +342,42 @@ func (o *TestLocationConfigDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("TestLocationConfig default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TestLocationConfig default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("TestLocationConfig default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -299,6 +406,47 @@ func (o *TestLocationConfigDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*TestLocationConfigDefaultBodyDetailsItems0 test location config default body details items0 +swagger:model TestLocationConfigDefaultBodyDetailsItems0 +*/ +type TestLocationConfigDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 +} + /*TestLocationConfigParamsBodyPMMClientConfig PMMClientLocationConfig represents file system config inside pmm-client. swagger:model TestLocationConfigParamsBodyPMMClientConfig */ @@ -313,6 +461,11 @@ func (o *TestLocationConfigParamsBodyPMMClientConfig) Validate(formats strfmt.Re return nil } +// ContextValidate validates this test location config params body PMM client config based on context it is used +func (o *TestLocationConfigParamsBodyPMMClientConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *TestLocationConfigParamsBodyPMMClientConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -345,6 +498,11 @@ func (o *TestLocationConfigParamsBodyPMMServerConfig) Validate(formats strfmt.Re return nil } +// ContextValidate validates this test location config params body PMM server config based on context it is used +func (o *TestLocationConfigParamsBodyPMMServerConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *TestLocationConfigParamsBodyPMMServerConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -386,6 +544,11 @@ func (o *TestLocationConfigParamsBodyS3Config) Validate(formats strfmt.Registry) 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 { diff --git a/api/managementpb/backup/json/client/pmm_backup_management_client.go b/api/managementpb/backup/json/client/pmm_backup_management_api_client.go similarity index 86% rename from api/managementpb/backup/json/client/pmm_backup_management_client.go rename to api/managementpb/backup/json/client/pmm_backup_management_api_client.go index 57bb016614..df79777009 100644 --- a/api/managementpb/backup/json/client/pmm_backup_management_client.go +++ b/api/managementpb/backup/json/client/pmm_backup_management_api_client.go @@ -16,7 +16,7 @@ import ( "github.com/percona/pmm/api/managementpb/backup/json/client/restore_history" ) -// Default PMM backup management HTTP client. +// Default PMM backup management API HTTP client. var Default = NewHTTPClient(nil) const ( @@ -31,14 +31,14 @@ const ( // 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 HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMBackupManagement { +// 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 HTTP client, +// NewHTTPClientWithConfig creates a new PMM backup management API HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMBackupManagement { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMBackupManagementAPI { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -49,14 +49,14 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMM return New(transport, formats) } -// New creates a new PMM backup management client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMBackupManagement { +// 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(PMMBackupManagement) + cli := new(PMMBackupManagementAPI) cli.Transport = transport cli.Artifacts = artifacts.New(transport, formats) cli.Backups = backups.New(transport, formats) @@ -104,8 +104,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// PMMBackupManagement is a client for PMM backup management -type PMMBackupManagement struct { +// PMMBackupManagementAPI is a client for PMM backup management API +type PMMBackupManagementAPI struct { Artifacts artifacts.ClientService Backups backups.ClientService @@ -118,7 +118,7 @@ type PMMBackupManagement struct { } // SetTransport changes the transport on the client and all its subresources -func (c *PMMBackupManagement) SetTransport(transport runtime.ClientTransport) { +func (c *PMMBackupManagementAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Artifacts.SetTransport(transport) c.Backups.SetTransport(transport) diff --git a/api/managementpb/backup/json/client/restore_history/list_restore_history_parameters.go b/api/managementpb/backup/json/client/restore_history/list_restore_history_parameters.go index d719e54375..a0d272e264 100644 --- a/api/managementpb/backup/json/client/restore_history/list_restore_history_parameters.go +++ b/api/managementpb/backup/json/client/restore_history/list_restore_history_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListRestoreHistoryParams creates a new ListRestoreHistoryParams object -// with the default values initialized. +// NewListRestoreHistoryParams creates a new ListRestoreHistoryParams 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 NewListRestoreHistoryParams() *ListRestoreHistoryParams { - var () return &ListRestoreHistoryParams{ - timeout: cr.DefaultTimeout, } } // NewListRestoreHistoryParamsWithTimeout creates a new ListRestoreHistoryParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListRestoreHistoryParamsWithTimeout(timeout time.Duration) *ListRestoreHistoryParams { - var () return &ListRestoreHistoryParams{ - timeout: timeout, } } // NewListRestoreHistoryParamsWithContext creates a new ListRestoreHistoryParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListRestoreHistoryParamsWithContext(ctx context.Context) *ListRestoreHistoryParams { - var () return &ListRestoreHistoryParams{ - Context: ctx, } } // NewListRestoreHistoryParamsWithHTTPClient creates a new ListRestoreHistoryParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListRestoreHistoryParamsWithHTTPClient(client *http.Client) *ListRestoreHistoryParams { - var () return &ListRestoreHistoryParams{ HTTPClient: client, } } -/*ListRestoreHistoryParams contains all the parameters to send to the API endpoint -for the list restore history operation typically these are written to a http.Request +/* ListRestoreHistoryParams contains all the parameters to send to the API endpoint + for the list restore history operation. + + Typically these are written to a http.Request. */ type ListRestoreHistoryParams struct { - /*Body*/ + // Body. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type ListRestoreHistoryParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list restore history params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRestoreHistoryParams) WithDefaults() *ListRestoreHistoryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list restore history params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRestoreHistoryParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list restore history params func (o *ListRestoreHistoryParams) WithTimeout(timeout time.Duration) *ListRestoreHistoryParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ListRestoreHistoryParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/managementpb/backup/json/client/restore_history/list_restore_history_responses.go b/api/managementpb/backup/json/client/restore_history/list_restore_history_responses.go index 55ddcf780e..88b64e8728 100644 --- a/api/managementpb/backup/json/client/restore_history/list_restore_history_responses.go +++ b/api/managementpb/backup/json/client/restore_history/list_restore_history_responses.go @@ -6,6 +6,7 @@ package restore_history // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListRestoreHistoryOK() *ListRestoreHistoryOK { return &ListRestoreHistoryOK{} } -/*ListRestoreHistoryOK handles this case with default header values. +/* ListRestoreHistoryOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListRestoreHistoryOK struct { func (o *ListRestoreHistoryOK) Error() string { return fmt.Sprintf("[POST /v1/management/backup/RestoreHistory/List][%d] listRestoreHistoryOk %+v", 200, o.Payload) } - func (o *ListRestoreHistoryOK) GetPayload() *ListRestoreHistoryOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListRestoreHistoryDefault(code int) *ListRestoreHistoryDefault { } } -/*ListRestoreHistoryDefault handles this case with default header values. +/* ListRestoreHistoryDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListRestoreHistoryDefault) Code() int { func (o *ListRestoreHistoryDefault) Error() string { return fmt.Sprintf("[POST /v1/management/backup/RestoreHistory/List][%d] ListRestoreHistory default %+v", o._statusCode, o.Payload) } - func (o *ListRestoreHistoryDefault) GetPayload() *ListRestoreHistoryDefaultBody { return o.Payload } @@ -119,10 +118,120 @@ func (o *ListRestoreHistoryDefault) readResponse(response runtime.ClientResponse return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*ListRestoreHistoryDefaultBody list restore history default body +swagger:model ListRestoreHistoryDefaultBody +*/ +type ListRestoreHistoryDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*ListRestoreHistoryDefaultBodyDetailsItems0 `json:"details"` +} + +// Validate validates this list restore history default body +func (o *ListRestoreHistoryDefaultBody) 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 *ListRestoreHistoryDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListRestoreHistory default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListRestoreHistory default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list restore history default body based on the context it is used +func (o *ListRestoreHistoryDefaultBody) 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 *ListRestoreHistoryDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListRestoreHistory default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListRestoreHistory default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ListRestoreHistoryDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListRestoreHistoryDefaultBody) UnmarshalBinary(b []byte) error { + var res ListRestoreHistoryDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListRestoreHistoryDefaultBodyDetailsItems0 list restore history default body details items0 +swagger:model ListRestoreHistoryDefaultBodyDetailsItems0 */ -type DetailsItems0 struct { +type ListRestoreHistoryDefaultBodyDetailsItems0 struct { // type url TypeURL string `json:"type_url,omitempty"` @@ -132,13 +241,119 @@ type DetailsItems0 struct { Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list restore history default body details items0 +func (o *ListRestoreHistoryDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list restore history default body details items0 based on context it is used +func (o *ListRestoreHistoryDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListRestoreHistoryDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListRestoreHistoryDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ListRestoreHistoryDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListRestoreHistoryOKBody list restore history OK body +swagger:model ListRestoreHistoryOKBody +*/ +type ListRestoreHistoryOKBody struct { + + // items + Items []*ListRestoreHistoryOKBodyItemsItems0 `json:"items"` +} + +// Validate validates this list restore history OK body +func (o *ListRestoreHistoryOKBody) 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 *ListRestoreHistoryOKBody) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listRestoreHistoryOk" + "." + "items" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listRestoreHistoryOk" + "." + "items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list restore history OK body based on the context it is used +func (o *ListRestoreHistoryOKBody) 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 *ListRestoreHistoryOKBody) contextValidateItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Items); i++ { + + if o.Items[i] != nil { + if err := o.Items[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listRestoreHistoryOk" + "." + "items" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listRestoreHistoryOk" + "." + "items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *ListRestoreHistoryOKBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -146,8 +361,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *ListRestoreHistoryOKBody) UnmarshalBinary(b []byte) error { + var res ListRestoreHistoryOKBody if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -155,10 +370,10 @@ func (o *DetailsItems0) UnmarshalBinary(b []byte) error { return nil } -/*ItemsItems0 RestoreHistoryItem represents single backup restore item. -swagger:model ItemsItems0 +/*ListRestoreHistoryOKBodyItemsItems0 RestoreHistoryItem represents single backup restore item. +swagger:model ListRestoreHistoryOKBodyItemsItems0 */ -type ItemsItems0 struct { +type ListRestoreHistoryOKBodyItemsItems0 struct { // Machine-readable restore id. RestoreID string `json:"restore_id,omitempty"` @@ -184,14 +399,6 @@ type ItemsItems0 struct { // Service name. ServiceName string `json:"service_name,omitempty"` - // DataModel is a model used for performing a backup. - // Enum: [DATA_MODEL_INVALID PHYSICAL LOGICAL] - DataModel *string `json:"data_model,omitempty"` - - // RestoreStatus shows the current status of execution of restore. - // Enum: [RESTORE_STATUS_INVALID 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"` @@ -199,25 +406,33 @@ type ItemsItems0 struct { // Restore finish time. // Format: date-time FinishedAt strfmt.DateTime `json:"finished_at,omitempty"` + + // DataModel is a model used for performing a backup. + // Enum: [DATA_MODEL_INVALID PHYSICAL LOGICAL] + DataModel *string `json:"data_model,omitempty"` + + // RestoreStatus shows the current status of execution of restore. + // Enum: [RESTORE_STATUS_INVALID RESTORE_STATUS_IN_PROGRESS RESTORE_STATUS_SUCCESS RESTORE_STATUS_ERROR] + Status *string `json:"status,omitempty"` } -// Validate validates this items items0 -func (o *ItemsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list restore history OK body items items0 +func (o *ListRestoreHistoryOKBodyItemsItems0) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateDataModel(formats); err != nil { + if err := o.validateStartedAt(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateFinishedAt(formats); err != nil { res = append(res, err) } - if err := o.validateStartedAt(formats); err != nil { + if err := o.validateDataModel(formats); err != nil { res = append(res, err) } - if err := o.validateFinishedAt(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -227,270 +442,130 @@ func (o *ItemsItems0) Validate(formats strfmt.Registry) error { return nil } -var itemsItems0TypeDataModelPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DATA_MODEL_INVALID","PHYSICAL","LOGICAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - itemsItems0TypeDataModelPropEnum = append(itemsItems0TypeDataModelPropEnum, v) +func (o *ListRestoreHistoryOKBodyItemsItems0) validateStartedAt(formats strfmt.Registry) error { + if swag.IsZero(o.StartedAt) { // not required + return nil } -} - -const ( - // ItemsItems0DataModelDATAMODELINVALID captures enum value "DATA_MODEL_INVALID" - ItemsItems0DataModelDATAMODELINVALID string = "DATA_MODEL_INVALID" - - // ItemsItems0DataModelPHYSICAL captures enum value "PHYSICAL" - ItemsItems0DataModelPHYSICAL string = "PHYSICAL" - - // ItemsItems0DataModelLOGICAL captures enum value "LOGICAL" - ItemsItems0DataModelLOGICAL string = "LOGICAL" -) - -// prop value enum -func (o *ItemsItems0) validateDataModelEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, itemsItems0TypeDataModelPropEnum, true); err != nil { + if err := validate.FormatOf("started_at", "body", "date-time", o.StartedAt.String(), formats); err != nil { return err } + return nil } -func (o *ItemsItems0) validateDataModel(formats strfmt.Registry) error { - - if swag.IsZero(o.DataModel) { // not required +func (o *ListRestoreHistoryOKBodyItemsItems0) validateFinishedAt(formats strfmt.Registry) error { + if swag.IsZero(o.FinishedAt) { // not required return nil } - // value enum - if err := o.validateDataModelEnum("data_model", "body", *o.DataModel); err != nil { + if err := validate.FormatOf("finished_at", "body", "date-time", o.FinishedAt.String(), formats); err != nil { return err } return nil } -var itemsItems0TypeStatusPropEnum []interface{} +var listRestoreHistoryOkBodyItemsItems0TypeDataModelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["RESTORE_STATUS_INVALID","RESTORE_STATUS_IN_PROGRESS","RESTORE_STATUS_SUCCESS","RESTORE_STATUS_ERROR"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["DATA_MODEL_INVALID","PHYSICAL","LOGICAL"]`), &res); err != nil { panic(err) } for _, v := range res { - itemsItems0TypeStatusPropEnum = append(itemsItems0TypeStatusPropEnum, v) + listRestoreHistoryOkBodyItemsItems0TypeDataModelPropEnum = append(listRestoreHistoryOkBodyItemsItems0TypeDataModelPropEnum, v) } } const ( - // ItemsItems0StatusRESTORESTATUSINVALID captures enum value "RESTORE_STATUS_INVALID" - ItemsItems0StatusRESTORESTATUSINVALID string = "RESTORE_STATUS_INVALID" + // ListRestoreHistoryOKBodyItemsItems0DataModelDATAMODELINVALID captures enum value "DATA_MODEL_INVALID" + ListRestoreHistoryOKBodyItemsItems0DataModelDATAMODELINVALID string = "DATA_MODEL_INVALID" - // ItemsItems0StatusRESTORESTATUSINPROGRESS captures enum value "RESTORE_STATUS_IN_PROGRESS" - ItemsItems0StatusRESTORESTATUSINPROGRESS string = "RESTORE_STATUS_IN_PROGRESS" + // ListRestoreHistoryOKBodyItemsItems0DataModelPHYSICAL captures enum value "PHYSICAL" + ListRestoreHistoryOKBodyItemsItems0DataModelPHYSICAL string = "PHYSICAL" - // ItemsItems0StatusRESTORESTATUSSUCCESS captures enum value "RESTORE_STATUS_SUCCESS" - ItemsItems0StatusRESTORESTATUSSUCCESS string = "RESTORE_STATUS_SUCCESS" - - // ItemsItems0StatusRESTORESTATUSERROR captures enum value "RESTORE_STATUS_ERROR" - ItemsItems0StatusRESTORESTATUSERROR string = "RESTORE_STATUS_ERROR" + // ListRestoreHistoryOKBodyItemsItems0DataModelLOGICAL captures enum value "LOGICAL" + ListRestoreHistoryOKBodyItemsItems0DataModelLOGICAL string = "LOGICAL" ) // prop value enum -func (o *ItemsItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, itemsItems0TypeStatusPropEnum, true); err != nil { +func (o *ListRestoreHistoryOKBodyItemsItems0) validateDataModelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listRestoreHistoryOkBodyItemsItems0TypeDataModelPropEnum, true); err != nil { return err } return nil } -func (o *ItemsItems0) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(o.Status) { // not required +func (o *ListRestoreHistoryOKBodyItemsItems0) validateDataModel(formats strfmt.Registry) error { + if swag.IsZero(o.DataModel) { // not required return nil } // value enum - if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { + if err := o.validateDataModelEnum("data_model", "body", *o.DataModel); err != nil { return err } return nil } -func (o *ItemsItems0) validateStartedAt(formats strfmt.Registry) error { +var listRestoreHistoryOkBodyItemsItems0TypeStatusPropEnum []interface{} - if swag.IsZero(o.StartedAt) { // not required - return nil +func init() { + var res []string + if err := json.Unmarshal([]byte(`["RESTORE_STATUS_INVALID","RESTORE_STATUS_IN_PROGRESS","RESTORE_STATUS_SUCCESS","RESTORE_STATUS_ERROR"]`), &res); err != nil { + panic(err) } - - if err := validate.FormatOf("started_at", "body", "date-time", o.StartedAt.String(), formats); err != nil { - return err + for _, v := range res { + listRestoreHistoryOkBodyItemsItems0TypeStatusPropEnum = append(listRestoreHistoryOkBodyItemsItems0TypeStatusPropEnum, v) } - - return nil } -func (o *ItemsItems0) validateFinishedAt(formats strfmt.Registry) error { +const ( - if swag.IsZero(o.FinishedAt) { // not required - return nil - } + // ListRestoreHistoryOKBodyItemsItems0StatusRESTORESTATUSINVALID captures enum value "RESTORE_STATUS_INVALID" + ListRestoreHistoryOKBodyItemsItems0StatusRESTORESTATUSINVALID string = "RESTORE_STATUS_INVALID" - if err := validate.FormatOf("finished_at", "body", "date-time", o.FinishedAt.String(), formats); err != nil { - return err - } + // ListRestoreHistoryOKBodyItemsItems0StatusRESTORESTATUSINPROGRESS captures enum value "RESTORE_STATUS_IN_PROGRESS" + ListRestoreHistoryOKBodyItemsItems0StatusRESTORESTATUSINPROGRESS string = "RESTORE_STATUS_IN_PROGRESS" - return nil -} + // ListRestoreHistoryOKBodyItemsItems0StatusRESTORESTATUSSUCCESS captures enum value "RESTORE_STATUS_SUCCESS" + ListRestoreHistoryOKBodyItemsItems0StatusRESTORESTATUSSUCCESS string = "RESTORE_STATUS_SUCCESS" -// MarshalBinary interface implementation -func (o *ItemsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} + // ListRestoreHistoryOKBodyItemsItems0StatusRESTORESTATUSERROR captures enum value "RESTORE_STATUS_ERROR" + ListRestoreHistoryOKBodyItemsItems0StatusRESTORESTATUSERROR string = "RESTORE_STATUS_ERROR" +) -// UnmarshalBinary interface implementation -func (o *ItemsItems0) UnmarshalBinary(b []byte) error { - var res ItemsItems0 - if err := swag.ReadJSON(b, &res); err != nil { +// prop value enum +func (o *ListRestoreHistoryOKBodyItemsItems0) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listRestoreHistoryOkBodyItemsItems0TypeStatusPropEnum, true); err != nil { return err } - *o = res - return nil -} - -/*ListRestoreHistoryDefaultBody list restore history default body -swagger:model ListRestoreHistoryDefaultBody -*/ -type ListRestoreHistoryDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `json:"details"` -} - -// Validate validates this list restore history default body -func (o *ListRestoreHistoryDefaultBody) 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 *ListRestoreHistoryDefaultBody) validateDetails(formats strfmt.Registry) error { - - if swag.IsZero(o.Details) { // not required +func (o *ListRestoreHistoryOKBodyItemsItems0) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required return nil } - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ListRestoreHistory default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListRestoreHistoryDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListRestoreHistoryDefaultBody) UnmarshalBinary(b []byte) error { - var res ListRestoreHistoryDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { + // value enum + if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { return err } - *o = res - return nil -} -/*ListRestoreHistoryOKBody list restore history OK body -swagger:model ListRestoreHistoryOKBody -*/ -type ListRestoreHistoryOKBody struct { - - // items - Items []*ItemsItems0 `json:"items"` -} - -// Validate validates this list restore history OK body -func (o *ListRestoreHistoryOKBody) 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 *ListRestoreHistoryOKBody) 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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listRestoreHistoryOk" + "." + "items" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - +// ContextValidate validates this list restore history OK body items items0 based on context it is used +func (o *ListRestoreHistoryOKBodyItemsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ListRestoreHistoryOKBody) MarshalBinary() ([]byte, error) { +func (o *ListRestoreHistoryOKBodyItemsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -498,8 +573,8 @@ func (o *ListRestoreHistoryOKBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListRestoreHistoryOKBody) UnmarshalBinary(b []byte) error { - var res ListRestoreHistoryOKBody +func (o *ListRestoreHistoryOKBodyItemsItems0) UnmarshalBinary(b []byte) error { + var res ListRestoreHistoryOKBodyItemsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/backup/json/client/restore_history/restore_history_client.go b/api/managementpb/backup/json/client/restore_history/restore_history_client.go index 08e4181b1e..b458ade6ab 100644 --- a/api/managementpb/backup/json/client/restore_history/restore_history_client.go +++ b/api/managementpb/backup/json/client/restore_history/restore_history_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - ListRestoreHistory(params *ListRestoreHistoryParams) (*ListRestoreHistoryOK, error) + ListRestoreHistory(params *ListRestoreHistoryParams, opts ...ClientOption) (*ListRestoreHistoryOK, error) SetTransport(transport runtime.ClientTransport) } @@ -33,13 +36,12 @@ type ClientService interface { /* ListRestoreHistory lists restore history returns a list of all backup restore history items */ -func (a *Client) ListRestoreHistory(params *ListRestoreHistoryParams) (*ListRestoreHistoryOK, error) { +func (a *Client) ListRestoreHistory(params *ListRestoreHistoryParams, opts ...ClientOption) (*ListRestoreHistoryOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListRestoreHistoryParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListRestoreHistory", Method: "POST", PathPattern: "/v1/management/backup/RestoreHistory/List", @@ -50,7 +52,12 @@ func (a *Client) ListRestoreHistory(params *ListRestoreHistoryParams) (*ListRest Reader: &ListRestoreHistoryReader{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 } diff --git a/api/managementpb/backup/locations.pb.go b/api/managementpb/backup/locations.pb.go index 83d4b71479..07de764a01 100644 --- a/api/managementpb/backup/locations.pb.go +++ b/api/managementpb/backup/locations.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/backup/locations.proto diff --git a/api/managementpb/backup/restores.pb.go b/api/managementpb/backup/restores.pb.go index fbdc87a582..4f30f3c07b 100644 --- a/api/managementpb/backup/restores.pb.go +++ b/api/managementpb/backup/restores.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/backup/restores.proto diff --git a/api/managementpb/checks.pb.go b/api/managementpb/checks.pb.go index 67d3de35e6..6363344afe 100644 --- a/api/managementpb/checks.pb.go +++ b/api/managementpb/checks.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/checks.proto diff --git a/api/managementpb/dbaas/components.pb.go b/api/managementpb/dbaas/components.pb.go index 79d877d37e..324574b7c9 100644 --- a/api/managementpb/dbaas/components.pb.go +++ b/api/managementpb/dbaas/components.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/dbaas/components.proto diff --git a/api/managementpb/dbaas/db_clusters.pb.go b/api/managementpb/dbaas/db_clusters.pb.go index 7f955613c1..6736afbe0b 100644 --- a/api/managementpb/dbaas/db_clusters.pb.go +++ b/api/managementpb/dbaas/db_clusters.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/dbaas/db_clusters.proto diff --git a/api/managementpb/dbaas/dbaas.pb.go b/api/managementpb/dbaas/dbaas.pb.go index 2ea42920c5..12866ce270 100644 --- a/api/managementpb/dbaas/dbaas.pb.go +++ b/api/managementpb/dbaas/dbaas.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/dbaas/dbaas.proto diff --git a/api/managementpb/dbaas/json/client/components/change_psmdb_components_parameters.go b/api/managementpb/dbaas/json/client/components/change_psmdb_components_parameters.go index d1c686d886..477f6b4fb3 100644 --- a/api/managementpb/dbaas/json/client/components/change_psmdb_components_parameters.go +++ b/api/managementpb/dbaas/json/client/components/change_psmdb_components_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangePSMDBComponentsParams creates a new ChangePSMDBComponentsParams object -// with the default values initialized. +// NewChangePSMDBComponentsParams creates a new ChangePSMDBComponentsParams 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 NewChangePSMDBComponentsParams() *ChangePSMDBComponentsParams { - var () return &ChangePSMDBComponentsParams{ - timeout: cr.DefaultTimeout, } } // NewChangePSMDBComponentsParamsWithTimeout creates a new ChangePSMDBComponentsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangePSMDBComponentsParamsWithTimeout(timeout time.Duration) *ChangePSMDBComponentsParams { - var () return &ChangePSMDBComponentsParams{ - timeout: timeout, } } // NewChangePSMDBComponentsParamsWithContext creates a new ChangePSMDBComponentsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangePSMDBComponentsParamsWithContext(ctx context.Context) *ChangePSMDBComponentsParams { - var () return &ChangePSMDBComponentsParams{ - Context: ctx, } } // NewChangePSMDBComponentsParamsWithHTTPClient creates a new ChangePSMDBComponentsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangePSMDBComponentsParamsWithHTTPClient(client *http.Client) *ChangePSMDBComponentsParams { - var () return &ChangePSMDBComponentsParams{ HTTPClient: client, } } -/*ChangePSMDBComponentsParams contains all the parameters to send to the API endpoint -for the change PSMDB components operation typically these are written to a http.Request +/* ChangePSMDBComponentsParams contains all the parameters to send to the API endpoint + for the change PSMDB components operation. + + Typically these are written to a http.Request. */ type ChangePSMDBComponentsParams struct { - /*Body*/ + // Body. Body ChangePSMDBComponentsBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangePSMDBComponentsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change PSMDB components params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangePSMDBComponentsParams) WithDefaults() *ChangePSMDBComponentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change PSMDB components params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangePSMDBComponentsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change PSMDB components params func (o *ChangePSMDBComponentsParams) WithTimeout(timeout time.Duration) *ChangePSMDBComponentsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangePSMDBComponentsParams) WriteToRequest(r runtime.ClientRequest, re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/components/change_psmdb_components_responses.go b/api/managementpb/dbaas/json/client/components/change_psmdb_components_responses.go index 051f6f8c6a..12ee2f31e2 100644 --- a/api/managementpb/dbaas/json/client/components/change_psmdb_components_responses.go +++ b/api/managementpb/dbaas/json/client/components/change_psmdb_components_responses.go @@ -6,6 +6,7 @@ package components // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewChangePSMDBComponentsOK() *ChangePSMDBComponentsOK { return &ChangePSMDBComponentsOK{} } -/*ChangePSMDBComponentsOK handles this case with default header values. +/* ChangePSMDBComponentsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ChangePSMDBComponentsOK struct { func (o *ChangePSMDBComponentsOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/ChangePSMDB][%d] changePsmdbComponentsOk %+v", 200, o.Payload) } - func (o *ChangePSMDBComponentsOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewChangePSMDBComponentsDefault(code int) *ChangePSMDBComponentsDefault { } } -/*ChangePSMDBComponentsDefault handles this case with default header values. +/* ChangePSMDBComponentsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *ChangePSMDBComponentsDefault) Code() int { func (o *ChangePSMDBComponentsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/ChangePSMDB][%d] ChangePSMDBComponents default %+v", o._statusCode, o.Payload) } - func (o *ChangePSMDBComponentsDefault) GetPayload() *ChangePSMDBComponentsDefaultBody { return o.Payload } @@ -142,7 +141,6 @@ func (o *ChangePSMDBComponentsBody) Validate(formats strfmt.Registry) error { } func (o *ChangePSMDBComponentsBody) validateMongod(formats strfmt.Registry) error { - if swag.IsZero(o.Mongod) { // not required return nil } @@ -151,6 +149,38 @@ func (o *ChangePSMDBComponentsBody) validateMongod(formats strfmt.Registry) erro if err := o.Mongod.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "mongod") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "mongod") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change PSMDB components body based on the context it is used +func (o *ChangePSMDBComponentsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMongod(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangePSMDBComponentsBody) contextValidateMongod(ctx context.Context, formats strfmt.Registry) error { + + if o.Mongod != nil { + if err := o.Mongod.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "mongod") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "mongod") } return err } @@ -192,7 +222,7 @@ type ChangePSMDBComponentsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangePSMDBComponentsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change PSMDB components default body @@ -210,7 +240,6 @@ func (o *ChangePSMDBComponentsDefaultBody) Validate(formats strfmt.Registry) err } func (o *ChangePSMDBComponentsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -224,6 +253,42 @@ func (o *ChangePSMDBComponentsDefaultBody) validateDetails(formats strfmt.Regist if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangePSMDBComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangePSMDBComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change PSMDB components default body based on the context it is used +func (o *ChangePSMDBComponentsDefaultBody) 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 *ChangePSMDBComponentsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangePSMDBComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangePSMDBComponents default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -252,6 +317,47 @@ func (o *ChangePSMDBComponentsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangePSMDBComponentsDefaultBodyDetailsItems0 change PSMDB components default body details items0 +swagger:model ChangePSMDBComponentsDefaultBodyDetailsItems0 +*/ +type ChangePSMDBComponentsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change PSMDB components default body details items0 +func (o *ChangePSMDBComponentsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change PSMDB components default body details items0 based on context it is used +func (o *ChangePSMDBComponentsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangePSMDBComponentsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangePSMDBComponentsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangePSMDBComponentsDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangePSMDBComponentsParamsBodyMongod ChangeComponent contains fields to manage components. swagger:model ChangePSMDBComponentsParamsBodyMongod */ @@ -279,7 +385,6 @@ func (o *ChangePSMDBComponentsParamsBodyMongod) Validate(formats strfmt.Registry } func (o *ChangePSMDBComponentsParamsBodyMongod) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required return nil } @@ -293,6 +398,42 @@ func (o *ChangePSMDBComponentsParamsBodyMongod) validateVersions(formats strfmt. if err := o.Versions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "mongod" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "mongod" + "." + "versions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change PSMDB components params body mongod based on the context it is used +func (o *ChangePSMDBComponentsParamsBodyMongod) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateVersions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangePSMDBComponentsParamsBodyMongod) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Versions); i++ { + + if o.Versions[i] != nil { + if err := o.Versions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "mongod" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "mongod" + "." + "versions" + "." + strconv.Itoa(i)) } return err } @@ -341,44 +482,13 @@ func (o *ChangePSMDBComponentsParamsBodyMongodVersionsItems0) Validate(formats s return nil } -// MarshalBinary interface implementation -func (o *ChangePSMDBComponentsParamsBodyMongodVersionsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePSMDBComponentsParamsBodyMongodVersionsItems0) UnmarshalBinary(b []byte) error { - var res ChangePSMDBComponentsParamsBodyMongodVersionsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this change PSMDB components params body mongod versions items0 based on context it is used +func (o *ChangePSMDBComponentsParamsBodyMongodVersionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *ChangePSMDBComponentsParamsBodyMongodVersionsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -386,8 +496,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *ChangePSMDBComponentsParamsBodyMongodVersionsItems0) UnmarshalBinary(b []byte) error { + var res ChangePSMDBComponentsParamsBodyMongodVersionsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/components/change_pxc_components_parameters.go b/api/managementpb/dbaas/json/client/components/change_pxc_components_parameters.go index 16ebf34d93..afa071999a 100644 --- a/api/managementpb/dbaas/json/client/components/change_pxc_components_parameters.go +++ b/api/managementpb/dbaas/json/client/components/change_pxc_components_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangePXCComponentsParams creates a new ChangePXCComponentsParams object -// with the default values initialized. +// NewChangePXCComponentsParams creates a new ChangePXCComponentsParams 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 NewChangePXCComponentsParams() *ChangePXCComponentsParams { - var () return &ChangePXCComponentsParams{ - timeout: cr.DefaultTimeout, } } // NewChangePXCComponentsParamsWithTimeout creates a new ChangePXCComponentsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangePXCComponentsParamsWithTimeout(timeout time.Duration) *ChangePXCComponentsParams { - var () return &ChangePXCComponentsParams{ - timeout: timeout, } } // NewChangePXCComponentsParamsWithContext creates a new ChangePXCComponentsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangePXCComponentsParamsWithContext(ctx context.Context) *ChangePXCComponentsParams { - var () return &ChangePXCComponentsParams{ - Context: ctx, } } // NewChangePXCComponentsParamsWithHTTPClient creates a new ChangePXCComponentsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangePXCComponentsParamsWithHTTPClient(client *http.Client) *ChangePXCComponentsParams { - var () return &ChangePXCComponentsParams{ HTTPClient: client, } } -/*ChangePXCComponentsParams contains all the parameters to send to the API endpoint -for the change PXC components operation typically these are written to a http.Request +/* ChangePXCComponentsParams contains all the parameters to send to the API endpoint + for the change PXC components operation. + + Typically these are written to a http.Request. */ type ChangePXCComponentsParams struct { - /*Body*/ + // Body. Body ChangePXCComponentsBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangePXCComponentsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change PXC components params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangePXCComponentsParams) WithDefaults() *ChangePXCComponentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change PXC components params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangePXCComponentsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change PXC components params func (o *ChangePXCComponentsParams) WithTimeout(timeout time.Duration) *ChangePXCComponentsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangePXCComponentsParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/components/change_pxc_components_responses.go b/api/managementpb/dbaas/json/client/components/change_pxc_components_responses.go index 16852153b7..2c1593433b 100644 --- a/api/managementpb/dbaas/json/client/components/change_pxc_components_responses.go +++ b/api/managementpb/dbaas/json/client/components/change_pxc_components_responses.go @@ -6,6 +6,7 @@ package components // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewChangePXCComponentsOK() *ChangePXCComponentsOK { return &ChangePXCComponentsOK{} } -/*ChangePXCComponentsOK handles this case with default header values. +/* ChangePXCComponentsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ChangePXCComponentsOK struct { func (o *ChangePXCComponentsOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/ChangePXC][%d] changePxcComponentsOk %+v", 200, o.Payload) } - func (o *ChangePXCComponentsOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewChangePXCComponentsDefault(code int) *ChangePXCComponentsDefault { } } -/*ChangePXCComponentsDefault handles this case with default header values. +/* ChangePXCComponentsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *ChangePXCComponentsDefault) Code() int { func (o *ChangePXCComponentsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/ChangePXC][%d] ChangePXCComponents default %+v", o._statusCode, o.Payload) } - func (o *ChangePXCComponentsDefault) GetPayload() *ChangePXCComponentsDefaultBody { return o.Payload } @@ -156,7 +155,6 @@ func (o *ChangePXCComponentsBody) Validate(formats strfmt.Registry) error { } func (o *ChangePXCComponentsBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required return nil } @@ -165,6 +163,8 @@ func (o *ChangePXCComponentsBody) validateHaproxy(formats strfmt.Registry) error if err := o.Haproxy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "haproxy") } return err } @@ -174,7 +174,6 @@ func (o *ChangePXCComponentsBody) validateHaproxy(formats strfmt.Registry) error } func (o *ChangePXCComponentsBody) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required return nil } @@ -183,6 +182,8 @@ func (o *ChangePXCComponentsBody) validateProxysql(formats strfmt.Registry) erro if err := o.Proxysql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "proxysql") } return err } @@ -192,7 +193,6 @@ func (o *ChangePXCComponentsBody) validateProxysql(formats strfmt.Registry) erro } func (o *ChangePXCComponentsBody) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required return nil } @@ -201,6 +201,78 @@ func (o *ChangePXCComponentsBody) validatePXC(formats strfmt.Registry) error { if err := o.PXC.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pxc") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change PXC components body based on the context it is used +func (o *ChangePXCComponentsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHaproxy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateProxysql(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePXC(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangePXCComponentsBody) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { + + if o.Haproxy != nil { + if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "haproxy") + } + return err + } + } + + return nil +} + +func (o *ChangePXCComponentsBody) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { + + if o.Proxysql != nil { + if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "proxysql") + } + return err + } + } + + return nil +} + +func (o *ChangePXCComponentsBody) contextValidatePXC(ctx context.Context, formats strfmt.Registry) error { + + if o.PXC != nil { + if err := o.PXC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pxc") } return err } @@ -242,7 +314,7 @@ type ChangePXCComponentsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangePXCComponentsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change PXC components default body @@ -260,7 +332,6 @@ func (o *ChangePXCComponentsDefaultBody) Validate(formats strfmt.Registry) error } func (o *ChangePXCComponentsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -274,6 +345,42 @@ func (o *ChangePXCComponentsDefaultBody) validateDetails(formats strfmt.Registry if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangePXCComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangePXCComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change PXC components default body based on the context it is used +func (o *ChangePXCComponentsDefaultBody) 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 *ChangePXCComponentsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangePXCComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangePXCComponents default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -302,6 +409,47 @@ func (o *ChangePXCComponentsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangePXCComponentsDefaultBodyDetailsItems0 change PXC components default body details items0 +swagger:model ChangePXCComponentsDefaultBodyDetailsItems0 +*/ +type ChangePXCComponentsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change PXC components default body details items0 +func (o *ChangePXCComponentsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change PXC components default body details items0 based on context it is used +func (o *ChangePXCComponentsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangePXCComponentsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangePXCComponentsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangePXCComponentsDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangePXCComponentsParamsBodyHaproxy ChangeComponent contains fields to manage components. swagger:model ChangePXCComponentsParamsBodyHaproxy */ @@ -329,7 +477,6 @@ func (o *ChangePXCComponentsParamsBodyHaproxy) Validate(formats strfmt.Registry) } func (o *ChangePXCComponentsParamsBodyHaproxy) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required return nil } @@ -343,6 +490,42 @@ func (o *ChangePXCComponentsParamsBodyHaproxy) validateVersions(formats strfmt.R if err := o.Versions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "haproxy" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "haproxy" + "." + "versions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change PXC components params body haproxy based on the context it is used +func (o *ChangePXCComponentsParamsBodyHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateVersions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangePXCComponentsParamsBodyHaproxy) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Versions); i++ { + + if o.Versions[i] != nil { + if err := o.Versions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "haproxy" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "haproxy" + "." + "versions" + "." + strconv.Itoa(i)) } return err } @@ -391,6 +574,11 @@ func (o *ChangePXCComponentsParamsBodyHaproxyVersionsItems0) Validate(formats st return nil } +// ContextValidate validates this change PXC components params body haproxy versions items0 based on context it is used +func (o *ChangePXCComponentsParamsBodyHaproxyVersionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangePXCComponentsParamsBodyHaproxyVersionsItems0) MarshalBinary() ([]byte, error) { if o == nil { @@ -436,7 +624,6 @@ func (o *ChangePXCComponentsParamsBodyPXC) Validate(formats strfmt.Registry) err } func (o *ChangePXCComponentsParamsBodyPXC) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required return nil } @@ -450,6 +637,42 @@ func (o *ChangePXCComponentsParamsBodyPXC) validateVersions(formats strfmt.Regis if err := o.Versions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "pxc" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pxc" + "." + "versions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change PXC components params body PXC based on the context it is used +func (o *ChangePXCComponentsParamsBodyPXC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateVersions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangePXCComponentsParamsBodyPXC) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Versions); i++ { + + if o.Versions[i] != nil { + if err := o.Versions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "pxc" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pxc" + "." + "versions" + "." + strconv.Itoa(i)) } return err } @@ -498,6 +721,11 @@ func (o *ChangePXCComponentsParamsBodyPXCVersionsItems0) Validate(formats strfmt return nil } +// ContextValidate validates this change PXC components params body PXC versions items0 based on context it is used +func (o *ChangePXCComponentsParamsBodyPXCVersionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangePXCComponentsParamsBodyPXCVersionsItems0) MarshalBinary() ([]byte, error) { if o == nil { @@ -543,7 +771,6 @@ func (o *ChangePXCComponentsParamsBodyProxysql) Validate(formats strfmt.Registry } func (o *ChangePXCComponentsParamsBodyProxysql) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required return nil } @@ -557,6 +784,42 @@ func (o *ChangePXCComponentsParamsBodyProxysql) validateVersions(formats strfmt. if err := o.Versions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "proxysql" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "proxysql" + "." + "versions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change PXC components params body proxysql based on the context it is used +func (o *ChangePXCComponentsParamsBodyProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateVersions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangePXCComponentsParamsBodyProxysql) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Versions); i++ { + + if o.Versions[i] != nil { + if err := o.Versions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "proxysql" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "proxysql" + "." + "versions" + "." + strconv.Itoa(i)) } return err } @@ -605,6 +868,11 @@ func (o *ChangePXCComponentsParamsBodyProxysqlVersionsItems0) Validate(formats s return nil } +// ContextValidate validates this change PXC components params body proxysql versions items0 based on context it is used +func (o *ChangePXCComponentsParamsBodyProxysqlVersionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangePXCComponentsParamsBodyProxysqlVersionsItems0) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/client/components/check_for_operator_update_parameters.go b/api/managementpb/dbaas/json/client/components/check_for_operator_update_parameters.go index 4f507d52c7..8cac428a85 100644 --- a/api/managementpb/dbaas/json/client/components/check_for_operator_update_parameters.go +++ b/api/managementpb/dbaas/json/client/components/check_for_operator_update_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCheckForOperatorUpdateParams creates a new CheckForOperatorUpdateParams object -// with the default values initialized. +// NewCheckForOperatorUpdateParams creates a new CheckForOperatorUpdateParams 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 NewCheckForOperatorUpdateParams() *CheckForOperatorUpdateParams { - var () return &CheckForOperatorUpdateParams{ - timeout: cr.DefaultTimeout, } } // NewCheckForOperatorUpdateParamsWithTimeout creates a new CheckForOperatorUpdateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCheckForOperatorUpdateParamsWithTimeout(timeout time.Duration) *CheckForOperatorUpdateParams { - var () return &CheckForOperatorUpdateParams{ - timeout: timeout, } } // NewCheckForOperatorUpdateParamsWithContext creates a new CheckForOperatorUpdateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCheckForOperatorUpdateParamsWithContext(ctx context.Context) *CheckForOperatorUpdateParams { - var () return &CheckForOperatorUpdateParams{ - Context: ctx, } } // NewCheckForOperatorUpdateParamsWithHTTPClient creates a new CheckForOperatorUpdateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCheckForOperatorUpdateParamsWithHTTPClient(client *http.Client) *CheckForOperatorUpdateParams { - var () return &CheckForOperatorUpdateParams{ HTTPClient: client, } } -/*CheckForOperatorUpdateParams contains all the parameters to send to the API endpoint -for the check for operator update operation typically these are written to a http.Request +/* CheckForOperatorUpdateParams contains all the parameters to send to the API endpoint + for the check for operator update operation. + + Typically these are written to a http.Request. */ type CheckForOperatorUpdateParams struct { - /*Body*/ + // Body. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type CheckForOperatorUpdateParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the check for operator update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CheckForOperatorUpdateParams) WithDefaults() *CheckForOperatorUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the check for operator update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CheckForOperatorUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the check for operator update params func (o *CheckForOperatorUpdateParams) WithTimeout(timeout time.Duration) *CheckForOperatorUpdateParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *CheckForOperatorUpdateParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/managementpb/dbaas/json/client/components/check_for_operator_update_responses.go b/api/managementpb/dbaas/json/client/components/check_for_operator_update_responses.go index 93a6f3d735..c742d97de9 100644 --- a/api/managementpb/dbaas/json/client/components/check_for_operator_update_responses.go +++ b/api/managementpb/dbaas/json/client/components/check_for_operator_update_responses.go @@ -6,6 +6,7 @@ package components // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewCheckForOperatorUpdateOK() *CheckForOperatorUpdateOK { return &CheckForOperatorUpdateOK{} } -/*CheckForOperatorUpdateOK handles this case with default header values. +/* CheckForOperatorUpdateOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type CheckForOperatorUpdateOK struct { func (o *CheckForOperatorUpdateOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/CheckForOperatorUpdate][%d] checkForOperatorUpdateOk %+v", 200, o.Payload) } - func (o *CheckForOperatorUpdateOK) GetPayload() *CheckForOperatorUpdateOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewCheckForOperatorUpdateDefault(code int) *CheckForOperatorUpdateDefault { } } -/*CheckForOperatorUpdateDefault handles this case with default header values. +/* CheckForOperatorUpdateDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *CheckForOperatorUpdateDefault) Code() int { func (o *CheckForOperatorUpdateDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/CheckForOperatorUpdate][%d] CheckForOperatorUpdate default %+v", o._statusCode, o.Payload) } - func (o *CheckForOperatorUpdateDefault) GetPayload() *CheckForOperatorUpdateDefaultBody { return o.Payload } @@ -132,7 +131,7 @@ type CheckForOperatorUpdateDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*CheckForOperatorUpdateDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this check for operator update default body @@ -150,7 +149,6 @@ func (o *CheckForOperatorUpdateDefaultBody) Validate(formats strfmt.Registry) er } func (o *CheckForOperatorUpdateDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -164,6 +162,42 @@ func (o *CheckForOperatorUpdateDefaultBody) validateDetails(formats strfmt.Regis if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("CheckForOperatorUpdate default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CheckForOperatorUpdate default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this check for operator update default body based on the context it is used +func (o *CheckForOperatorUpdateDefaultBody) 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 *CheckForOperatorUpdateDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CheckForOperatorUpdate default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CheckForOperatorUpdate default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -192,13 +226,54 @@ func (o *CheckForOperatorUpdateDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*CheckForOperatorUpdateDefaultBodyDetailsItems0 check for operator update default body details items0 +swagger:model CheckForOperatorUpdateDefaultBodyDetailsItems0 +*/ +type CheckForOperatorUpdateDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this check for operator update default body details items0 +func (o *CheckForOperatorUpdateDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this check for operator update default body details items0 based on context it is used +func (o *CheckForOperatorUpdateDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *CheckForOperatorUpdateDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CheckForOperatorUpdateDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res CheckForOperatorUpdateDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*CheckForOperatorUpdateOKBody check for operator update OK body swagger:model CheckForOperatorUpdateOKBody */ type CheckForOperatorUpdateOKBody struct { // The cluster name is used as a key for this map, value contains components and their inforamtion about update. - ClusterToComponents map[string]ClusterToComponentsAnon `json:"cluster_to_components,omitempty"` + ClusterToComponents map[string]CheckForOperatorUpdateOKBodyClusterToComponentsAnon `json:"cluster_to_components,omitempty"` } // Validate validates this check for operator update OK body @@ -216,7 +291,6 @@ func (o *CheckForOperatorUpdateOKBody) Validate(formats strfmt.Registry) error { } func (o *CheckForOperatorUpdateOKBody) validateClusterToComponents(formats strfmt.Registry) error { - if swag.IsZero(o.ClusterToComponents) { // not required return nil } @@ -228,6 +302,40 @@ func (o *CheckForOperatorUpdateOKBody) validateClusterToComponents(formats strfm } if val, ok := o.ClusterToComponents[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checkForOperatorUpdateOk" + "." + "cluster_to_components" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("checkForOperatorUpdateOk" + "." + "cluster_to_components" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this check for operator update OK body based on the context it is used +func (o *CheckForOperatorUpdateOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateClusterToComponents(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CheckForOperatorUpdateOKBody) contextValidateClusterToComponents(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.ClusterToComponents { + + if val, ok := o.ClusterToComponents[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { return err } } @@ -255,18 +363,18 @@ func (o *CheckForOperatorUpdateOKBody) UnmarshalBinary(b []byte) error { return nil } -/*ClusterToComponentsAnon ComponentsUpdateInformation contains info about components and their available latest versions. -swagger:model ClusterToComponentsAnon +/*CheckForOperatorUpdateOKBodyClusterToComponentsAnon ComponentsUpdateInformation contains info about components and their available latest versions. +swagger:model CheckForOperatorUpdateOKBodyClusterToComponentsAnon */ -type ClusterToComponentsAnon struct { +type CheckForOperatorUpdateOKBodyClusterToComponentsAnon struct { // component_to_update_information stores, under the name of the component, information about the update. // "pxc-operator", "psmdb-operator" are names used by backend for our operators. - ComponentToUpdateInformation map[string]ClusterToComponentsAnonComponentToUpdateInformationAnon `json:"component_to_update_information,omitempty"` + ComponentToUpdateInformation map[string]CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon `json:"component_to_update_information,omitempty"` } -// Validate validates this cluster to components anon -func (o *ClusterToComponentsAnon) Validate(formats strfmt.Registry) error { +// Validate validates this check for operator update OK body cluster to components anon +func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnon) Validate(formats strfmt.Registry) error { var res []error if err := o.validateComponentToUpdateInformation(formats); err != nil { @@ -279,8 +387,7 @@ func (o *ClusterToComponentsAnon) Validate(formats strfmt.Registry) error { return nil } -func (o *ClusterToComponentsAnon) validateComponentToUpdateInformation(formats strfmt.Registry) error { - +func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnon) validateComponentToUpdateInformation(formats strfmt.Registry) error { if swag.IsZero(o.ComponentToUpdateInformation) { // not required return nil } @@ -292,6 +399,40 @@ func (o *ClusterToComponentsAnon) validateComponentToUpdateInformation(formats s } if val, ok := o.ComponentToUpdateInformation[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("component_to_update_information" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("component_to_update_information" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this check for operator update OK body cluster to components anon based on the context it is used +func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComponentToUpdateInformation(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnon) contextValidateComponentToUpdateInformation(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.ComponentToUpdateInformation { + + if val, ok := o.ComponentToUpdateInformation[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { return err } } @@ -302,7 +443,7 @@ func (o *ClusterToComponentsAnon) validateComponentToUpdateInformation(formats s } // MarshalBinary interface implementation -func (o *ClusterToComponentsAnon) MarshalBinary() ([]byte, error) { +func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnon) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -310,8 +451,8 @@ func (o *ClusterToComponentsAnon) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ClusterToComponentsAnon) UnmarshalBinary(b []byte) error { - var res ClusterToComponentsAnon +func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnon) UnmarshalBinary(b []byte) error { + var res CheckForOperatorUpdateOKBodyClusterToComponentsAnon if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -319,22 +460,27 @@ func (o *ClusterToComponentsAnon) UnmarshalBinary(b []byte) error { return nil } -/*ClusterToComponentsAnonComponentToUpdateInformationAnon ComponentUpdateInformation contains version we can update to for certain component. -swagger:model ClusterToComponentsAnonComponentToUpdateInformationAnon +/*CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon ComponentUpdateInformation contains version we can update to for certain component. +swagger:model CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon */ -type ClusterToComponentsAnonComponentToUpdateInformationAnon struct { +type CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon struct { // available version AvailableVersion string `json:"available_version,omitempty"` } -// Validate validates this cluster to components anon component to update information anon -func (o *ClusterToComponentsAnonComponentToUpdateInformationAnon) Validate(formats strfmt.Registry) error { +// Validate validates this check for operator update OK body cluster to components anon component to update information anon +func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this check for operator update OK body cluster to components anon component to update information anon based on context it is used +func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ClusterToComponentsAnonComponentToUpdateInformationAnon) MarshalBinary() ([]byte, error) { +func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -342,8 +488,8 @@ func (o *ClusterToComponentsAnonComponentToUpdateInformationAnon) MarshalBinary( } // UnmarshalBinary interface implementation -func (o *ClusterToComponentsAnonComponentToUpdateInformationAnon) UnmarshalBinary(b []byte) error { - var res ClusterToComponentsAnonComponentToUpdateInformationAnon +func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon) UnmarshalBinary(b []byte) error { + var res CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/components/components_client.go b/api/managementpb/dbaas/json/client/components/components_client.go index 04fb778322..6199f868e6 100644 --- a/api/managementpb/dbaas/json/client/components/components_client.go +++ b/api/managementpb/dbaas/json/client/components/components_client.go @@ -23,19 +23,22 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - ChangePSMDBComponents(params *ChangePSMDBComponentsParams) (*ChangePSMDBComponentsOK, error) + ChangePSMDBComponents(params *ChangePSMDBComponentsParams, opts ...ClientOption) (*ChangePSMDBComponentsOK, error) - ChangePXCComponents(params *ChangePXCComponentsParams) (*ChangePXCComponentsOK, error) + ChangePXCComponents(params *ChangePXCComponentsParams, opts ...ClientOption) (*ChangePXCComponentsOK, error) - CheckForOperatorUpdate(params *CheckForOperatorUpdateParams) (*CheckForOperatorUpdateOK, error) + CheckForOperatorUpdate(params *CheckForOperatorUpdateParams, opts ...ClientOption) (*CheckForOperatorUpdateOK, error) - GetPSMDBComponents(params *GetPSMDBComponentsParams) (*GetPSMDBComponentsOK, error) + GetPSMDBComponents(params *GetPSMDBComponentsParams, opts ...ClientOption) (*GetPSMDBComponentsOK, error) - GetPXCComponents(params *GetPXCComponentsParams) (*GetPXCComponentsOK, error) + GetPXCComponents(params *GetPXCComponentsParams, opts ...ClientOption) (*GetPXCComponentsOK, error) - InstallOperator(params *InstallOperatorParams) (*InstallOperatorOK, error) + InstallOperator(params *InstallOperatorParams, opts ...ClientOption) (*InstallOperatorOK, error) SetTransport(transport runtime.ClientTransport) } @@ -43,13 +46,12 @@ type ClientService interface { /* ChangePSMDBComponents changes PSMDB components manages PSMDB related components */ -func (a *Client) ChangePSMDBComponents(params *ChangePSMDBComponentsParams) (*ChangePSMDBComponentsOK, error) { +func (a *Client) ChangePSMDBComponents(params *ChangePSMDBComponentsParams, opts ...ClientOption) (*ChangePSMDBComponentsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangePSMDBComponentsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangePSMDBComponents", Method: "POST", PathPattern: "/v1/management/DBaaS/Components/ChangePSMDB", @@ -60,7 +62,12 @@ func (a *Client) ChangePSMDBComponents(params *ChangePSMDBComponentsParams) (*Ch Reader: &ChangePSMDBComponentsReader{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 } @@ -76,13 +83,12 @@ func (a *Client) ChangePSMDBComponents(params *ChangePSMDBComponentsParams) (*Ch /* ChangePXCComponents changes PXC components manages PXC related components */ -func (a *Client) ChangePXCComponents(params *ChangePXCComponentsParams) (*ChangePXCComponentsOK, error) { +func (a *Client) ChangePXCComponents(params *ChangePXCComponentsParams, opts ...ClientOption) (*ChangePXCComponentsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangePXCComponentsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangePXCComponents", Method: "POST", PathPattern: "/v1/management/DBaaS/Components/ChangePXC", @@ -93,7 +99,12 @@ func (a *Client) ChangePXCComponents(params *ChangePXCComponentsParams) (*Change Reader: &ChangePXCComponentsReader{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 } @@ -109,13 +120,12 @@ func (a *Client) ChangePXCComponents(params *ChangePXCComponentsParams) (*Change /* CheckForOperatorUpdate checks for operator update checks if a new version of an operator is available */ -func (a *Client) CheckForOperatorUpdate(params *CheckForOperatorUpdateParams) (*CheckForOperatorUpdateOK, error) { +func (a *Client) CheckForOperatorUpdate(params *CheckForOperatorUpdateParams, opts ...ClientOption) (*CheckForOperatorUpdateOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCheckForOperatorUpdateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "CheckForOperatorUpdate", Method: "POST", PathPattern: "/v1/management/DBaaS/Components/CheckForOperatorUpdate", @@ -126,7 +136,12 @@ func (a *Client) CheckForOperatorUpdate(params *CheckForOperatorUpdateParams) (* Reader: &CheckForOperatorUpdateReader{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 } @@ -142,13 +157,12 @@ func (a *Client) CheckForOperatorUpdate(params *CheckForOperatorUpdateParams) (* /* GetPSMDBComponents gets PSMDB components returns list of available components for PSMDB clusters */ -func (a *Client) GetPSMDBComponents(params *GetPSMDBComponentsParams) (*GetPSMDBComponentsOK, error) { +func (a *Client) GetPSMDBComponents(params *GetPSMDBComponentsParams, opts ...ClientOption) (*GetPSMDBComponentsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPSMDBComponentsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetPSMDBComponents", Method: "POST", PathPattern: "/v1/management/DBaaS/Components/GetPSMDB", @@ -159,7 +173,12 @@ func (a *Client) GetPSMDBComponents(params *GetPSMDBComponentsParams) (*GetPSMDB Reader: &GetPSMDBComponentsReader{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 } @@ -175,13 +194,12 @@ func (a *Client) GetPSMDBComponents(params *GetPSMDBComponentsParams) (*GetPSMDB /* GetPXCComponents gets PXC components returns list of available components for PXC clusters */ -func (a *Client) GetPXCComponents(params *GetPXCComponentsParams) (*GetPXCComponentsOK, error) { +func (a *Client) GetPXCComponents(params *GetPXCComponentsParams, opts ...ClientOption) (*GetPXCComponentsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPXCComponentsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetPXCComponents", Method: "POST", PathPattern: "/v1/management/DBaaS/Components/GetPXC", @@ -192,7 +210,12 @@ func (a *Client) GetPXCComponents(params *GetPXCComponentsParams) (*GetPXCCompon Reader: &GetPXCComponentsReader{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 } @@ -208,13 +231,12 @@ func (a *Client) GetPXCComponents(params *GetPXCComponentsParams) (*GetPXCCompon /* InstallOperator installs operator installs given operator in given version */ -func (a *Client) InstallOperator(params *InstallOperatorParams) (*InstallOperatorOK, error) { +func (a *Client) InstallOperator(params *InstallOperatorParams, opts ...ClientOption) (*InstallOperatorOK, error) { // TODO: Validate the params before sending if params == nil { params = NewInstallOperatorParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "InstallOperator", Method: "POST", PathPattern: "/v1/management/DBaaS/Components/InstallOperator", @@ -225,7 +247,12 @@ func (a *Client) InstallOperator(params *InstallOperatorParams) (*InstallOperato Reader: &InstallOperatorReader{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 } diff --git a/api/managementpb/dbaas/json/client/components/get_psmdb_components_parameters.go b/api/managementpb/dbaas/json/client/components/get_psmdb_components_parameters.go index aed69cff37..ba005c56ba 100644 --- a/api/managementpb/dbaas/json/client/components/get_psmdb_components_parameters.go +++ b/api/managementpb/dbaas/json/client/components/get_psmdb_components_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetPSMDBComponentsParams creates a new GetPSMDBComponentsParams object -// with the default values initialized. +// NewGetPSMDBComponentsParams creates a new GetPSMDBComponentsParams 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 NewGetPSMDBComponentsParams() *GetPSMDBComponentsParams { - var () return &GetPSMDBComponentsParams{ - timeout: cr.DefaultTimeout, } } // NewGetPSMDBComponentsParamsWithTimeout creates a new GetPSMDBComponentsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPSMDBComponentsParamsWithTimeout(timeout time.Duration) *GetPSMDBComponentsParams { - var () return &GetPSMDBComponentsParams{ - timeout: timeout, } } // NewGetPSMDBComponentsParamsWithContext creates a new GetPSMDBComponentsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPSMDBComponentsParamsWithContext(ctx context.Context) *GetPSMDBComponentsParams { - var () return &GetPSMDBComponentsParams{ - Context: ctx, } } // NewGetPSMDBComponentsParamsWithHTTPClient creates a new GetPSMDBComponentsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPSMDBComponentsParamsWithHTTPClient(client *http.Client) *GetPSMDBComponentsParams { - var () return &GetPSMDBComponentsParams{ HTTPClient: client, } } -/*GetPSMDBComponentsParams contains all the parameters to send to the API endpoint -for the get PSMDB components operation typically these are written to a http.Request +/* GetPSMDBComponentsParams contains all the parameters to send to the API endpoint + for the get PSMDB components operation. + + Typically these are written to a http.Request. */ type GetPSMDBComponentsParams struct { - /*Body*/ + // Body. Body GetPSMDBComponentsBody timeout time.Duration @@ -68,6 +67,21 @@ type GetPSMDBComponentsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get PSMDB components params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPSMDBComponentsParams) WithDefaults() *GetPSMDBComponentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get PSMDB components params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPSMDBComponentsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get PSMDB components params func (o *GetPSMDBComponentsParams) WithTimeout(timeout time.Duration) *GetPSMDBComponentsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *GetPSMDBComponentsParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/components/get_psmdb_components_responses.go b/api/managementpb/dbaas/json/client/components/get_psmdb_components_responses.go index 50a08446fa..fa5147f1ad 100644 --- a/api/managementpb/dbaas/json/client/components/get_psmdb_components_responses.go +++ b/api/managementpb/dbaas/json/client/components/get_psmdb_components_responses.go @@ -6,6 +6,7 @@ package components // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetPSMDBComponentsOK() *GetPSMDBComponentsOK { return &GetPSMDBComponentsOK{} } -/*GetPSMDBComponentsOK handles this case with default header values. +/* GetPSMDBComponentsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetPSMDBComponentsOK struct { func (o *GetPSMDBComponentsOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/GetPSMDB][%d] getPsmdbComponentsOk %+v", 200, o.Payload) } - func (o *GetPSMDBComponentsOK) GetPayload() *GetPSMDBComponentsOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetPSMDBComponentsDefault(code int) *GetPSMDBComponentsDefault { } } -/*GetPSMDBComponentsDefault handles this case with default header values. +/* GetPSMDBComponentsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetPSMDBComponentsDefault) Code() int { func (o *GetPSMDBComponentsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/GetPSMDB][%d] GetPSMDBComponents default %+v", o._statusCode, o.Payload) } - func (o *GetPSMDBComponentsDefault) GetPayload() *GetPSMDBComponentsDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ func (o *GetPSMDBComponentsBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get PSMDB components body based on context it is used +func (o *GetPSMDBComponentsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPSMDBComponentsBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -167,7 +171,7 @@ type GetPSMDBComponentsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetPSMDBComponentsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get PSMDB components default body @@ -185,7 +189,6 @@ func (o *GetPSMDBComponentsDefaultBody) Validate(formats strfmt.Registry) error } func (o *GetPSMDBComponentsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *GetPSMDBComponentsDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetPSMDBComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPSMDBComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get PSMDB components default body based on the context it is used +func (o *GetPSMDBComponentsDefaultBody) 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 *GetPSMDBComponentsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetPSMDBComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPSMDBComponents default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,13 +266,54 @@ func (o *GetPSMDBComponentsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetPSMDBComponentsDefaultBodyDetailsItems0 get PSMDB components default body details items0 +swagger:model GetPSMDBComponentsDefaultBodyDetailsItems0 +*/ +type GetPSMDBComponentsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this get PSMDB components default body details items0 +func (o *GetPSMDBComponentsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB components default body details items0 based on context it is used +func (o *GetPSMDBComponentsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPSMDBComponentsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPSMDBComponentsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*GetPSMDBComponentsOKBody get PSMDB components OK body swagger:model GetPSMDBComponentsOKBody */ type GetPSMDBComponentsOKBody struct { // versions - Versions []*VersionsItems0 `json:"versions"` + Versions []*GetPSMDBComponentsOKBodyVersionsItems0 `json:"versions"` } // Validate validates this get PSMDB components OK body @@ -251,7 +331,6 @@ func (o *GetPSMDBComponentsOKBody) Validate(formats strfmt.Registry) error { } func (o *GetPSMDBComponentsOKBody) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required return nil } @@ -265,6 +344,42 @@ func (o *GetPSMDBComponentsOKBody) validateVersions(formats strfmt.Registry) err if err := o.Versions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getPsmdbComponentsOk" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPsmdbComponentsOk" + "." + "versions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get PSMDB components OK body based on the context it is used +func (o *GetPSMDBComponentsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateVersions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPSMDBComponentsOKBody) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Versions); i++ { + + if o.Versions[i] != nil { + if err := o.Versions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getPsmdbComponentsOk" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPsmdbComponentsOk" + "." + "versions" + "." + strconv.Itoa(i)) } return err } @@ -293,10 +408,10 @@ func (o *GetPSMDBComponentsOKBody) UnmarshalBinary(b []byte) error { return nil } -/*VersionsItems0 OperatorVersion contains information about operator and components matrix. -swagger:model VersionsItems0 +/*GetPSMDBComponentsOKBodyVersionsItems0 OperatorVersion contains information about operator and components matrix. +swagger:model GetPSMDBComponentsOKBodyVersionsItems0 */ -type VersionsItems0 struct { +type GetPSMDBComponentsOKBodyVersionsItems0 struct { // product Product string `json:"product,omitempty"` @@ -305,11 +420,11 @@ type VersionsItems0 struct { Operator string `json:"operator,omitempty"` // matrix - Matrix *VersionsItems0Matrix `json:"matrix,omitempty"` + Matrix *GetPSMDBComponentsOKBodyVersionsItems0Matrix `json:"matrix,omitempty"` } -// Validate validates this versions items0 -func (o *VersionsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this get PSMDB components OK body versions items0 +func (o *GetPSMDBComponentsOKBodyVersionsItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateMatrix(formats); err != nil { @@ -322,8 +437,7 @@ func (o *VersionsItems0) Validate(formats strfmt.Registry) error { return nil } -func (o *VersionsItems0) validateMatrix(formats strfmt.Registry) error { - +func (o *GetPSMDBComponentsOKBodyVersionsItems0) validateMatrix(formats strfmt.Registry) error { if swag.IsZero(o.Matrix) { // not required return nil } @@ -332,6 +446,38 @@ func (o *VersionsItems0) validateMatrix(formats strfmt.Registry) error { if err := o.Matrix.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("matrix") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PSMDB components OK body versions items0 based on the context it is used +func (o *GetPSMDBComponentsOKBodyVersionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMatrix(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPSMDBComponentsOKBodyVersionsItems0) contextValidateMatrix(ctx context.Context, formats strfmt.Registry) error { + + if o.Matrix != nil { + if err := o.Matrix.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix") } return err } @@ -341,7 +487,7 @@ func (o *VersionsItems0) validateMatrix(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (o *VersionsItems0) MarshalBinary() ([]byte, error) { +func (o *GetPSMDBComponentsOKBodyVersionsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -349,8 +495,8 @@ func (o *VersionsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VersionsItems0) UnmarshalBinary(b []byte) error { - var res VersionsItems0 +func (o *GetPSMDBComponentsOKBodyVersionsItems0) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsOKBodyVersionsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -358,38 +504,38 @@ func (o *VersionsItems0) UnmarshalBinary(b []byte) error { return nil } -/*VersionsItems0Matrix Matrix contains all available components. -swagger:model VersionsItems0Matrix +/*GetPSMDBComponentsOKBodyVersionsItems0Matrix Matrix contains all available components. +swagger:model GetPSMDBComponentsOKBodyVersionsItems0Matrix */ -type VersionsItems0Matrix struct { +type GetPSMDBComponentsOKBodyVersionsItems0Matrix struct { // mongod - Mongod map[string]VersionsItems0MatrixMongodAnon `json:"mongod,omitempty"` + Mongod map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon `json:"mongod,omitempty"` // pxc - PXC map[string]VersionsItems0MatrixPXCAnon `json:"pxc,omitempty"` + PXC map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon `json:"pxc,omitempty"` // pmm - PMM map[string]VersionsItems0MatrixPMMAnon `json:"pmm,omitempty"` + PMM map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon `json:"pmm,omitempty"` // proxysql - Proxysql map[string]VersionsItems0MatrixProxysqlAnon `json:"proxysql,omitempty"` + Proxysql map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon `json:"proxysql,omitempty"` // haproxy - Haproxy map[string]VersionsItems0MatrixHaproxyAnon `json:"haproxy,omitempty"` + Haproxy map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon `json:"haproxy,omitempty"` // backup - Backup map[string]VersionsItems0MatrixBackupAnon `json:"backup,omitempty"` + Backup map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon `json:"backup,omitempty"` // operator - Operator map[string]VersionsItems0MatrixOperatorAnon `json:"operator,omitempty"` + Operator map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon `json:"operator,omitempty"` // log collector - LogCollector map[string]VersionsItems0MatrixLogCollectorAnon `json:"log_collector,omitempty"` + LogCollector map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon `json:"log_collector,omitempty"` } -// Validate validates this versions items0 matrix -func (o *VersionsItems0Matrix) Validate(formats strfmt.Registry) error { +// Validate validates this get PSMDB components OK body versions items0 matrix +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) Validate(formats strfmt.Registry) error { var res []error if err := o.validateMongod(formats); err != nil { @@ -430,8 +576,7 @@ func (o *VersionsItems0Matrix) Validate(formats strfmt.Registry) error { return nil } -func (o *VersionsItems0Matrix) validateMongod(formats strfmt.Registry) error { - +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) validateMongod(formats strfmt.Registry) error { if swag.IsZero(o.Mongod) { // not required return nil } @@ -443,6 +588,11 @@ func (o *VersionsItems0Matrix) validateMongod(formats strfmt.Registry) error { } if val, ok := o.Mongod[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "mongod" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "mongod" + "." + k) + } return err } } @@ -452,8 +602,7 @@ func (o *VersionsItems0Matrix) validateMongod(formats strfmt.Registry) error { return nil } -func (o *VersionsItems0Matrix) validatePXC(formats strfmt.Registry) error { - +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) validatePXC(formats strfmt.Registry) error { if swag.IsZero(o.PXC) { // not required return nil } @@ -465,6 +614,11 @@ func (o *VersionsItems0Matrix) validatePXC(formats strfmt.Registry) error { } if val, ok := o.PXC[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "pxc" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "pxc" + "." + k) + } return err } } @@ -474,8 +628,7 @@ func (o *VersionsItems0Matrix) validatePXC(formats strfmt.Registry) error { return nil } -func (o *VersionsItems0Matrix) validatePMM(formats strfmt.Registry) error { - +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) validatePMM(formats strfmt.Registry) error { if swag.IsZero(o.PMM) { // not required return nil } @@ -487,6 +640,11 @@ func (o *VersionsItems0Matrix) validatePMM(formats strfmt.Registry) error { } if val, ok := o.PMM[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "pmm" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "pmm" + "." + k) + } return err } } @@ -496,8 +654,7 @@ func (o *VersionsItems0Matrix) validatePMM(formats strfmt.Registry) error { return nil } -func (o *VersionsItems0Matrix) validateProxysql(formats strfmt.Registry) error { - +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) validateProxysql(formats strfmt.Registry) error { if swag.IsZero(o.Proxysql) { // not required return nil } @@ -509,6 +666,11 @@ func (o *VersionsItems0Matrix) validateProxysql(formats strfmt.Registry) error { } if val, ok := o.Proxysql[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "proxysql" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "proxysql" + "." + k) + } return err } } @@ -518,8 +680,7 @@ func (o *VersionsItems0Matrix) validateProxysql(formats strfmt.Registry) error { return nil } -func (o *VersionsItems0Matrix) validateHaproxy(formats strfmt.Registry) error { - +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) validateHaproxy(formats strfmt.Registry) error { if swag.IsZero(o.Haproxy) { // not required return nil } @@ -531,6 +692,11 @@ func (o *VersionsItems0Matrix) validateHaproxy(formats strfmt.Registry) error { } if val, ok := o.Haproxy[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "haproxy" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "haproxy" + "." + k) + } return err } } @@ -540,8 +706,7 @@ func (o *VersionsItems0Matrix) validateHaproxy(formats strfmt.Registry) error { return nil } -func (o *VersionsItems0Matrix) validateBackup(formats strfmt.Registry) error { - +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) validateBackup(formats strfmt.Registry) error { if swag.IsZero(o.Backup) { // not required return nil } @@ -553,6 +718,11 @@ func (o *VersionsItems0Matrix) validateBackup(formats strfmt.Registry) error { } if val, ok := o.Backup[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "backup" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "backup" + "." + k) + } return err } } @@ -562,8 +732,7 @@ func (o *VersionsItems0Matrix) validateBackup(formats strfmt.Registry) error { return nil } -func (o *VersionsItems0Matrix) validateOperator(formats strfmt.Registry) error { - +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) validateOperator(formats strfmt.Registry) error { if swag.IsZero(o.Operator) { // not required return nil } @@ -575,6 +744,11 @@ func (o *VersionsItems0Matrix) validateOperator(formats strfmt.Registry) error { } if val, ok := o.Operator[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "operator" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "operator" + "." + k) + } return err } } @@ -584,8 +758,7 @@ func (o *VersionsItems0Matrix) validateOperator(formats strfmt.Registry) error { return nil } -func (o *VersionsItems0Matrix) validateLogCollector(formats strfmt.Registry) error { - +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) validateLogCollector(formats strfmt.Registry) error { if swag.IsZero(o.LogCollector) { // not required return nil } @@ -597,6 +770,173 @@ func (o *VersionsItems0Matrix) validateLogCollector(formats strfmt.Registry) err } if val, ok := o.LogCollector[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "log_collector" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "log_collector" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get PSMDB components OK body versions items0 matrix based on the context it is used +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMongod(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePXC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePMM(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.contextValidateBackup(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateOperator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateLogCollector(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) contextValidateMongod(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.Mongod { + + if val, ok := o.Mongod[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) contextValidatePXC(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.PXC { + + if val, ok := o.PXC[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) contextValidatePMM(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.PMM { + + if val, ok := o.PMM[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.Proxysql { + + if val, ok := o.Proxysql[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.Haproxy { + + if val, ok := o.Haproxy[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.Backup { + + if val, ok := o.Backup[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) contextValidateOperator(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.Operator { + + if val, ok := o.Operator[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) contextValidateLogCollector(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.LogCollector { + + if val, ok := o.LogCollector[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { return err } } @@ -607,7 +947,7 @@ func (o *VersionsItems0Matrix) validateLogCollector(formats strfmt.Registry) err } // MarshalBinary interface implementation -func (o *VersionsItems0Matrix) MarshalBinary() ([]byte, error) { +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -615,8 +955,8 @@ func (o *VersionsItems0Matrix) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VersionsItems0Matrix) UnmarshalBinary(b []byte) error { - var res VersionsItems0Matrix +func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsOKBodyVersionsItems0Matrix if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -624,10 +964,10 @@ func (o *VersionsItems0Matrix) UnmarshalBinary(b []byte) error { return nil } -/*VersionsItems0MatrixBackupAnon Component contains information about component. -swagger:model VersionsItems0MatrixBackupAnon +/*GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon Component contains information about component. +swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon */ -type VersionsItems0MatrixBackupAnon struct { +type GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon struct { // image path ImagePath string `json:"image_path,omitempty"` @@ -648,13 +988,18 @@ type VersionsItems0MatrixBackupAnon struct { Disabled bool `json:"disabled,omitempty"` } -// Validate validates this versions items0 matrix backup anon -func (o *VersionsItems0MatrixBackupAnon) Validate(formats strfmt.Registry) error { +// Validate validates this get PSMDB components OK body versions items0 matrix backup anon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB components OK body versions items0 matrix backup anon based on context it is used +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *VersionsItems0MatrixBackupAnon) MarshalBinary() ([]byte, error) { +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -662,8 +1007,8 @@ func (o *VersionsItems0MatrixBackupAnon) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VersionsItems0MatrixBackupAnon) UnmarshalBinary(b []byte) error { - var res VersionsItems0MatrixBackupAnon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -671,10 +1016,10 @@ func (o *VersionsItems0MatrixBackupAnon) UnmarshalBinary(b []byte) error { return nil } -/*VersionsItems0MatrixHaproxyAnon Component contains information about component. -swagger:model VersionsItems0MatrixHaproxyAnon +/*GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon Component contains information about component. +swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon */ -type VersionsItems0MatrixHaproxyAnon struct { +type GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon struct { // image path ImagePath string `json:"image_path,omitempty"` @@ -695,13 +1040,18 @@ type VersionsItems0MatrixHaproxyAnon struct { Disabled bool `json:"disabled,omitempty"` } -// Validate validates this versions items0 matrix haproxy anon -func (o *VersionsItems0MatrixHaproxyAnon) Validate(formats strfmt.Registry) error { +// Validate validates this get PSMDB components OK body versions items0 matrix haproxy anon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB components OK body versions items0 matrix haproxy anon based on context it is used +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *VersionsItems0MatrixHaproxyAnon) MarshalBinary() ([]byte, error) { +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -709,8 +1059,8 @@ func (o *VersionsItems0MatrixHaproxyAnon) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VersionsItems0MatrixHaproxyAnon) UnmarshalBinary(b []byte) error { - var res VersionsItems0MatrixHaproxyAnon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -718,10 +1068,10 @@ func (o *VersionsItems0MatrixHaproxyAnon) UnmarshalBinary(b []byte) error { return nil } -/*VersionsItems0MatrixLogCollectorAnon Component contains information about component. -swagger:model VersionsItems0MatrixLogCollectorAnon +/*GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon Component contains information about component. +swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon */ -type VersionsItems0MatrixLogCollectorAnon struct { +type GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon struct { // image path ImagePath string `json:"image_path,omitempty"` @@ -742,13 +1092,18 @@ type VersionsItems0MatrixLogCollectorAnon struct { Disabled bool `json:"disabled,omitempty"` } -// Validate validates this versions items0 matrix log collector anon -func (o *VersionsItems0MatrixLogCollectorAnon) Validate(formats strfmt.Registry) error { +// Validate validates this get PSMDB components OK body versions items0 matrix log collector anon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB components OK body versions items0 matrix log collector anon based on context it is used +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *VersionsItems0MatrixLogCollectorAnon) MarshalBinary() ([]byte, error) { +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -756,8 +1111,8 @@ func (o *VersionsItems0MatrixLogCollectorAnon) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VersionsItems0MatrixLogCollectorAnon) UnmarshalBinary(b []byte) error { - var res VersionsItems0MatrixLogCollectorAnon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -765,10 +1120,10 @@ func (o *VersionsItems0MatrixLogCollectorAnon) UnmarshalBinary(b []byte) error { return nil } -/*VersionsItems0MatrixMongodAnon Component contains information about component. -swagger:model VersionsItems0MatrixMongodAnon +/*GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon Component contains information about component. +swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon */ -type VersionsItems0MatrixMongodAnon struct { +type GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon struct { // image path ImagePath string `json:"image_path,omitempty"` @@ -789,13 +1144,18 @@ type VersionsItems0MatrixMongodAnon struct { Disabled bool `json:"disabled,omitempty"` } -// Validate validates this versions items0 matrix mongod anon -func (o *VersionsItems0MatrixMongodAnon) Validate(formats strfmt.Registry) error { +// Validate validates this get PSMDB components OK body versions items0 matrix mongod anon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB components OK body versions items0 matrix mongod anon based on context it is used +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *VersionsItems0MatrixMongodAnon) MarshalBinary() ([]byte, error) { +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -803,8 +1163,8 @@ func (o *VersionsItems0MatrixMongodAnon) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VersionsItems0MatrixMongodAnon) UnmarshalBinary(b []byte) error { - var res VersionsItems0MatrixMongodAnon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -812,10 +1172,10 @@ func (o *VersionsItems0MatrixMongodAnon) UnmarshalBinary(b []byte) error { return nil } -/*VersionsItems0MatrixOperatorAnon Component contains information about component. -swagger:model VersionsItems0MatrixOperatorAnon +/*GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon Component contains information about component. +swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon */ -type VersionsItems0MatrixOperatorAnon struct { +type GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon struct { // image path ImagePath string `json:"image_path,omitempty"` @@ -836,13 +1196,18 @@ type VersionsItems0MatrixOperatorAnon struct { Disabled bool `json:"disabled,omitempty"` } -// Validate validates this versions items0 matrix operator anon -func (o *VersionsItems0MatrixOperatorAnon) Validate(formats strfmt.Registry) error { +// Validate validates this get PSMDB components OK body versions items0 matrix operator anon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB components OK body versions items0 matrix operator anon based on context it is used +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *VersionsItems0MatrixOperatorAnon) MarshalBinary() ([]byte, error) { +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -850,8 +1215,8 @@ func (o *VersionsItems0MatrixOperatorAnon) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VersionsItems0MatrixOperatorAnon) UnmarshalBinary(b []byte) error { - var res VersionsItems0MatrixOperatorAnon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -859,10 +1224,10 @@ func (o *VersionsItems0MatrixOperatorAnon) UnmarshalBinary(b []byte) error { return nil } -/*VersionsItems0MatrixPMMAnon Component contains information about component. -swagger:model VersionsItems0MatrixPMMAnon +/*GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon Component contains information about component. +swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon */ -type VersionsItems0MatrixPMMAnon struct { +type GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon struct { // image path ImagePath string `json:"image_path,omitempty"` @@ -883,13 +1248,18 @@ type VersionsItems0MatrixPMMAnon struct { Disabled bool `json:"disabled,omitempty"` } -// Validate validates this versions items0 matrix PMM anon -func (o *VersionsItems0MatrixPMMAnon) Validate(formats strfmt.Registry) error { +// Validate validates this get PSMDB components OK body versions items0 matrix PMM anon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB components OK body versions items0 matrix PMM anon based on context it is used +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *VersionsItems0MatrixPMMAnon) MarshalBinary() ([]byte, error) { +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -897,8 +1267,8 @@ func (o *VersionsItems0MatrixPMMAnon) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VersionsItems0MatrixPMMAnon) UnmarshalBinary(b []byte) error { - var res VersionsItems0MatrixPMMAnon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -906,10 +1276,10 @@ func (o *VersionsItems0MatrixPMMAnon) UnmarshalBinary(b []byte) error { return nil } -/*VersionsItems0MatrixPXCAnon Component contains information about component. -swagger:model VersionsItems0MatrixPXCAnon +/*GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon Component contains information about component. +swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon */ -type VersionsItems0MatrixPXCAnon struct { +type GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon struct { // image path ImagePath string `json:"image_path,omitempty"` @@ -930,13 +1300,18 @@ type VersionsItems0MatrixPXCAnon struct { Disabled bool `json:"disabled,omitempty"` } -// Validate validates this versions items0 matrix PXC anon -func (o *VersionsItems0MatrixPXCAnon) Validate(formats strfmt.Registry) error { +// Validate validates this get PSMDB components OK body versions items0 matrix PXC anon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB components OK body versions items0 matrix PXC anon based on context it is used +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *VersionsItems0MatrixPXCAnon) MarshalBinary() ([]byte, error) { +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -944,8 +1319,8 @@ func (o *VersionsItems0MatrixPXCAnon) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VersionsItems0MatrixPXCAnon) UnmarshalBinary(b []byte) error { - var res VersionsItems0MatrixPXCAnon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -953,10 +1328,10 @@ func (o *VersionsItems0MatrixPXCAnon) UnmarshalBinary(b []byte) error { return nil } -/*VersionsItems0MatrixProxysqlAnon Component contains information about component. -swagger:model VersionsItems0MatrixProxysqlAnon +/*GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon Component contains information about component. +swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon */ -type VersionsItems0MatrixProxysqlAnon struct { +type GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon struct { // image path ImagePath string `json:"image_path,omitempty"` @@ -977,13 +1352,18 @@ type VersionsItems0MatrixProxysqlAnon struct { Disabled bool `json:"disabled,omitempty"` } -// Validate validates this versions items0 matrix proxysql anon -func (o *VersionsItems0MatrixProxysqlAnon) Validate(formats strfmt.Registry) error { +// Validate validates this get PSMDB components OK body versions items0 matrix proxysql anon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB components OK body versions items0 matrix proxysql anon based on context it is used +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *VersionsItems0MatrixProxysqlAnon) MarshalBinary() ([]byte, error) { +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -991,8 +1371,8 @@ func (o *VersionsItems0MatrixProxysqlAnon) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *VersionsItems0MatrixProxysqlAnon) UnmarshalBinary(b []byte) error { - var res VersionsItems0MatrixProxysqlAnon +func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon) UnmarshalBinary(b []byte) error { + var res GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/components/get_pxc_components_parameters.go b/api/managementpb/dbaas/json/client/components/get_pxc_components_parameters.go index 8733ca0617..e045874a20 100644 --- a/api/managementpb/dbaas/json/client/components/get_pxc_components_parameters.go +++ b/api/managementpb/dbaas/json/client/components/get_pxc_components_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetPXCComponentsParams creates a new GetPXCComponentsParams object -// with the default values initialized. +// NewGetPXCComponentsParams creates a new GetPXCComponentsParams 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 NewGetPXCComponentsParams() *GetPXCComponentsParams { - var () return &GetPXCComponentsParams{ - timeout: cr.DefaultTimeout, } } // NewGetPXCComponentsParamsWithTimeout creates a new GetPXCComponentsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPXCComponentsParamsWithTimeout(timeout time.Duration) *GetPXCComponentsParams { - var () return &GetPXCComponentsParams{ - timeout: timeout, } } // NewGetPXCComponentsParamsWithContext creates a new GetPXCComponentsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPXCComponentsParamsWithContext(ctx context.Context) *GetPXCComponentsParams { - var () return &GetPXCComponentsParams{ - Context: ctx, } } // NewGetPXCComponentsParamsWithHTTPClient creates a new GetPXCComponentsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPXCComponentsParamsWithHTTPClient(client *http.Client) *GetPXCComponentsParams { - var () return &GetPXCComponentsParams{ HTTPClient: client, } } -/*GetPXCComponentsParams contains all the parameters to send to the API endpoint -for the get PXC components operation typically these are written to a http.Request +/* GetPXCComponentsParams contains all the parameters to send to the API endpoint + for the get PXC components operation. + + Typically these are written to a http.Request. */ type GetPXCComponentsParams struct { - /*Body*/ + // Body. Body GetPXCComponentsBody timeout time.Duration @@ -68,6 +67,21 @@ type GetPXCComponentsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get PXC components params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPXCComponentsParams) WithDefaults() *GetPXCComponentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get PXC components params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPXCComponentsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get PXC components params func (o *GetPXCComponentsParams) WithTimeout(timeout time.Duration) *GetPXCComponentsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *GetPXCComponentsParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/components/get_pxc_components_responses.go b/api/managementpb/dbaas/json/client/components/get_pxc_components_responses.go index c1d9e17223..a259e1877c 100644 --- a/api/managementpb/dbaas/json/client/components/get_pxc_components_responses.go +++ b/api/managementpb/dbaas/json/client/components/get_pxc_components_responses.go @@ -6,6 +6,7 @@ package components // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetPXCComponentsOK() *GetPXCComponentsOK { return &GetPXCComponentsOK{} } -/*GetPXCComponentsOK handles this case with default header values. +/* GetPXCComponentsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetPXCComponentsOK struct { func (o *GetPXCComponentsOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/GetPXC][%d] getPxcComponentsOk %+v", 200, o.Payload) } - func (o *GetPXCComponentsOK) GetPayload() *GetPXCComponentsOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetPXCComponentsDefault(code int) *GetPXCComponentsDefault { } } -/*GetPXCComponentsDefault handles this case with default header values. +/* GetPXCComponentsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetPXCComponentsDefault) Code() int { func (o *GetPXCComponentsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/GetPXC][%d] GetPXCComponents default %+v", o._statusCode, o.Payload) } - func (o *GetPXCComponentsDefault) GetPayload() *GetPXCComponentsDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ func (o *GetPXCComponentsBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get PXC components body based on context it is used +func (o *GetPXCComponentsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPXCComponentsBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -167,7 +171,7 @@ type GetPXCComponentsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetPXCComponentsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get PXC components default body @@ -185,7 +189,6 @@ func (o *GetPXCComponentsDefaultBody) Validate(formats strfmt.Registry) error { } func (o *GetPXCComponentsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *GetPXCComponentsDefaultBody) validateDetails(formats strfmt.Registry) e if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetPXCComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPXCComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get PXC components default body based on the context it is used +func (o *GetPXCComponentsDefaultBody) 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 *GetPXCComponentsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetPXCComponents default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPXCComponents default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,13 +266,54 @@ func (o *GetPXCComponentsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetPXCComponentsDefaultBodyDetailsItems0 get PXC components default body details items0 +swagger:model GetPXCComponentsDefaultBodyDetailsItems0 +*/ +type GetPXCComponentsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this get PXC components default body details items0 +func (o *GetPXCComponentsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC components default body details items0 based on context it is used +func (o *GetPXCComponentsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*GetPXCComponentsOKBody get PXC components OK body swagger:model GetPXCComponentsOKBody */ type GetPXCComponentsOKBody struct { // versions - Versions []*VersionsItems0 `json:"versions"` + Versions []*GetPXCComponentsOKBodyVersionsItems0 `json:"versions"` } // Validate validates this get PXC components OK body @@ -251,7 +331,6 @@ func (o *GetPXCComponentsOKBody) Validate(formats strfmt.Registry) error { } func (o *GetPXCComponentsOKBody) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required return nil } @@ -265,6 +344,42 @@ func (o *GetPXCComponentsOKBody) validateVersions(formats strfmt.Registry) error if err := o.Versions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getPxcComponentsOk" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPxcComponentsOk" + "." + "versions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get PXC components OK body based on the context it is used +func (o *GetPXCComponentsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateVersions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCComponentsOKBody) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Versions); i++ { + + if o.Versions[i] != nil { + if err := o.Versions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getPxcComponentsOk" + "." + "versions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPxcComponentsOk" + "." + "versions" + "." + strconv.Itoa(i)) } return err } @@ -292,3 +407,975 @@ func (o *GetPXCComponentsOKBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*GetPXCComponentsOKBodyVersionsItems0 OperatorVersion contains information about operator and components matrix. +swagger:model GetPXCComponentsOKBodyVersionsItems0 +*/ +type GetPXCComponentsOKBodyVersionsItems0 struct { + + // product + Product string `json:"product,omitempty"` + + // operator + Operator string `json:"operator,omitempty"` + + // matrix + Matrix *GetPXCComponentsOKBodyVersionsItems0Matrix `json:"matrix,omitempty"` +} + +// Validate validates this get PXC components OK body versions items0 +func (o *GetPXCComponentsOKBodyVersionsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateMatrix(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0) validateMatrix(formats strfmt.Registry) error { + if swag.IsZero(o.Matrix) { // not required + return nil + } + + if o.Matrix != nil { + if err := o.Matrix.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PXC components OK body versions items0 based on the context it is used +func (o *GetPXCComponentsOKBodyVersionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMatrix(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0) contextValidateMatrix(ctx context.Context, formats strfmt.Registry) error { + + if o.Matrix != nil { + if err := o.Matrix.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsOKBodyVersionsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetPXCComponentsOKBodyVersionsItems0Matrix Matrix contains all available components. +swagger:model GetPXCComponentsOKBodyVersionsItems0Matrix +*/ +type GetPXCComponentsOKBodyVersionsItems0Matrix struct { + + // mongod + Mongod map[string]GetPXCComponentsOKBodyVersionsItems0MatrixMongodAnon `json:"mongod,omitempty"` + + // pxc + PXC map[string]GetPXCComponentsOKBodyVersionsItems0MatrixPXCAnon `json:"pxc,omitempty"` + + // pmm + PMM map[string]GetPXCComponentsOKBodyVersionsItems0MatrixPMMAnon `json:"pmm,omitempty"` + + // proxysql + Proxysql map[string]GetPXCComponentsOKBodyVersionsItems0MatrixProxysqlAnon `json:"proxysql,omitempty"` + + // haproxy + Haproxy map[string]GetPXCComponentsOKBodyVersionsItems0MatrixHaproxyAnon `json:"haproxy,omitempty"` + + // backup + Backup map[string]GetPXCComponentsOKBodyVersionsItems0MatrixBackupAnon `json:"backup,omitempty"` + + // operator + Operator map[string]GetPXCComponentsOKBodyVersionsItems0MatrixOperatorAnon `json:"operator,omitempty"` + + // log collector + LogCollector map[string]GetPXCComponentsOKBodyVersionsItems0MatrixLogCollectorAnon `json:"log_collector,omitempty"` +} + +// Validate validates this get PXC components OK body versions items0 matrix +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateMongod(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePXC(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePMM(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.validateBackup(formats); err != nil { + res = append(res, err) + } + + if err := o.validateOperator(formats); err != nil { + res = append(res, err) + } + + if err := o.validateLogCollector(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) validateMongod(formats strfmt.Registry) error { + if swag.IsZero(o.Mongod) { // not required + return nil + } + + for k := range o.Mongod { + + if swag.IsZero(o.Mongod[k]) { // not required + continue + } + if val, ok := o.Mongod[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "mongod" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "mongod" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) validatePXC(formats strfmt.Registry) error { + if swag.IsZero(o.PXC) { // not required + return nil + } + + for k := range o.PXC { + + if swag.IsZero(o.PXC[k]) { // not required + continue + } + if val, ok := o.PXC[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "pxc" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "pxc" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) validatePMM(formats strfmt.Registry) error { + if swag.IsZero(o.PMM) { // not required + return nil + } + + for k := range o.PMM { + + if swag.IsZero(o.PMM[k]) { // not required + continue + } + if val, ok := o.PMM[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "pmm" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "pmm" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) validateProxysql(formats strfmt.Registry) error { + if swag.IsZero(o.Proxysql) { // not required + return nil + } + + for k := range o.Proxysql { + + if swag.IsZero(o.Proxysql[k]) { // not required + continue + } + if val, ok := o.Proxysql[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "proxysql" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "proxysql" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) validateHaproxy(formats strfmt.Registry) error { + if swag.IsZero(o.Haproxy) { // not required + return nil + } + + for k := range o.Haproxy { + + if swag.IsZero(o.Haproxy[k]) { // not required + continue + } + if val, ok := o.Haproxy[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "haproxy" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "haproxy" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) validateBackup(formats strfmt.Registry) error { + if swag.IsZero(o.Backup) { // not required + return nil + } + + for k := range o.Backup { + + if swag.IsZero(o.Backup[k]) { // not required + continue + } + if val, ok := o.Backup[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "backup" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "backup" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) validateOperator(formats strfmt.Registry) error { + if swag.IsZero(o.Operator) { // not required + return nil + } + + for k := range o.Operator { + + if swag.IsZero(o.Operator[k]) { // not required + continue + } + if val, ok := o.Operator[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "operator" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "operator" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) validateLogCollector(formats strfmt.Registry) error { + if swag.IsZero(o.LogCollector) { // not required + return nil + } + + for k := range o.LogCollector { + + if swag.IsZero(o.LogCollector[k]) { // not required + continue + } + if val, ok := o.LogCollector[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matrix" + "." + "log_collector" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matrix" + "." + "log_collector" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get PXC components OK body versions items0 matrix based on the context it is used +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateMongod(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePXC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePMM(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.contextValidateBackup(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateOperator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateLogCollector(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) contextValidateMongod(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.Mongod { + + if val, ok := o.Mongod[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) contextValidatePXC(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.PXC { + + if val, ok := o.PXC[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) contextValidatePMM(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.PMM { + + if val, ok := o.PMM[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.Proxysql { + + if val, ok := o.Proxysql[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.Haproxy { + + if val, ok := o.Haproxy[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.Backup { + + if val, ok := o.Backup[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) contextValidateOperator(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.Operator { + + if val, ok := o.Operator[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) contextValidateLogCollector(ctx context.Context, formats strfmt.Registry) error { + + for k := range o.LogCollector { + + if val, ok := o.LogCollector[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0Matrix) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsOKBodyVersionsItems0Matrix + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetPXCComponentsOKBodyVersionsItems0MatrixBackupAnon Component contains information about component. +swagger:model GetPXCComponentsOKBodyVersionsItems0MatrixBackupAnon +*/ +type GetPXCComponentsOKBodyVersionsItems0MatrixBackupAnon struct { + + // image path + ImagePath string `json:"image_path,omitempty"` + + // image hash + ImageHash string `json:"image_hash,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // critical + Critical bool `json:"critical,omitempty"` + + // default + Default bool `json:"default,omitempty"` + + // disabled + Disabled bool `json:"disabled,omitempty"` +} + +// Validate validates this get PXC components OK body versions items0 matrix backup anon +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixBackupAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC components OK body versions items0 matrix backup anon based on context it is used +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixBackupAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixBackupAnon) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixBackupAnon) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsOKBodyVersionsItems0MatrixBackupAnon + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetPXCComponentsOKBodyVersionsItems0MatrixHaproxyAnon Component contains information about component. +swagger:model GetPXCComponentsOKBodyVersionsItems0MatrixHaproxyAnon +*/ +type GetPXCComponentsOKBodyVersionsItems0MatrixHaproxyAnon struct { + + // image path + ImagePath string `json:"image_path,omitempty"` + + // image hash + ImageHash string `json:"image_hash,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // critical + Critical bool `json:"critical,omitempty"` + + // default + Default bool `json:"default,omitempty"` + + // disabled + Disabled bool `json:"disabled,omitempty"` +} + +// Validate validates this get PXC components OK body versions items0 matrix haproxy anon +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixHaproxyAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC components OK body versions items0 matrix haproxy anon based on context it is used +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixHaproxyAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixHaproxyAnon) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixHaproxyAnon) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsOKBodyVersionsItems0MatrixHaproxyAnon + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetPXCComponentsOKBodyVersionsItems0MatrixLogCollectorAnon Component contains information about component. +swagger:model GetPXCComponentsOKBodyVersionsItems0MatrixLogCollectorAnon +*/ +type GetPXCComponentsOKBodyVersionsItems0MatrixLogCollectorAnon struct { + + // image path + ImagePath string `json:"image_path,omitempty"` + + // image hash + ImageHash string `json:"image_hash,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // critical + Critical bool `json:"critical,omitempty"` + + // default + Default bool `json:"default,omitempty"` + + // disabled + Disabled bool `json:"disabled,omitempty"` +} + +// Validate validates this get PXC components OK body versions items0 matrix log collector anon +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixLogCollectorAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC components OK body versions items0 matrix log collector anon based on context it is used +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixLogCollectorAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixLogCollectorAnon) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixLogCollectorAnon) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsOKBodyVersionsItems0MatrixLogCollectorAnon + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetPXCComponentsOKBodyVersionsItems0MatrixMongodAnon Component contains information about component. +swagger:model GetPXCComponentsOKBodyVersionsItems0MatrixMongodAnon +*/ +type GetPXCComponentsOKBodyVersionsItems0MatrixMongodAnon struct { + + // image path + ImagePath string `json:"image_path,omitempty"` + + // image hash + ImageHash string `json:"image_hash,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // critical + Critical bool `json:"critical,omitempty"` + + // default + Default bool `json:"default,omitempty"` + + // disabled + Disabled bool `json:"disabled,omitempty"` +} + +// Validate validates this get PXC components OK body versions items0 matrix mongod anon +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixMongodAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC components OK body versions items0 matrix mongod anon based on context it is used +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixMongodAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixMongodAnon) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixMongodAnon) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsOKBodyVersionsItems0MatrixMongodAnon + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetPXCComponentsOKBodyVersionsItems0MatrixOperatorAnon Component contains information about component. +swagger:model GetPXCComponentsOKBodyVersionsItems0MatrixOperatorAnon +*/ +type GetPXCComponentsOKBodyVersionsItems0MatrixOperatorAnon struct { + + // image path + ImagePath string `json:"image_path,omitempty"` + + // image hash + ImageHash string `json:"image_hash,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // critical + Critical bool `json:"critical,omitempty"` + + // default + Default bool `json:"default,omitempty"` + + // disabled + Disabled bool `json:"disabled,omitempty"` +} + +// Validate validates this get PXC components OK body versions items0 matrix operator anon +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixOperatorAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC components OK body versions items0 matrix operator anon based on context it is used +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixOperatorAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixOperatorAnon) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixOperatorAnon) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsOKBodyVersionsItems0MatrixOperatorAnon + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetPXCComponentsOKBodyVersionsItems0MatrixPMMAnon Component contains information about component. +swagger:model GetPXCComponentsOKBodyVersionsItems0MatrixPMMAnon +*/ +type GetPXCComponentsOKBodyVersionsItems0MatrixPMMAnon struct { + + // image path + ImagePath string `json:"image_path,omitempty"` + + // image hash + ImageHash string `json:"image_hash,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // critical + Critical bool `json:"critical,omitempty"` + + // default + Default bool `json:"default,omitempty"` + + // disabled + Disabled bool `json:"disabled,omitempty"` +} + +// Validate validates this get PXC components OK body versions items0 matrix PMM anon +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixPMMAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC components OK body versions items0 matrix PMM anon based on context it is used +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixPMMAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixPMMAnon) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixPMMAnon) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsOKBodyVersionsItems0MatrixPMMAnon + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetPXCComponentsOKBodyVersionsItems0MatrixPXCAnon Component contains information about component. +swagger:model GetPXCComponentsOKBodyVersionsItems0MatrixPXCAnon +*/ +type GetPXCComponentsOKBodyVersionsItems0MatrixPXCAnon struct { + + // image path + ImagePath string `json:"image_path,omitempty"` + + // image hash + ImageHash string `json:"image_hash,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // critical + Critical bool `json:"critical,omitempty"` + + // default + Default bool `json:"default,omitempty"` + + // disabled + Disabled bool `json:"disabled,omitempty"` +} + +// Validate validates this get PXC components OK body versions items0 matrix PXC anon +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixPXCAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC components OK body versions items0 matrix PXC anon based on context it is used +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixPXCAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixPXCAnon) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixPXCAnon) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsOKBodyVersionsItems0MatrixPXCAnon + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetPXCComponentsOKBodyVersionsItems0MatrixProxysqlAnon Component contains information about component. +swagger:model GetPXCComponentsOKBodyVersionsItems0MatrixProxysqlAnon +*/ +type GetPXCComponentsOKBodyVersionsItems0MatrixProxysqlAnon struct { + + // image path + ImagePath string `json:"image_path,omitempty"` + + // image hash + ImageHash string `json:"image_hash,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // critical + Critical bool `json:"critical,omitempty"` + + // default + Default bool `json:"default,omitempty"` + + // disabled + Disabled bool `json:"disabled,omitempty"` +} + +// Validate validates this get PXC components OK body versions items0 matrix proxysql anon +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixProxysqlAnon) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC components OK body versions items0 matrix proxysql anon based on context it is used +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixProxysqlAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixProxysqlAnon) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCComponentsOKBodyVersionsItems0MatrixProxysqlAnon) UnmarshalBinary(b []byte) error { + var res GetPXCComponentsOKBodyVersionsItems0MatrixProxysqlAnon + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/dbaas/json/client/components/install_operator_parameters.go b/api/managementpb/dbaas/json/client/components/install_operator_parameters.go index 615e0905bd..0e6ffd2dd7 100644 --- a/api/managementpb/dbaas/json/client/components/install_operator_parameters.go +++ b/api/managementpb/dbaas/json/client/components/install_operator_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewInstallOperatorParams creates a new InstallOperatorParams object -// with the default values initialized. +// NewInstallOperatorParams creates a new InstallOperatorParams 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 NewInstallOperatorParams() *InstallOperatorParams { - var () return &InstallOperatorParams{ - timeout: cr.DefaultTimeout, } } // NewInstallOperatorParamsWithTimeout creates a new InstallOperatorParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewInstallOperatorParamsWithTimeout(timeout time.Duration) *InstallOperatorParams { - var () return &InstallOperatorParams{ - timeout: timeout, } } // NewInstallOperatorParamsWithContext creates a new InstallOperatorParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewInstallOperatorParamsWithContext(ctx context.Context) *InstallOperatorParams { - var () return &InstallOperatorParams{ - Context: ctx, } } // NewInstallOperatorParamsWithHTTPClient creates a new InstallOperatorParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewInstallOperatorParamsWithHTTPClient(client *http.Client) *InstallOperatorParams { - var () return &InstallOperatorParams{ HTTPClient: client, } } -/*InstallOperatorParams contains all the parameters to send to the API endpoint -for the install operator operation typically these are written to a http.Request +/* InstallOperatorParams contains all the parameters to send to the API endpoint + for the install operator operation. + + Typically these are written to a http.Request. */ type InstallOperatorParams struct { - /*Body*/ + // Body. Body InstallOperatorBody timeout time.Duration @@ -68,6 +67,21 @@ type InstallOperatorParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the install operator params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InstallOperatorParams) WithDefaults() *InstallOperatorParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the install operator params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InstallOperatorParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the install operator params func (o *InstallOperatorParams) WithTimeout(timeout time.Duration) *InstallOperatorParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *InstallOperatorParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/components/install_operator_responses.go b/api/managementpb/dbaas/json/client/components/install_operator_responses.go index 091f3dbef4..233796e239 100644 --- a/api/managementpb/dbaas/json/client/components/install_operator_responses.go +++ b/api/managementpb/dbaas/json/client/components/install_operator_responses.go @@ -6,6 +6,7 @@ package components // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewInstallOperatorOK() *InstallOperatorOK { return &InstallOperatorOK{} } -/*InstallOperatorOK handles this case with default header values. +/* InstallOperatorOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type InstallOperatorOK struct { func (o *InstallOperatorOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/InstallOperator][%d] installOperatorOk %+v", 200, o.Payload) } - func (o *InstallOperatorOK) GetPayload() *InstallOperatorOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewInstallOperatorDefault(code int) *InstallOperatorDefault { } } -/*InstallOperatorDefault handles this case with default header values. +/* InstallOperatorDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *InstallOperatorDefault) Code() int { func (o *InstallOperatorDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Components/InstallOperator][%d] InstallOperator default %+v", o._statusCode, o.Payload) } - func (o *InstallOperatorDefault) GetPayload() *InstallOperatorDefaultBody { return o.Payload } @@ -139,6 +138,11 @@ func (o *InstallOperatorBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this install operator body based on context it is used +func (o *InstallOperatorBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *InstallOperatorBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -172,7 +176,7 @@ type InstallOperatorDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*InstallOperatorDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this install operator default body @@ -190,7 +194,6 @@ func (o *InstallOperatorDefaultBody) Validate(formats strfmt.Registry) error { } func (o *InstallOperatorDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -204,6 +207,42 @@ func (o *InstallOperatorDefaultBody) validateDetails(formats strfmt.Registry) er if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("InstallOperator default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("InstallOperator default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this install operator default body based on the context it is used +func (o *InstallOperatorDefaultBody) 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 *InstallOperatorDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("InstallOperator default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("InstallOperator default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -232,6 +271,47 @@ func (o *InstallOperatorDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*InstallOperatorDefaultBodyDetailsItems0 install operator default body details items0 +swagger:model InstallOperatorDefaultBodyDetailsItems0 +*/ +type InstallOperatorDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this install operator default body details items0 +func (o *InstallOperatorDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this install operator default body details items0 based on context it is used +func (o *InstallOperatorDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *InstallOperatorDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *InstallOperatorDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res InstallOperatorDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*InstallOperatorOKBody install operator OK body swagger:model InstallOperatorOKBody */ @@ -297,7 +377,6 @@ func (o *InstallOperatorOKBody) validateStatusEnum(path, location string, value } func (o *InstallOperatorOKBody) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -310,6 +389,11 @@ func (o *InstallOperatorOKBody) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validates this install operator OK body based on context it is used +func (o *InstallOperatorOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *InstallOperatorOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/client/db_clusters/db_clusters_client.go b/api/managementpb/dbaas/json/client/db_clusters/db_clusters_client.go index 7472b32934..606dffd5c7 100644 --- a/api/managementpb/dbaas/json/client/db_clusters/db_clusters_client.go +++ b/api/managementpb/dbaas/json/client/db_clusters/db_clusters_client.go @@ -23,13 +23,16 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - DeleteDBCluster(params *DeleteDBClusterParams) (*DeleteDBClusterOK, error) + DeleteDBCluster(params *DeleteDBClusterParams, opts ...ClientOption) (*DeleteDBClusterOK, error) - ListDBClusters(params *ListDBClustersParams) (*ListDBClustersOK, error) + ListDBClusters(params *ListDBClustersParams, opts ...ClientOption) (*ListDBClustersOK, error) - RestartDBCluster(params *RestartDBClusterParams) (*RestartDBClusterOK, error) + RestartDBCluster(params *RestartDBClusterParams, opts ...ClientOption) (*RestartDBClusterOK, error) SetTransport(transport runtime.ClientTransport) } @@ -37,13 +40,12 @@ type ClientService interface { /* DeleteDBCluster deletes DB cluster deletes DB cluster */ -func (a *Client) DeleteDBCluster(params *DeleteDBClusterParams) (*DeleteDBClusterOK, error) { +func (a *Client) DeleteDBCluster(params *DeleteDBClusterParams, opts ...ClientOption) (*DeleteDBClusterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteDBClusterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "DeleteDBCluster", Method: "POST", PathPattern: "/v1/management/DBaaS/DBClusters/Delete", @@ -54,7 +56,12 @@ func (a *Client) DeleteDBCluster(params *DeleteDBClusterParams) (*DeleteDBCluste Reader: &DeleteDBClusterReader{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 } @@ -70,13 +77,12 @@ func (a *Client) DeleteDBCluster(params *DeleteDBClusterParams) (*DeleteDBCluste /* ListDBClusters lists DB clusters returns a list of DB clusters */ -func (a *Client) ListDBClusters(params *ListDBClustersParams) (*ListDBClustersOK, error) { +func (a *Client) ListDBClusters(params *ListDBClustersParams, opts ...ClientOption) (*ListDBClustersOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListDBClustersParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListDBClusters", Method: "POST", PathPattern: "/v1/management/DBaaS/DBClusters/List", @@ -87,7 +93,12 @@ func (a *Client) ListDBClusters(params *ListDBClustersParams) (*ListDBClustersOK Reader: &ListDBClustersReader{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 } @@ -103,13 +114,12 @@ func (a *Client) ListDBClusters(params *ListDBClustersParams) (*ListDBClustersOK /* RestartDBCluster restarts DB cluster restarts DB cluster */ -func (a *Client) RestartDBCluster(params *RestartDBClusterParams) (*RestartDBClusterOK, error) { +func (a *Client) RestartDBCluster(params *RestartDBClusterParams, opts ...ClientOption) (*RestartDBClusterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRestartDBClusterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RestartDBCluster", Method: "POST", PathPattern: "/v1/management/DBaaS/DBClusters/Restart", @@ -120,7 +130,12 @@ func (a *Client) RestartDBCluster(params *RestartDBClusterParams) (*RestartDBClu Reader: &RestartDBClusterReader{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 } diff --git a/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_parameters.go b/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_parameters.go index 65fff3f214..1b3b5cc393 100644 --- a/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_parameters.go +++ b/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteDBClusterParams creates a new DeleteDBClusterParams object -// with the default values initialized. +// NewDeleteDBClusterParams creates a new DeleteDBClusterParams 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 NewDeleteDBClusterParams() *DeleteDBClusterParams { - var () return &DeleteDBClusterParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteDBClusterParamsWithTimeout creates a new DeleteDBClusterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteDBClusterParamsWithTimeout(timeout time.Duration) *DeleteDBClusterParams { - var () return &DeleteDBClusterParams{ - timeout: timeout, } } // NewDeleteDBClusterParamsWithContext creates a new DeleteDBClusterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteDBClusterParamsWithContext(ctx context.Context) *DeleteDBClusterParams { - var () return &DeleteDBClusterParams{ - Context: ctx, } } // NewDeleteDBClusterParamsWithHTTPClient creates a new DeleteDBClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteDBClusterParamsWithHTTPClient(client *http.Client) *DeleteDBClusterParams { - var () return &DeleteDBClusterParams{ HTTPClient: client, } } -/*DeleteDBClusterParams contains all the parameters to send to the API endpoint -for the delete DB cluster operation typically these are written to a http.Request +/* DeleteDBClusterParams contains all the parameters to send to the API endpoint + for the delete DB cluster operation. + + Typically these are written to a http.Request. */ type DeleteDBClusterParams struct { - /*Body*/ + // Body. Body DeleteDBClusterBody timeout time.Duration @@ -68,6 +67,21 @@ type DeleteDBClusterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete DB cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDBClusterParams) WithDefaults() *DeleteDBClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete DB cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDBClusterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete DB cluster params func (o *DeleteDBClusterParams) WithTimeout(timeout time.Duration) *DeleteDBClusterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *DeleteDBClusterParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_responses.go b/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_responses.go index 5f6fbd1c9d..2baed5f5e2 100644 --- a/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_responses.go +++ b/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_responses.go @@ -6,6 +6,7 @@ package db_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewDeleteDBClusterOK() *DeleteDBClusterOK { return &DeleteDBClusterOK{} } -/*DeleteDBClusterOK handles this case with default header values. +/* DeleteDBClusterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type DeleteDBClusterOK struct { func (o *DeleteDBClusterOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/DBClusters/Delete][%d] deleteDbClusterOk %+v", 200, o.Payload) } - func (o *DeleteDBClusterOK) GetPayload() interface{} { return o.Payload } @@ -82,7 +82,7 @@ func NewDeleteDBClusterDefault(code int) *DeleteDBClusterDefault { } } -/*DeleteDBClusterDefault handles this case with default header values. +/* DeleteDBClusterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *DeleteDBClusterDefault) Code() int { func (o *DeleteDBClusterDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/DBClusters/Delete][%d] DeleteDBCluster default %+v", o._statusCode, o.Payload) } - func (o *DeleteDBClusterDefault) GetPayload() *DeleteDBClusterDefaultBody { return o.Payload } @@ -184,7 +183,6 @@ func (o *DeleteDBClusterBody) validateClusterTypeEnum(path, location string, val } func (o *DeleteDBClusterBody) validateClusterType(formats strfmt.Registry) error { - if swag.IsZero(o.ClusterType) { // not required return nil } @@ -197,6 +195,11 @@ func (o *DeleteDBClusterBody) validateClusterType(formats strfmt.Registry) error return nil } +// ContextValidate validates this delete DB cluster body based on context it is used +func (o *DeleteDBClusterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *DeleteDBClusterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -230,7 +233,7 @@ type DeleteDBClusterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*DeleteDBClusterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this delete DB cluster default body @@ -248,7 +251,6 @@ func (o *DeleteDBClusterDefaultBody) Validate(formats strfmt.Registry) error { } func (o *DeleteDBClusterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -262,6 +264,42 @@ func (o *DeleteDBClusterDefaultBody) validateDetails(formats strfmt.Registry) er if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("DeleteDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("DeleteDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this delete DB cluster default body based on the context it is used +func (o *DeleteDBClusterDefaultBody) 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 *DeleteDBClusterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DeleteDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("DeleteDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -290,10 +328,10 @@ func (o *DeleteDBClusterDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*DeleteDBClusterDefaultBodyDetailsItems0 delete DB cluster default body details items0 +swagger:model DeleteDBClusterDefaultBodyDetailsItems0 */ -type DetailsItems0 struct { +type DeleteDBClusterDefaultBodyDetailsItems0 struct { // type url TypeURL string `json:"type_url,omitempty"` @@ -303,13 +341,18 @@ type DetailsItems0 struct { Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this delete DB cluster default body details items0 +func (o *DeleteDBClusterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this delete DB cluster default body details items0 based on context it is used +func (o *DeleteDBClusterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *DeleteDBClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -317,8 +360,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *DeleteDBClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res DeleteDBClusterDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_parameters.go b/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_parameters.go index 5694231802..3734d6f892 100644 --- a/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_parameters.go +++ b/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListDBClustersParams creates a new ListDBClustersParams object -// with the default values initialized. +// NewListDBClustersParams creates a new ListDBClustersParams 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 NewListDBClustersParams() *ListDBClustersParams { - var () return &ListDBClustersParams{ - timeout: cr.DefaultTimeout, } } // NewListDBClustersParamsWithTimeout creates a new ListDBClustersParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListDBClustersParamsWithTimeout(timeout time.Duration) *ListDBClustersParams { - var () return &ListDBClustersParams{ - timeout: timeout, } } // NewListDBClustersParamsWithContext creates a new ListDBClustersParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListDBClustersParamsWithContext(ctx context.Context) *ListDBClustersParams { - var () return &ListDBClustersParams{ - Context: ctx, } } // NewListDBClustersParamsWithHTTPClient creates a new ListDBClustersParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListDBClustersParamsWithHTTPClient(client *http.Client) *ListDBClustersParams { - var () return &ListDBClustersParams{ HTTPClient: client, } } -/*ListDBClustersParams contains all the parameters to send to the API endpoint -for the list DB clusters operation typically these are written to a http.Request +/* ListDBClustersParams contains all the parameters to send to the API endpoint + for the list DB clusters operation. + + Typically these are written to a http.Request. */ type ListDBClustersParams struct { - /*Body*/ + // Body. Body ListDBClustersBody timeout time.Duration @@ -68,6 +67,21 @@ type ListDBClustersParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list DB clusters params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListDBClustersParams) WithDefaults() *ListDBClustersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list DB clusters params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListDBClustersParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list DB clusters params func (o *ListDBClustersParams) WithTimeout(timeout time.Duration) *ListDBClustersParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ListDBClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_responses.go b/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_responses.go index 8c6fea82d1..d5202a9e89 100644 --- a/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_responses.go +++ b/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_responses.go @@ -6,6 +6,7 @@ package db_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListDBClustersOK() *ListDBClustersOK { return &ListDBClustersOK{} } -/*ListDBClustersOK handles this case with default header values. +/* ListDBClustersOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListDBClustersOK struct { func (o *ListDBClustersOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/DBClusters/List][%d] listDbClustersOk %+v", 200, o.Payload) } - func (o *ListDBClustersOK) GetPayload() *ListDBClustersOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListDBClustersDefault(code int) *ListDBClustersDefault { } } -/*ListDBClustersDefault handles this case with default header values. +/* ListDBClustersDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListDBClustersDefault) Code() int { func (o *ListDBClustersDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/DBClusters/List][%d] ListDBClusters default %+v", o._statusCode, o.Payload) } - func (o *ListDBClustersDefault) GetPayload() *ListDBClustersDefaultBody { return o.Payload } @@ -133,6 +132,11 @@ func (o *ListDBClustersBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list DB clusters body based on context it is used +func (o *ListDBClustersBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ListDBClustersBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -166,7 +170,7 @@ type ListDBClustersDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ListDBClustersDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this list DB clusters default body @@ -184,7 +188,6 @@ func (o *ListDBClustersDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ListDBClustersDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -198,6 +201,42 @@ func (o *ListDBClustersDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListDBClusters default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListDBClusters default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list DB clusters default body based on the context it is used +func (o *ListDBClustersDefaultBody) 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 *ListDBClustersDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListDBClusters default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListDBClusters default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -226,16 +265,57 @@ func (o *ListDBClustersDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ListDBClustersDefaultBodyDetailsItems0 list DB clusters default body details items0 +swagger:model ListDBClustersDefaultBodyDetailsItems0 +*/ +type ListDBClustersDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this list DB clusters default body details items0 +func (o *ListDBClustersDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list DB clusters default body details items0 based on context it is used +func (o *ListDBClustersDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListDBClustersDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListDBClustersDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ListDBClustersDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ListDBClustersOKBody list DB clusters OK body swagger:model ListDBClustersOKBody */ type ListDBClustersOKBody struct { // PXC clusters information. - PXCClusters []*PXCClustersItems0 `json:"pxc_clusters"` + PXCClusters []*ListDBClustersOKBodyPXCClustersItems0 `json:"pxc_clusters"` // PSMDB clusters information. - PSMDBClusters []*PSMDBClustersItems0 `json:"psmdb_clusters"` + PSMDBClusters []*ListDBClustersOKBodyPSMDBClustersItems0 `json:"psmdb_clusters"` } // Validate validates this list DB clusters OK body @@ -257,7 +337,6 @@ func (o *ListDBClustersOKBody) Validate(formats strfmt.Registry) error { } func (o *ListDBClustersOKBody) validatePXCClusters(formats strfmt.Registry) error { - if swag.IsZero(o.PXCClusters) { // not required return nil } @@ -271,6 +350,8 @@ func (o *ListDBClustersOKBody) validatePXCClusters(formats strfmt.Registry) erro if err := o.PXCClusters[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listDbClustersOk" + "." + "pxc_clusters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listDbClustersOk" + "." + "pxc_clusters" + "." + strconv.Itoa(i)) } return err } @@ -282,7 +363,6 @@ func (o *ListDBClustersOKBody) validatePXCClusters(formats strfmt.Registry) erro } func (o *ListDBClustersOKBody) validatePSMDBClusters(formats strfmt.Registry) error { - if swag.IsZero(o.PSMDBClusters) { // not required return nil } @@ -296,6 +376,66 @@ func (o *ListDBClustersOKBody) validatePSMDBClusters(formats strfmt.Registry) er if err := o.PSMDBClusters[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listDbClustersOk" + "." + "psmdb_clusters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listDbClustersOk" + "." + "psmdb_clusters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list DB clusters OK body based on the context it is used +func (o *ListDBClustersOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePXCClusters(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePSMDBClusters(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListDBClustersOKBody) contextValidatePXCClusters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.PXCClusters); i++ { + + if o.PXCClusters[i] != nil { + if err := o.PXCClusters[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listDbClustersOk" + "." + "pxc_clusters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listDbClustersOk" + "." + "pxc_clusters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *ListDBClustersOKBody) contextValidatePSMDBClusters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.PSMDBClusters); i++ { + + if o.PSMDBClusters[i] != nil { + if err := o.PSMDBClusters[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listDbClustersOk" + "." + "psmdb_clusters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listDbClustersOk" + "." + "psmdb_clusters" + "." + strconv.Itoa(i)) } return err } @@ -324,27 +464,14 @@ func (o *ListDBClustersOKBody) UnmarshalBinary(b []byte) error { return nil } -/*PSMDBClustersItems0 PSMDBCluster represents PSMDB cluster information. -swagger:model PSMDBClustersItems0 +/*ListDBClustersOKBodyPSMDBClustersItems0 PSMDBCluster represents PSMDB cluster information. +swagger:model ListDBClustersOKBodyPSMDBClustersItems0 */ -type PSMDBClustersItems0 struct { +type ListDBClustersOKBodyPSMDBClustersItems0 struct { // Cluster name. Name string `json:"name,omitempty"` - // DBClusterState represents DB cluster CR state. - // - // - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state. - // - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed. - // - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes. - // - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster. - // - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting. - // - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused. - // - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING. - // It indicates database cluster upgrade is ongoing. - // Enum: [DB_CLUSTER_STATE_INVALID DB_CLUSTER_STATE_CHANGING DB_CLUSTER_STATE_READY DB_CLUSTER_STATE_FAILED DB_CLUSTER_STATE_DELETING DB_CLUSTER_STATE_PAUSED DB_CLUSTER_STATE_UPGRADING] - State *string `json:"state,omitempty"` - // DB cluster accessible outside of K8s cluster. Exposed bool `json:"exposed,omitempty"` @@ -356,25 +483,38 @@ type PSMDBClustersItems0 struct { AvailableImage string `json:"available_image,omitempty"` // operation - Operation *PSMDBClustersItems0Operation `json:"operation,omitempty"` + Operation *ListDBClustersOKBodyPSMDBClustersItems0Operation `json:"operation,omitempty"` // params - Params *PSMDBClustersItems0Params `json:"params,omitempty"` + Params *ListDBClustersOKBodyPSMDBClustersItems0Params `json:"params,omitempty"` + + // DBClusterState represents DB cluster CR state. + // + // - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state. + // - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed. + // - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes. + // - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster. + // - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting. + // - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused. + // - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING. + // It indicates database cluster upgrade is ongoing. + // Enum: [DB_CLUSTER_STATE_INVALID DB_CLUSTER_STATE_CHANGING DB_CLUSTER_STATE_READY DB_CLUSTER_STATE_FAILED DB_CLUSTER_STATE_DELETING DB_CLUSTER_STATE_PAUSED DB_CLUSTER_STATE_UPGRADING] + State *string `json:"state,omitempty"` } -// Validate validates this PSMDB clusters items0 -func (o *PSMDBClustersItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PSMDB clusters items0 +func (o *ListDBClustersOKBodyPSMDBClustersItems0) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateState(formats); err != nil { + if err := o.validateOperation(formats); err != nil { res = append(res, err) } - if err := o.validateOperation(formats); err != nil { + if err := o.validateParams(formats); err != nil { res = append(res, err) } - if err := o.validateParams(formats); err != nil { + if err := o.validateState(formats); err != nil { res = append(res, err) } @@ -384,7 +524,45 @@ func (o *PSMDBClustersItems0) Validate(formats strfmt.Registry) error { return nil } -var psmdbClustersItems0TypeStatePropEnum []interface{} +func (o *ListDBClustersOKBodyPSMDBClustersItems0) validateOperation(formats strfmt.Registry) error { + if swag.IsZero(o.Operation) { // not required + return nil + } + + if o.Operation != nil { + if err := o.Operation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operation") + } + return err + } + } + + return nil +} + +func (o *ListDBClustersOKBodyPSMDBClustersItems0) validateParams(formats strfmt.Registry) error { + if swag.IsZero(o.Params) { // not required + return nil + } + + if o.Params != nil { + if err := o.Params.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params") + } + return err + } + } + + return nil +} + +var listDbClustersOkBodyPsmdbClustersItems0TypeStatePropEnum []interface{} func init() { var res []string @@ -392,44 +570,43 @@ func init() { panic(err) } for _, v := range res { - psmdbClustersItems0TypeStatePropEnum = append(psmdbClustersItems0TypeStatePropEnum, v) + listDbClustersOkBodyPsmdbClustersItems0TypeStatePropEnum = append(listDbClustersOkBodyPsmdbClustersItems0TypeStatePropEnum, v) } } const ( - // PSMDBClustersItems0StateDBCLUSTERSTATEINVALID captures enum value "DB_CLUSTER_STATE_INVALID" - PSMDBClustersItems0StateDBCLUSTERSTATEINVALID string = "DB_CLUSTER_STATE_INVALID" + // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEINVALID captures enum value "DB_CLUSTER_STATE_INVALID" + ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEINVALID string = "DB_CLUSTER_STATE_INVALID" - // PSMDBClustersItems0StateDBCLUSTERSTATECHANGING captures enum value "DB_CLUSTER_STATE_CHANGING" - PSMDBClustersItems0StateDBCLUSTERSTATECHANGING string = "DB_CLUSTER_STATE_CHANGING" + // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATECHANGING captures enum value "DB_CLUSTER_STATE_CHANGING" + ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATECHANGING string = "DB_CLUSTER_STATE_CHANGING" - // PSMDBClustersItems0StateDBCLUSTERSTATEREADY captures enum value "DB_CLUSTER_STATE_READY" - PSMDBClustersItems0StateDBCLUSTERSTATEREADY string = "DB_CLUSTER_STATE_READY" + // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEREADY captures enum value "DB_CLUSTER_STATE_READY" + ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEREADY string = "DB_CLUSTER_STATE_READY" - // PSMDBClustersItems0StateDBCLUSTERSTATEFAILED captures enum value "DB_CLUSTER_STATE_FAILED" - PSMDBClustersItems0StateDBCLUSTERSTATEFAILED string = "DB_CLUSTER_STATE_FAILED" + // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEFAILED captures enum value "DB_CLUSTER_STATE_FAILED" + ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEFAILED string = "DB_CLUSTER_STATE_FAILED" - // PSMDBClustersItems0StateDBCLUSTERSTATEDELETING captures enum value "DB_CLUSTER_STATE_DELETING" - PSMDBClustersItems0StateDBCLUSTERSTATEDELETING string = "DB_CLUSTER_STATE_DELETING" + // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEDELETING captures enum value "DB_CLUSTER_STATE_DELETING" + ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEDELETING string = "DB_CLUSTER_STATE_DELETING" - // PSMDBClustersItems0StateDBCLUSTERSTATEPAUSED captures enum value "DB_CLUSTER_STATE_PAUSED" - PSMDBClustersItems0StateDBCLUSTERSTATEPAUSED string = "DB_CLUSTER_STATE_PAUSED" + // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEPAUSED captures enum value "DB_CLUSTER_STATE_PAUSED" + ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEPAUSED string = "DB_CLUSTER_STATE_PAUSED" - // PSMDBClustersItems0StateDBCLUSTERSTATEUPGRADING captures enum value "DB_CLUSTER_STATE_UPGRADING" - PSMDBClustersItems0StateDBCLUSTERSTATEUPGRADING string = "DB_CLUSTER_STATE_UPGRADING" + // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEUPGRADING captures enum value "DB_CLUSTER_STATE_UPGRADING" + ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEUPGRADING string = "DB_CLUSTER_STATE_UPGRADING" ) // prop value enum -func (o *PSMDBClustersItems0) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, psmdbClustersItems0TypeStatePropEnum, true); err != nil { +func (o *ListDBClustersOKBodyPSMDBClustersItems0) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listDbClustersOkBodyPsmdbClustersItems0TypeStatePropEnum, true); err != nil { return err } return nil } -func (o *PSMDBClustersItems0) validateState(formats strfmt.Registry) error { - +func (o *ListDBClustersOKBodyPSMDBClustersItems0) validateState(formats strfmt.Registry) error { if swag.IsZero(o.State) { // not required return nil } @@ -442,16 +619,32 @@ func (o *PSMDBClustersItems0) validateState(formats strfmt.Registry) error { return nil } -func (o *PSMDBClustersItems0) validateOperation(formats strfmt.Registry) error { +// ContextValidate validate this list DB clusters OK body PSMDB clusters items0 based on the context it is used +func (o *ListDBClustersOKBodyPSMDBClustersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.Operation) { // not required - return nil + if err := o.contextValidateOperation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateParams(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) } + return nil +} + +func (o *ListDBClustersOKBodyPSMDBClustersItems0) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { if o.Operation != nil { - if err := o.Operation.Validate(formats); err != nil { + if err := o.Operation.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operation") } return err } @@ -460,16 +653,14 @@ func (o *PSMDBClustersItems0) validateOperation(formats strfmt.Registry) error { return nil } -func (o *PSMDBClustersItems0) validateParams(formats strfmt.Registry) error { - - if swag.IsZero(o.Params) { // not required - return nil - } +func (o *ListDBClustersOKBodyPSMDBClustersItems0) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { if o.Params != nil { - if err := o.Params.Validate(formats); err != nil { + if err := o.Params.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params") } return err } @@ -479,7 +670,7 @@ func (o *PSMDBClustersItems0) validateParams(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (o *PSMDBClustersItems0) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPSMDBClustersItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -487,8 +678,8 @@ func (o *PSMDBClustersItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PSMDBClustersItems0) UnmarshalBinary(b []byte) error { - var res PSMDBClustersItems0 +func (o *ListDBClustersOKBodyPSMDBClustersItems0) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPSMDBClustersItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -496,10 +687,10 @@ func (o *PSMDBClustersItems0) UnmarshalBinary(b []byte) error { return nil } -/*PSMDBClustersItems0Operation RunningOperation respresents a long-running operation. -swagger:model PSMDBClustersItems0Operation +/*ListDBClustersOKBodyPSMDBClustersItems0Operation RunningOperation respresents a long-running operation. +swagger:model ListDBClustersOKBodyPSMDBClustersItems0Operation */ -type PSMDBClustersItems0Operation struct { +type ListDBClustersOKBodyPSMDBClustersItems0Operation struct { // Finished steps of the operaion; can decrease or increase compared to the previous value. FinishedSteps int32 `json:"finished_steps,omitempty"` @@ -511,13 +702,18 @@ type PSMDBClustersItems0Operation struct { TotalSteps int32 `json:"total_steps,omitempty"` } -// Validate validates this PSMDB clusters items0 operation -func (o *PSMDBClustersItems0Operation) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PSMDB clusters items0 operation +func (o *ListDBClustersOKBodyPSMDBClustersItems0Operation) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list DB clusters OK body PSMDB clusters items0 operation based on context it is used +func (o *ListDBClustersOKBodyPSMDBClustersItems0Operation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *PSMDBClustersItems0Operation) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPSMDBClustersItems0Operation) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -525,8 +721,8 @@ func (o *PSMDBClustersItems0Operation) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PSMDBClustersItems0Operation) UnmarshalBinary(b []byte) error { - var res PSMDBClustersItems0Operation +func (o *ListDBClustersOKBodyPSMDBClustersItems0Operation) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPSMDBClustersItems0Operation if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -534,10 +730,10 @@ func (o *PSMDBClustersItems0Operation) UnmarshalBinary(b []byte) error { return nil } -/*PSMDBClustersItems0Params PSMDBClusterParams represents PSMDB cluster parameters that can be updated. -swagger:model PSMDBClustersItems0Params +/*ListDBClustersOKBodyPSMDBClustersItems0Params PSMDBClusterParams represents PSMDB cluster parameters that can be updated. +swagger:model ListDBClustersOKBodyPSMDBClustersItems0Params */ -type PSMDBClustersItems0Params struct { +type ListDBClustersOKBodyPSMDBClustersItems0Params struct { // Cluster size. ClusterSize int32 `json:"cluster_size,omitempty"` @@ -546,11 +742,11 @@ type PSMDBClustersItems0Params struct { Image string `json:"image,omitempty"` // replicaset - Replicaset *PSMDBClustersItems0ParamsReplicaset `json:"replicaset,omitempty"` + Replicaset *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset `json:"replicaset,omitempty"` } -// Validate validates this PSMDB clusters items0 params -func (o *PSMDBClustersItems0Params) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PSMDB clusters items0 params +func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) Validate(formats strfmt.Registry) error { var res []error if err := o.validateReplicaset(formats); err != nil { @@ -563,8 +759,7 @@ func (o *PSMDBClustersItems0Params) Validate(formats strfmt.Registry) error { return nil } -func (o *PSMDBClustersItems0Params) validateReplicaset(formats strfmt.Registry) error { - +func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) validateReplicaset(formats strfmt.Registry) error { if swag.IsZero(o.Replicaset) { // not required return nil } @@ -573,6 +768,38 @@ func (o *PSMDBClustersItems0Params) validateReplicaset(formats strfmt.Registry) if err := o.Replicaset.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params" + "." + "replicaset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "replicaset") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list DB clusters OK body PSMDB clusters items0 params based on the context it is used +func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateReplicaset(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) contextValidateReplicaset(ctx context.Context, formats strfmt.Registry) error { + + if o.Replicaset != nil { + if err := o.Replicaset.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + "replicaset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "replicaset") } return err } @@ -582,7 +809,7 @@ func (o *PSMDBClustersItems0Params) validateReplicaset(formats strfmt.Registry) } // MarshalBinary interface implementation -func (o *PSMDBClustersItems0Params) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -590,8 +817,8 @@ func (o *PSMDBClustersItems0Params) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PSMDBClustersItems0Params) UnmarshalBinary(b []byte) error { - var res PSMDBClustersItems0Params +func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPSMDBClustersItems0Params if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -599,21 +826,21 @@ func (o *PSMDBClustersItems0Params) UnmarshalBinary(b []byte) error { return nil } -/*PSMDBClustersItems0ParamsReplicaset ReplicaSet container parameters. +/*ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset ReplicaSet container parameters. // TODO Do not use inner messages in all public APIs (for consistency). -swagger:model PSMDBClustersItems0ParamsReplicaset +swagger:model ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset */ -type PSMDBClustersItems0ParamsReplicaset struct { +type ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset struct { // Disk size in bytes. DiskSize string `json:"disk_size,omitempty"` // compute resources - ComputeResources *PSMDBClustersItems0ParamsReplicasetComputeResources `json:"compute_resources,omitempty"` + ComputeResources *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources `json:"compute_resources,omitempty"` } -// Validate validates this PSMDB clusters items0 params replicaset -func (o *PSMDBClustersItems0ParamsReplicaset) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PSMDB clusters items0 params replicaset +func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset) Validate(formats strfmt.Registry) error { var res []error if err := o.validateComputeResources(formats); err != nil { @@ -626,8 +853,7 @@ func (o *PSMDBClustersItems0ParamsReplicaset) Validate(formats strfmt.Registry) return nil } -func (o *PSMDBClustersItems0ParamsReplicaset) validateComputeResources(formats strfmt.Registry) error { - +func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset) validateComputeResources(formats strfmt.Registry) error { if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -636,6 +862,38 @@ func (o *PSMDBClustersItems0ParamsReplicaset) validateComputeResources(formats s if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params" + "." + "replicaset" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "replicaset" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list DB clusters OK body PSMDB clusters items0 params replicaset based on the context it is used +func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + "replicaset" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "replicaset" + "." + "compute_resources") } return err } @@ -645,7 +903,7 @@ func (o *PSMDBClustersItems0ParamsReplicaset) validateComputeResources(formats s } // MarshalBinary interface implementation -func (o *PSMDBClustersItems0ParamsReplicaset) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -653,8 +911,8 @@ func (o *PSMDBClustersItems0ParamsReplicaset) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PSMDBClustersItems0ParamsReplicaset) UnmarshalBinary(b []byte) error { - var res PSMDBClustersItems0ParamsReplicaset +func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -662,10 +920,10 @@ func (o *PSMDBClustersItems0ParamsReplicaset) UnmarshalBinary(b []byte) error { return nil } -/*PSMDBClustersItems0ParamsReplicasetComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model PSMDBClustersItems0ParamsReplicasetComputeResources +/*ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources ComputeResources represents container computer resources requests or limits. +swagger:model ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources */ -type PSMDBClustersItems0ParamsReplicasetComputeResources struct { +type ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources struct { // CPUs in milliCPUs; 1000m = 1 vCPU. CPUm int32 `json:"cpu_m,omitempty"` @@ -674,13 +932,18 @@ type PSMDBClustersItems0ParamsReplicasetComputeResources struct { MemoryBytes string `json:"memory_bytes,omitempty"` } -// Validate validates this PSMDB clusters items0 params replicaset compute resources -func (o *PSMDBClustersItems0ParamsReplicasetComputeResources) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PSMDB clusters items0 params replicaset compute resources +func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list DB clusters OK body PSMDB clusters items0 params replicaset compute resources based on context it is used +func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *PSMDBClustersItems0ParamsReplicasetComputeResources) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -688,8 +951,8 @@ func (o *PSMDBClustersItems0ParamsReplicasetComputeResources) MarshalBinary() ([ } // UnmarshalBinary interface implementation -func (o *PSMDBClustersItems0ParamsReplicasetComputeResources) UnmarshalBinary(b []byte) error { - var res PSMDBClustersItems0ParamsReplicasetComputeResources +func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -697,27 +960,14 @@ func (o *PSMDBClustersItems0ParamsReplicasetComputeResources) UnmarshalBinary(b return nil } -/*PXCClustersItems0 PXCCluster represents PXC cluster information. -swagger:model PXCClustersItems0 +/*ListDBClustersOKBodyPXCClustersItems0 PXCCluster represents PXC cluster information. +swagger:model ListDBClustersOKBodyPXCClustersItems0 */ -type PXCClustersItems0 struct { +type ListDBClustersOKBodyPXCClustersItems0 struct { // Cluster name. Name string `json:"name,omitempty"` - // DBClusterState represents DB cluster CR state. - // - // - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state. - // - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed. - // - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes. - // - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster. - // - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting. - // - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused. - // - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING. - // It indicates database cluster upgrade is ongoing. - // Enum: [DB_CLUSTER_STATE_INVALID DB_CLUSTER_STATE_CHANGING DB_CLUSTER_STATE_READY DB_CLUSTER_STATE_FAILED DB_CLUSTER_STATE_DELETING DB_CLUSTER_STATE_PAUSED DB_CLUSTER_STATE_UPGRADING] - State *string `json:"state,omitempty"` - // DB cluster accessible outside of K8s cluster. Exposed bool `json:"exposed,omitempty"` @@ -729,25 +979,38 @@ type PXCClustersItems0 struct { AvailableImage string `json:"available_image,omitempty"` // operation - Operation *PXCClustersItems0Operation `json:"operation,omitempty"` + Operation *ListDBClustersOKBodyPXCClustersItems0Operation `json:"operation,omitempty"` // params - Params *PXCClustersItems0Params `json:"params,omitempty"` + Params *ListDBClustersOKBodyPXCClustersItems0Params `json:"params,omitempty"` + + // DBClusterState represents DB cluster CR state. + // + // - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state. + // - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed. + // - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes. + // - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster. + // - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting. + // - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused. + // - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING. + // It indicates database cluster upgrade is ongoing. + // Enum: [DB_CLUSTER_STATE_INVALID DB_CLUSTER_STATE_CHANGING DB_CLUSTER_STATE_READY DB_CLUSTER_STATE_FAILED DB_CLUSTER_STATE_DELETING DB_CLUSTER_STATE_PAUSED DB_CLUSTER_STATE_UPGRADING] + State *string `json:"state,omitempty"` } -// Validate validates this PXC clusters items0 -func (o *PXCClustersItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PXC clusters items0 +func (o *ListDBClustersOKBodyPXCClustersItems0) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateState(formats); err != nil { + if err := o.validateOperation(formats); err != nil { res = append(res, err) } - if err := o.validateOperation(formats); err != nil { + if err := o.validateParams(formats); err != nil { res = append(res, err) } - if err := o.validateParams(formats); err != nil { + if err := o.validateState(formats); err != nil { res = append(res, err) } @@ -757,7 +1020,45 @@ func (o *PXCClustersItems0) Validate(formats strfmt.Registry) error { return nil } -var pxcClustersItems0TypeStatePropEnum []interface{} +func (o *ListDBClustersOKBodyPXCClustersItems0) validateOperation(formats strfmt.Registry) error { + if swag.IsZero(o.Operation) { // not required + return nil + } + + if o.Operation != nil { + if err := o.Operation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operation") + } + return err + } + } + + return nil +} + +func (o *ListDBClustersOKBodyPXCClustersItems0) validateParams(formats strfmt.Registry) error { + if swag.IsZero(o.Params) { // not required + return nil + } + + if o.Params != nil { + if err := o.Params.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params") + } + return err + } + } + + return nil +} + +var listDbClustersOkBodyPxcClustersItems0TypeStatePropEnum []interface{} func init() { var res []string @@ -765,44 +1066,43 @@ func init() { panic(err) } for _, v := range res { - pxcClustersItems0TypeStatePropEnum = append(pxcClustersItems0TypeStatePropEnum, v) + listDbClustersOkBodyPxcClustersItems0TypeStatePropEnum = append(listDbClustersOkBodyPxcClustersItems0TypeStatePropEnum, v) } } const ( - // PXCClustersItems0StateDBCLUSTERSTATEINVALID captures enum value "DB_CLUSTER_STATE_INVALID" - PXCClustersItems0StateDBCLUSTERSTATEINVALID string = "DB_CLUSTER_STATE_INVALID" + // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEINVALID captures enum value "DB_CLUSTER_STATE_INVALID" + ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEINVALID string = "DB_CLUSTER_STATE_INVALID" - // PXCClustersItems0StateDBCLUSTERSTATECHANGING captures enum value "DB_CLUSTER_STATE_CHANGING" - PXCClustersItems0StateDBCLUSTERSTATECHANGING string = "DB_CLUSTER_STATE_CHANGING" + // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATECHANGING captures enum value "DB_CLUSTER_STATE_CHANGING" + ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATECHANGING string = "DB_CLUSTER_STATE_CHANGING" - // PXCClustersItems0StateDBCLUSTERSTATEREADY captures enum value "DB_CLUSTER_STATE_READY" - PXCClustersItems0StateDBCLUSTERSTATEREADY string = "DB_CLUSTER_STATE_READY" + // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEREADY captures enum value "DB_CLUSTER_STATE_READY" + ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEREADY string = "DB_CLUSTER_STATE_READY" - // PXCClustersItems0StateDBCLUSTERSTATEFAILED captures enum value "DB_CLUSTER_STATE_FAILED" - PXCClustersItems0StateDBCLUSTERSTATEFAILED string = "DB_CLUSTER_STATE_FAILED" + // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEFAILED captures enum value "DB_CLUSTER_STATE_FAILED" + ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEFAILED string = "DB_CLUSTER_STATE_FAILED" - // PXCClustersItems0StateDBCLUSTERSTATEDELETING captures enum value "DB_CLUSTER_STATE_DELETING" - PXCClustersItems0StateDBCLUSTERSTATEDELETING string = "DB_CLUSTER_STATE_DELETING" + // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEDELETING captures enum value "DB_CLUSTER_STATE_DELETING" + ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEDELETING string = "DB_CLUSTER_STATE_DELETING" - // PXCClustersItems0StateDBCLUSTERSTATEPAUSED captures enum value "DB_CLUSTER_STATE_PAUSED" - PXCClustersItems0StateDBCLUSTERSTATEPAUSED string = "DB_CLUSTER_STATE_PAUSED" + // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEPAUSED captures enum value "DB_CLUSTER_STATE_PAUSED" + ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEPAUSED string = "DB_CLUSTER_STATE_PAUSED" - // PXCClustersItems0StateDBCLUSTERSTATEUPGRADING captures enum value "DB_CLUSTER_STATE_UPGRADING" - PXCClustersItems0StateDBCLUSTERSTATEUPGRADING string = "DB_CLUSTER_STATE_UPGRADING" + // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEUPGRADING captures enum value "DB_CLUSTER_STATE_UPGRADING" + ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEUPGRADING string = "DB_CLUSTER_STATE_UPGRADING" ) // prop value enum -func (o *PXCClustersItems0) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pxcClustersItems0TypeStatePropEnum, true); err != nil { +func (o *ListDBClustersOKBodyPXCClustersItems0) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listDbClustersOkBodyPxcClustersItems0TypeStatePropEnum, true); err != nil { return err } return nil } -func (o *PXCClustersItems0) validateState(formats strfmt.Registry) error { - +func (o *ListDBClustersOKBodyPXCClustersItems0) validateState(formats strfmt.Registry) error { if swag.IsZero(o.State) { // not required return nil } @@ -815,16 +1115,32 @@ func (o *PXCClustersItems0) validateState(formats strfmt.Registry) error { return nil } -func (o *PXCClustersItems0) validateOperation(formats strfmt.Registry) error { +// ContextValidate validate this list DB clusters OK body PXC clusters items0 based on the context it is used +func (o *ListDBClustersOKBodyPXCClustersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.Operation) { // not required - return nil + if err := o.contextValidateOperation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateParams(ctx, formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListDBClustersOKBodyPXCClustersItems0) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { + if o.Operation != nil { - if err := o.Operation.Validate(formats); err != nil { + if err := o.Operation.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operation") } return err } @@ -833,16 +1149,14 @@ func (o *PXCClustersItems0) validateOperation(formats strfmt.Registry) error { return nil } -func (o *PXCClustersItems0) validateParams(formats strfmt.Registry) error { - - if swag.IsZero(o.Params) { // not required - return nil - } +func (o *ListDBClustersOKBodyPXCClustersItems0) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { if o.Params != nil { - if err := o.Params.Validate(formats); err != nil { + if err := o.Params.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params") } return err } @@ -852,7 +1166,7 @@ func (o *PXCClustersItems0) validateParams(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (o *PXCClustersItems0) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPXCClustersItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -860,8 +1174,8 @@ func (o *PXCClustersItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PXCClustersItems0) UnmarshalBinary(b []byte) error { - var res PXCClustersItems0 +func (o *ListDBClustersOKBodyPXCClustersItems0) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPXCClustersItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -869,10 +1183,10 @@ func (o *PXCClustersItems0) UnmarshalBinary(b []byte) error { return nil } -/*PXCClustersItems0Operation RunningOperation respresents a long-running operation. -swagger:model PXCClustersItems0Operation +/*ListDBClustersOKBodyPXCClustersItems0Operation RunningOperation respresents a long-running operation. +swagger:model ListDBClustersOKBodyPXCClustersItems0Operation */ -type PXCClustersItems0Operation struct { +type ListDBClustersOKBodyPXCClustersItems0Operation struct { // Finished steps of the operaion; can decrease or increase compared to the previous value. FinishedSteps int32 `json:"finished_steps,omitempty"` @@ -884,13 +1198,18 @@ type PXCClustersItems0Operation struct { TotalSteps int32 `json:"total_steps,omitempty"` } -// Validate validates this PXC clusters items0 operation -func (o *PXCClustersItems0Operation) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PXC clusters items0 operation +func (o *ListDBClustersOKBodyPXCClustersItems0Operation) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list DB clusters OK body PXC clusters items0 operation based on context it is used +func (o *ListDBClustersOKBodyPXCClustersItems0Operation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *PXCClustersItems0Operation) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPXCClustersItems0Operation) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -898,8 +1217,8 @@ func (o *PXCClustersItems0Operation) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PXCClustersItems0Operation) UnmarshalBinary(b []byte) error { - var res PXCClustersItems0Operation +func (o *ListDBClustersOKBodyPXCClustersItems0Operation) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPXCClustersItems0Operation if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -907,26 +1226,26 @@ func (o *PXCClustersItems0Operation) UnmarshalBinary(b []byte) error { return nil } -/*PXCClustersItems0Params PXCClusterParams represents PXC cluster parameters that can be updated. -swagger:model PXCClustersItems0Params +/*ListDBClustersOKBodyPXCClustersItems0Params PXCClusterParams represents PXC cluster parameters that can be updated. +swagger:model ListDBClustersOKBodyPXCClustersItems0Params */ -type PXCClustersItems0Params struct { +type ListDBClustersOKBodyPXCClustersItems0Params struct { // Cluster size. ClusterSize int32 `json:"cluster_size,omitempty"` // haproxy - Haproxy *PXCClustersItems0ParamsHaproxy `json:"haproxy,omitempty"` + Haproxy *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy `json:"haproxy,omitempty"` // proxysql - Proxysql *PXCClustersItems0ParamsProxysql `json:"proxysql,omitempty"` + Proxysql *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql `json:"proxysql,omitempty"` // pxc - PXC *PXCClustersItems0ParamsPXC `json:"pxc,omitempty"` + PXC *ListDBClustersOKBodyPXCClustersItems0ParamsPXC `json:"pxc,omitempty"` } -// Validate validates this PXC clusters items0 params -func (o *PXCClustersItems0Params) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PXC clusters items0 params +func (o *ListDBClustersOKBodyPXCClustersItems0Params) Validate(formats strfmt.Registry) error { var res []error if err := o.validateHaproxy(formats); err != nil { @@ -947,8 +1266,7 @@ func (o *PXCClustersItems0Params) Validate(formats strfmt.Registry) error { return nil } -func (o *PXCClustersItems0Params) validateHaproxy(formats strfmt.Registry) error { - +func (o *ListDBClustersOKBodyPXCClustersItems0Params) validateHaproxy(formats strfmt.Registry) error { if swag.IsZero(o.Haproxy) { // not required return nil } @@ -957,6 +1275,8 @@ func (o *PXCClustersItems0Params) validateHaproxy(formats strfmt.Registry) error if err := o.Haproxy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "haproxy") } return err } @@ -965,8 +1285,7 @@ func (o *PXCClustersItems0Params) validateHaproxy(formats strfmt.Registry) error return nil } -func (o *PXCClustersItems0Params) validateProxysql(formats strfmt.Registry) error { - +func (o *ListDBClustersOKBodyPXCClustersItems0Params) validateProxysql(formats strfmt.Registry) error { if swag.IsZero(o.Proxysql) { // not required return nil } @@ -975,6 +1294,8 @@ func (o *PXCClustersItems0Params) validateProxysql(formats strfmt.Registry) erro if err := o.Proxysql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "proxysql") } return err } @@ -983,8 +1304,7 @@ func (o *PXCClustersItems0Params) validateProxysql(formats strfmt.Registry) erro return nil } -func (o *PXCClustersItems0Params) validatePXC(formats strfmt.Registry) error { - +func (o *ListDBClustersOKBodyPXCClustersItems0Params) validatePXC(formats strfmt.Registry) error { if swag.IsZero(o.PXC) { // not required return nil } @@ -993,6 +1313,78 @@ func (o *PXCClustersItems0Params) validatePXC(formats strfmt.Registry) error { if err := o.PXC.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "pxc") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list DB clusters OK body PXC clusters items0 params based on the context it is used +func (o *ListDBClustersOKBodyPXCClustersItems0Params) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHaproxy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateProxysql(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePXC(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListDBClustersOKBodyPXCClustersItems0Params) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { + + if o.Haproxy != nil { + if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "haproxy") + } + return err + } + } + + return nil +} + +func (o *ListDBClustersOKBodyPXCClustersItems0Params) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { + + if o.Proxysql != nil { + if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "proxysql") + } + return err + } + } + + return nil +} + +func (o *ListDBClustersOKBodyPXCClustersItems0Params) contextValidatePXC(ctx context.Context, formats strfmt.Registry) error { + + if o.PXC != nil { + if err := o.PXC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "pxc") } return err } @@ -1002,7 +1394,7 @@ func (o *PXCClustersItems0Params) validatePXC(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (o *PXCClustersItems0Params) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPXCClustersItems0Params) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1010,8 +1402,8 @@ func (o *PXCClustersItems0Params) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PXCClustersItems0Params) UnmarshalBinary(b []byte) error { - var res PXCClustersItems0Params +func (o *ListDBClustersOKBodyPXCClustersItems0Params) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPXCClustersItems0Params if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1019,21 +1411,21 @@ func (o *PXCClustersItems0Params) UnmarshalBinary(b []byte) error { return nil } -/*PXCClustersItems0ParamsHaproxy HAProxy container parameters. +/*ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy HAProxy container parameters. // NOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it. -swagger:model PXCClustersItems0ParamsHaproxy +swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy */ -type PXCClustersItems0ParamsHaproxy struct { +type ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy struct { // Docker image used for HAProxy. Image string `json:"image,omitempty"` // compute resources - ComputeResources *PXCClustersItems0ParamsHaproxyComputeResources `json:"compute_resources,omitempty"` + ComputeResources *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources `json:"compute_resources,omitempty"` } -// Validate validates this PXC clusters items0 params haproxy -func (o *PXCClustersItems0ParamsHaproxy) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PXC clusters items0 params haproxy +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy) Validate(formats strfmt.Registry) error { var res []error if err := o.validateComputeResources(formats); err != nil { @@ -1046,8 +1438,7 @@ func (o *PXCClustersItems0ParamsHaproxy) Validate(formats strfmt.Registry) error return nil } -func (o *PXCClustersItems0ParamsHaproxy) validateComputeResources(formats strfmt.Registry) error { - +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy) validateComputeResources(formats strfmt.Registry) error { if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -1056,6 +1447,38 @@ func (o *PXCClustersItems0ParamsHaproxy) validateComputeResources(formats strfmt if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params" + "." + "haproxy" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "haproxy" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list DB clusters OK body PXC clusters items0 params haproxy based on the context it is used +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + "haproxy" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "haproxy" + "." + "compute_resources") } return err } @@ -1065,7 +1488,7 @@ func (o *PXCClustersItems0ParamsHaproxy) validateComputeResources(formats strfmt } // MarshalBinary interface implementation -func (o *PXCClustersItems0ParamsHaproxy) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1073,8 +1496,8 @@ func (o *PXCClustersItems0ParamsHaproxy) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PXCClustersItems0ParamsHaproxy) UnmarshalBinary(b []byte) error { - var res PXCClustersItems0ParamsHaproxy +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1082,10 +1505,10 @@ func (o *PXCClustersItems0ParamsHaproxy) UnmarshalBinary(b []byte) error { return nil } -/*PXCClustersItems0ParamsHaproxyComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model PXCClustersItems0ParamsHaproxyComputeResources +/*ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources ComputeResources represents container computer resources requests or limits. +swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources */ -type PXCClustersItems0ParamsHaproxyComputeResources struct { +type ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources struct { // CPUs in milliCPUs; 1000m = 1 vCPU. CPUm int32 `json:"cpu_m,omitempty"` @@ -1094,13 +1517,18 @@ type PXCClustersItems0ParamsHaproxyComputeResources struct { MemoryBytes string `json:"memory_bytes,omitempty"` } -// Validate validates this PXC clusters items0 params haproxy compute resources -func (o *PXCClustersItems0ParamsHaproxyComputeResources) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PXC clusters items0 params haproxy compute resources +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list DB clusters OK body PXC clusters items0 params haproxy compute resources based on context it is used +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *PXCClustersItems0ParamsHaproxyComputeResources) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1108,8 +1536,8 @@ func (o *PXCClustersItems0ParamsHaproxyComputeResources) MarshalBinary() ([]byte } // UnmarshalBinary interface implementation -func (o *PXCClustersItems0ParamsHaproxyComputeResources) UnmarshalBinary(b []byte) error { - var res PXCClustersItems0ParamsHaproxyComputeResources +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1117,11 +1545,11 @@ func (o *PXCClustersItems0ParamsHaproxyComputeResources) UnmarshalBinary(b []byt return nil } -/*PXCClustersItems0ParamsPXC PXC container parameters. +/*ListDBClustersOKBodyPXCClustersItems0ParamsPXC PXC container parameters. // TODO Do not use inner messages in all public APIs (for consistency). -swagger:model PXCClustersItems0ParamsPXC +swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsPXC */ -type PXCClustersItems0ParamsPXC struct { +type ListDBClustersOKBodyPXCClustersItems0ParamsPXC struct { // Docker image used for PXC. Image string `json:"image,omitempty"` @@ -1130,11 +1558,11 @@ type PXCClustersItems0ParamsPXC struct { DiskSize string `json:"disk_size,omitempty"` // compute resources - ComputeResources *PXCClustersItems0ParamsPXCComputeResources `json:"compute_resources,omitempty"` + ComputeResources *ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources `json:"compute_resources,omitempty"` } -// Validate validates this PXC clusters items0 params PXC -func (o *PXCClustersItems0ParamsPXC) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PXC clusters items0 params PXC +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXC) Validate(formats strfmt.Registry) error { var res []error if err := o.validateComputeResources(formats); err != nil { @@ -1147,8 +1575,7 @@ func (o *PXCClustersItems0ParamsPXC) Validate(formats strfmt.Registry) error { return nil } -func (o *PXCClustersItems0ParamsPXC) validateComputeResources(formats strfmt.Registry) error { - +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXC) validateComputeResources(formats strfmt.Registry) error { if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -1157,6 +1584,38 @@ func (o *PXCClustersItems0ParamsPXC) validateComputeResources(formats strfmt.Reg if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params" + "." + "pxc" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "pxc" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list DB clusters OK body PXC clusters items0 params PXC based on the context it is used +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXC) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + "pxc" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "pxc" + "." + "compute_resources") } return err } @@ -1166,7 +1625,7 @@ func (o *PXCClustersItems0ParamsPXC) validateComputeResources(formats strfmt.Reg } // MarshalBinary interface implementation -func (o *PXCClustersItems0ParamsPXC) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXC) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1174,8 +1633,8 @@ func (o *PXCClustersItems0ParamsPXC) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PXCClustersItems0ParamsPXC) UnmarshalBinary(b []byte) error { - var res PXCClustersItems0ParamsPXC +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXC) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPXCClustersItems0ParamsPXC if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1183,10 +1642,10 @@ func (o *PXCClustersItems0ParamsPXC) UnmarshalBinary(b []byte) error { return nil } -/*PXCClustersItems0ParamsPXCComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model PXCClustersItems0ParamsPXCComputeResources +/*ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources ComputeResources represents container computer resources requests or limits. +swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources */ -type PXCClustersItems0ParamsPXCComputeResources struct { +type ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources struct { // CPUs in milliCPUs; 1000m = 1 vCPU. CPUm int32 `json:"cpu_m,omitempty"` @@ -1195,13 +1654,18 @@ type PXCClustersItems0ParamsPXCComputeResources struct { MemoryBytes string `json:"memory_bytes,omitempty"` } -// Validate validates this PXC clusters items0 params PXC compute resources -func (o *PXCClustersItems0ParamsPXCComputeResources) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PXC clusters items0 params PXC compute resources +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list DB clusters OK body PXC clusters items0 params PXC compute resources based on context it is used +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *PXCClustersItems0ParamsPXCComputeResources) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1209,8 +1673,8 @@ func (o *PXCClustersItems0ParamsPXCComputeResources) MarshalBinary() ([]byte, er } // UnmarshalBinary interface implementation -func (o *PXCClustersItems0ParamsPXCComputeResources) UnmarshalBinary(b []byte) error { - var res PXCClustersItems0ParamsPXCComputeResources +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1218,11 +1682,11 @@ func (o *PXCClustersItems0ParamsPXCComputeResources) UnmarshalBinary(b []byte) e return nil } -/*PXCClustersItems0ParamsProxysql ProxySQL container parameters. +/*ListDBClustersOKBodyPXCClustersItems0ParamsProxysql ProxySQL container parameters. // TODO Do not use inner messages in all public APIs (for consistency). -swagger:model PXCClustersItems0ParamsProxysql +swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsProxysql */ -type PXCClustersItems0ParamsProxysql struct { +type ListDBClustersOKBodyPXCClustersItems0ParamsProxysql struct { // Docker image used for ProxySQL. Image string `json:"image,omitempty"` @@ -1231,11 +1695,11 @@ type PXCClustersItems0ParamsProxysql struct { DiskSize string `json:"disk_size,omitempty"` // compute resources - ComputeResources *PXCClustersItems0ParamsProxysqlComputeResources `json:"compute_resources,omitempty"` + ComputeResources *ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources `json:"compute_resources,omitempty"` } -// Validate validates this PXC clusters items0 params proxysql -func (o *PXCClustersItems0ParamsProxysql) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PXC clusters items0 params proxysql +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql) Validate(formats strfmt.Registry) error { var res []error if err := o.validateComputeResources(formats); err != nil { @@ -1248,8 +1712,7 @@ func (o *PXCClustersItems0ParamsProxysql) Validate(formats strfmt.Registry) erro return nil } -func (o *PXCClustersItems0ParamsProxysql) validateComputeResources(formats strfmt.Registry) error { - +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql) validateComputeResources(formats strfmt.Registry) error { if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -1258,6 +1721,38 @@ func (o *PXCClustersItems0ParamsProxysql) validateComputeResources(formats strfm if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params" + "." + "proxysql" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "proxysql" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list DB clusters OK body PXC clusters items0 params proxysql based on the context it is used +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + "proxysql" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + "proxysql" + "." + "compute_resources") } return err } @@ -1267,7 +1762,7 @@ func (o *PXCClustersItems0ParamsProxysql) validateComputeResources(formats strfm } // MarshalBinary interface implementation -func (o *PXCClustersItems0ParamsProxysql) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1275,8 +1770,8 @@ func (o *PXCClustersItems0ParamsProxysql) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *PXCClustersItems0ParamsProxysql) UnmarshalBinary(b []byte) error { - var res PXCClustersItems0ParamsProxysql +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPXCClustersItems0ParamsProxysql if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1284,10 +1779,10 @@ func (o *PXCClustersItems0ParamsProxysql) UnmarshalBinary(b []byte) error { return nil } -/*PXCClustersItems0ParamsProxysqlComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model PXCClustersItems0ParamsProxysqlComputeResources +/*ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources ComputeResources represents container computer resources requests or limits. +swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources */ -type PXCClustersItems0ParamsProxysqlComputeResources struct { +type ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources struct { // CPUs in milliCPUs; 1000m = 1 vCPU. CPUm int32 `json:"cpu_m,omitempty"` @@ -1296,13 +1791,18 @@ type PXCClustersItems0ParamsProxysqlComputeResources struct { MemoryBytes string `json:"memory_bytes,omitempty"` } -// Validate validates this PXC clusters items0 params proxysql compute resources -func (o *PXCClustersItems0ParamsProxysqlComputeResources) Validate(formats strfmt.Registry) error { +// Validate validates this list DB clusters OK body PXC clusters items0 params proxysql compute resources +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list DB clusters OK body PXC clusters items0 params proxysql compute resources based on context it is used +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *PXCClustersItems0ParamsProxysqlComputeResources) MarshalBinary() ([]byte, error) { +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1310,8 +1810,8 @@ func (o *PXCClustersItems0ParamsProxysqlComputeResources) MarshalBinary() ([]byt } // UnmarshalBinary interface implementation -func (o *PXCClustersItems0ParamsProxysqlComputeResources) UnmarshalBinary(b []byte) error { - var res PXCClustersItems0ParamsProxysqlComputeResources +func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources) UnmarshalBinary(b []byte) error { + var res ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_parameters.go b/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_parameters.go index 0d3df69993..63e68eee06 100644 --- a/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_parameters.go +++ b/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRestartDBClusterParams creates a new RestartDBClusterParams object -// with the default values initialized. +// NewRestartDBClusterParams creates a new RestartDBClusterParams 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 NewRestartDBClusterParams() *RestartDBClusterParams { - var () return &RestartDBClusterParams{ - timeout: cr.DefaultTimeout, } } // NewRestartDBClusterParamsWithTimeout creates a new RestartDBClusterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRestartDBClusterParamsWithTimeout(timeout time.Duration) *RestartDBClusterParams { - var () return &RestartDBClusterParams{ - timeout: timeout, } } // NewRestartDBClusterParamsWithContext creates a new RestartDBClusterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRestartDBClusterParamsWithContext(ctx context.Context) *RestartDBClusterParams { - var () return &RestartDBClusterParams{ - Context: ctx, } } // NewRestartDBClusterParamsWithHTTPClient creates a new RestartDBClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRestartDBClusterParamsWithHTTPClient(client *http.Client) *RestartDBClusterParams { - var () return &RestartDBClusterParams{ HTTPClient: client, } } -/*RestartDBClusterParams contains all the parameters to send to the API endpoint -for the restart DB cluster operation typically these are written to a http.Request +/* RestartDBClusterParams contains all the parameters to send to the API endpoint + for the restart DB cluster operation. + + Typically these are written to a http.Request. */ type RestartDBClusterParams struct { - /*Body*/ + // Body. Body RestartDBClusterBody timeout time.Duration @@ -68,6 +67,21 @@ type RestartDBClusterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the restart DB cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartDBClusterParams) WithDefaults() *RestartDBClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the restart DB cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestartDBClusterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the restart DB cluster params func (o *RestartDBClusterParams) WithTimeout(timeout time.Duration) *RestartDBClusterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *RestartDBClusterParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_responses.go b/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_responses.go index 3a9711ce71..b2186b9eb4 100644 --- a/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_responses.go +++ b/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_responses.go @@ -6,6 +6,7 @@ package db_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewRestartDBClusterOK() *RestartDBClusterOK { return &RestartDBClusterOK{} } -/*RestartDBClusterOK handles this case with default header values. +/* RestartDBClusterOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type RestartDBClusterOK struct { func (o *RestartDBClusterOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/DBClusters/Restart][%d] restartDbClusterOk %+v", 200, o.Payload) } - func (o *RestartDBClusterOK) GetPayload() interface{} { return o.Payload } @@ -82,7 +82,7 @@ func NewRestartDBClusterDefault(code int) *RestartDBClusterDefault { } } -/*RestartDBClusterDefault handles this case with default header values. +/* RestartDBClusterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *RestartDBClusterDefault) Code() int { func (o *RestartDBClusterDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/DBClusters/Restart][%d] RestartDBCluster default %+v", o._statusCode, o.Payload) } - func (o *RestartDBClusterDefault) GetPayload() *RestartDBClusterDefaultBody { return o.Payload } @@ -184,7 +183,6 @@ func (o *RestartDBClusterBody) validateClusterTypeEnum(path, location string, va } func (o *RestartDBClusterBody) validateClusterType(formats strfmt.Registry) error { - if swag.IsZero(o.ClusterType) { // not required return nil } @@ -197,6 +195,11 @@ func (o *RestartDBClusterBody) validateClusterType(formats strfmt.Registry) erro return nil } +// ContextValidate validates this restart DB cluster body based on context it is used +func (o *RestartDBClusterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *RestartDBClusterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -230,7 +233,7 @@ type RestartDBClusterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RestartDBClusterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this restart DB cluster default body @@ -248,7 +251,6 @@ func (o *RestartDBClusterDefaultBody) Validate(formats strfmt.Registry) error { } func (o *RestartDBClusterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -262,6 +264,42 @@ func (o *RestartDBClusterDefaultBody) validateDetails(formats strfmt.Registry) e if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RestartDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RestartDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this restart DB cluster default body based on the context it is used +func (o *RestartDBClusterDefaultBody) 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 *RestartDBClusterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RestartDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RestartDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -289,3 +327,44 @@ func (o *RestartDBClusterDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*RestartDBClusterDefaultBodyDetailsItems0 restart DB cluster default body details items0 +swagger:model RestartDBClusterDefaultBodyDetailsItems0 +*/ +type RestartDBClusterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this restart DB cluster default body details items0 +func (o *RestartDBClusterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this restart DB cluster default body details items0 based on context it is used +func (o *RestartDBClusterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *RestartDBClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RestartDBClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res RestartDBClusterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_parameters.go b/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_parameters.go index 790aa0bde2..b25ad30c04 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_parameters.go +++ b/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetKubernetesClusterParams creates a new GetKubernetesClusterParams object -// with the default values initialized. +// NewGetKubernetesClusterParams creates a new GetKubernetesClusterParams 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 NewGetKubernetesClusterParams() *GetKubernetesClusterParams { - var () return &GetKubernetesClusterParams{ - timeout: cr.DefaultTimeout, } } // NewGetKubernetesClusterParamsWithTimeout creates a new GetKubernetesClusterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetKubernetesClusterParamsWithTimeout(timeout time.Duration) *GetKubernetesClusterParams { - var () return &GetKubernetesClusterParams{ - timeout: timeout, } } // NewGetKubernetesClusterParamsWithContext creates a new GetKubernetesClusterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetKubernetesClusterParamsWithContext(ctx context.Context) *GetKubernetesClusterParams { - var () return &GetKubernetesClusterParams{ - Context: ctx, } } // NewGetKubernetesClusterParamsWithHTTPClient creates a new GetKubernetesClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetKubernetesClusterParamsWithHTTPClient(client *http.Client) *GetKubernetesClusterParams { - var () return &GetKubernetesClusterParams{ HTTPClient: client, } } -/*GetKubernetesClusterParams contains all the parameters to send to the API endpoint -for the get kubernetes cluster operation typically these are written to a http.Request +/* GetKubernetesClusterParams contains all the parameters to send to the API endpoint + for the get kubernetes cluster operation. + + Typically these are written to a http.Request. */ type GetKubernetesClusterParams struct { - /*Body*/ + // Body. Body GetKubernetesClusterBody timeout time.Duration @@ -68,6 +67,21 @@ type GetKubernetesClusterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get kubernetes cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetKubernetesClusterParams) WithDefaults() *GetKubernetesClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get kubernetes cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetKubernetesClusterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get kubernetes cluster params func (o *GetKubernetesClusterParams) WithTimeout(timeout time.Duration) *GetKubernetesClusterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *GetKubernetesClusterParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_responses.go b/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_responses.go index 42ebaf62e8..33f2dadf5f 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_responses.go +++ b/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_responses.go @@ -6,6 +6,7 @@ package kubernetes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetKubernetesClusterOK() *GetKubernetesClusterOK { return &GetKubernetesClusterOK{} } -/*GetKubernetesClusterOK handles this case with default header values. +/* GetKubernetesClusterOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetKubernetesClusterOK struct { func (o *GetKubernetesClusterOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/Get][%d] getKubernetesClusterOk %+v", 200, o.Payload) } - func (o *GetKubernetesClusterOK) GetPayload() *GetKubernetesClusterOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetKubernetesClusterDefault(code int) *GetKubernetesClusterDefault { } } -/*GetKubernetesClusterDefault handles this case with default header values. +/* GetKubernetesClusterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetKubernetesClusterDefault) Code() int { func (o *GetKubernetesClusterDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/Get][%d] GetKubernetesCluster default %+v", o._statusCode, o.Payload) } - func (o *GetKubernetesClusterDefault) GetPayload() *GetKubernetesClusterDefaultBody { return o.Payload } @@ -117,42 +116,6 @@ func (o *GetKubernetesClusterDefault) readResponse(response runtime.ClientRespon return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*GetKubernetesClusterBody get kubernetes cluster body swagger:model GetKubernetesClusterBody */ @@ -167,6 +130,11 @@ func (o *GetKubernetesClusterBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get kubernetes cluster body based on context it is used +func (o *GetKubernetesClusterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetKubernetesClusterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -200,7 +168,7 @@ type GetKubernetesClusterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetKubernetesClusterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get kubernetes cluster default body @@ -218,7 +186,6 @@ func (o *GetKubernetesClusterDefaultBody) Validate(formats strfmt.Registry) erro } func (o *GetKubernetesClusterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -232,6 +199,42 @@ func (o *GetKubernetesClusterDefaultBody) validateDetails(formats strfmt.Registr if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get kubernetes cluster default body based on the context it is used +func (o *GetKubernetesClusterDefaultBody) 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 *GetKubernetesClusterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -260,6 +263,47 @@ func (o *GetKubernetesClusterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetKubernetesClusterDefaultBodyDetailsItems0 get kubernetes cluster default body details items0 +swagger:model GetKubernetesClusterDefaultBodyDetailsItems0 +*/ +type GetKubernetesClusterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this get kubernetes cluster default body details items0 +func (o *GetKubernetesClusterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get kubernetes cluster default body details items0 based on context it is used +func (o *GetKubernetesClusterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetKubernetesClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetKubernetesClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res GetKubernetesClusterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*GetKubernetesClusterOKBody get kubernetes cluster OK body swagger:model GetKubernetesClusterOKBody */ @@ -284,7 +328,6 @@ func (o *GetKubernetesClusterOKBody) Validate(formats strfmt.Registry) error { } func (o *GetKubernetesClusterOKBody) validateKubeAuth(formats strfmt.Registry) error { - if swag.IsZero(o.KubeAuth) { // not required return nil } @@ -293,6 +336,38 @@ func (o *GetKubernetesClusterOKBody) validateKubeAuth(formats strfmt.Registry) e if err := o.KubeAuth.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getKubernetesClusterOk" + "." + "kube_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getKubernetesClusterOk" + "." + "kube_auth") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get kubernetes cluster OK body based on the context it is used +func (o *GetKubernetesClusterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateKubeAuth(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetKubernetesClusterOKBody) contextValidateKubeAuth(ctx context.Context, formats strfmt.Registry) error { + + if o.KubeAuth != nil { + if err := o.KubeAuth.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getKubernetesClusterOk" + "." + "kube_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getKubernetesClusterOk" + "." + "kube_auth") } return err } @@ -333,6 +408,11 @@ func (o *GetKubernetesClusterOKBodyKubeAuth) Validate(formats strfmt.Registry) e return nil } +// ContextValidate validates this get kubernetes cluster OK body kube auth based on context it is used +func (o *GetKubernetesClusterOKBodyKubeAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetKubernetesClusterOKBodyKubeAuth) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/client/kubernetes/get_resources_parameters.go b/api/managementpb/dbaas/json/client/kubernetes/get_resources_parameters.go index e6c119d60e..f32414aa2f 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/get_resources_parameters.go +++ b/api/managementpb/dbaas/json/client/kubernetes/get_resources_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetResourcesParams creates a new GetResourcesParams object -// with the default values initialized. +// NewGetResourcesParams creates a new GetResourcesParams 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 NewGetResourcesParams() *GetResourcesParams { - var () return &GetResourcesParams{ - timeout: cr.DefaultTimeout, } } // NewGetResourcesParamsWithTimeout creates a new GetResourcesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetResourcesParamsWithTimeout(timeout time.Duration) *GetResourcesParams { - var () return &GetResourcesParams{ - timeout: timeout, } } // NewGetResourcesParamsWithContext creates a new GetResourcesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetResourcesParamsWithContext(ctx context.Context) *GetResourcesParams { - var () return &GetResourcesParams{ - Context: ctx, } } // NewGetResourcesParamsWithHTTPClient creates a new GetResourcesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetResourcesParamsWithHTTPClient(client *http.Client) *GetResourcesParams { - var () return &GetResourcesParams{ HTTPClient: client, } } -/*GetResourcesParams contains all the parameters to send to the API endpoint -for the get resources operation typically these are written to a http.Request +/* GetResourcesParams contains all the parameters to send to the API endpoint + for the get resources operation. + + Typically these are written to a http.Request. */ type GetResourcesParams struct { - /*Body*/ + // Body. Body GetResourcesBody timeout time.Duration @@ -68,6 +67,21 @@ type GetResourcesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get resources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourcesParams) WithDefaults() *GetResourcesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get resources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourcesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get resources params func (o *GetResourcesParams) WithTimeout(timeout time.Duration) *GetResourcesParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *GetResourcesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/kubernetes/get_resources_responses.go b/api/managementpb/dbaas/json/client/kubernetes/get_resources_responses.go index d0cca200a9..d67ead111b 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/get_resources_responses.go +++ b/api/managementpb/dbaas/json/client/kubernetes/get_resources_responses.go @@ -6,6 +6,7 @@ package kubernetes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetResourcesOK() *GetResourcesOK { return &GetResourcesOK{} } -/*GetResourcesOK handles this case with default header values. +/* GetResourcesOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetResourcesOK struct { func (o *GetResourcesOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/Resources/Get][%d] getResourcesOk %+v", 200, o.Payload) } - func (o *GetResourcesOK) GetPayload() *GetResourcesOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetResourcesDefault(code int) *GetResourcesDefault { } } -/*GetResourcesDefault handles this case with default header values. +/* GetResourcesDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetResourcesDefault) Code() int { func (o *GetResourcesDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/Resources/Get][%d] GetResources default %+v", o._statusCode, o.Payload) } - func (o *GetResourcesDefault) GetPayload() *GetResourcesDefaultBody { return o.Payload } @@ -131,6 +130,11 @@ func (o *GetResourcesBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get resources body based on context it is used +func (o *GetResourcesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetResourcesBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -164,7 +168,7 @@ type GetResourcesDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetResourcesDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get resources default body @@ -182,7 +186,6 @@ func (o *GetResourcesDefaultBody) Validate(formats strfmt.Registry) error { } func (o *GetResourcesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -196,6 +199,42 @@ func (o *GetResourcesDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetResources default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetResources default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get resources default body based on the context it is used +func (o *GetResourcesDefaultBody) 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 *GetResourcesDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetResources default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetResources default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,6 +263,47 @@ func (o *GetResourcesDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetResourcesDefaultBodyDetailsItems0 get resources default body details items0 +swagger:model GetResourcesDefaultBodyDetailsItems0 +*/ +type GetResourcesDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this get resources default body details items0 +func (o *GetResourcesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get resources default body details items0 based on context it is used +func (o *GetResourcesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetResourcesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetResourcesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res GetResourcesDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*GetResourcesOKBody get resources OK body swagger:model GetResourcesOKBody */ @@ -255,7 +335,6 @@ func (o *GetResourcesOKBody) Validate(formats strfmt.Registry) error { } func (o *GetResourcesOKBody) validateAll(formats strfmt.Registry) error { - if swag.IsZero(o.All) { // not required return nil } @@ -264,6 +343,8 @@ func (o *GetResourcesOKBody) validateAll(formats strfmt.Registry) error { if err := o.All.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getResourcesOk" + "." + "all") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getResourcesOk" + "." + "all") } return err } @@ -273,7 +354,6 @@ func (o *GetResourcesOKBody) validateAll(formats strfmt.Registry) error { } func (o *GetResourcesOKBody) validateAvailable(formats strfmt.Registry) error { - if swag.IsZero(o.Available) { // not required return nil } @@ -282,6 +362,58 @@ func (o *GetResourcesOKBody) validateAvailable(formats strfmt.Registry) error { if err := o.Available.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getResourcesOk" + "." + "available") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getResourcesOk" + "." + "available") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get resources OK body based on the context it is used +func (o *GetResourcesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateAll(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateAvailable(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetResourcesOKBody) contextValidateAll(ctx context.Context, formats strfmt.Registry) error { + + if o.All != nil { + if err := o.All.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getResourcesOk" + "." + "all") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getResourcesOk" + "." + "all") + } + return err + } + } + + return nil +} + +func (o *GetResourcesOKBody) contextValidateAvailable(ctx context.Context, formats strfmt.Registry) error { + + if o.Available != nil { + if err := o.Available.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getResourcesOk" + "." + "available") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getResourcesOk" + "." + "available") } return err } @@ -329,6 +461,11 @@ func (o *GetResourcesOKBodyAll) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get resources OK body all based on context it is used +func (o *GetResourcesOKBodyAll) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetResourcesOKBodyAll) MarshalBinary() ([]byte, error) { if o == nil { @@ -368,6 +505,11 @@ func (o *GetResourcesOKBodyAvailable) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get resources OK body available based on context it is used +func (o *GetResourcesOKBodyAvailable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetResourcesOKBodyAvailable) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/client/kubernetes/kubernetes_client.go b/api/managementpb/dbaas/json/client/kubernetes/kubernetes_client.go index 7877545e45..c83058b5bf 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/kubernetes_client.go +++ b/api/managementpb/dbaas/json/client/kubernetes/kubernetes_client.go @@ -23,17 +23,20 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetKubernetesCluster(params *GetKubernetesClusterParams) (*GetKubernetesClusterOK, error) + GetKubernetesCluster(params *GetKubernetesClusterParams, opts ...ClientOption) (*GetKubernetesClusterOK, error) - GetResources(params *GetResourcesParams) (*GetResourcesOK, error) + GetResources(params *GetResourcesParams, opts ...ClientOption) (*GetResourcesOK, error) - ListKubernetesClusters(params *ListKubernetesClustersParams) (*ListKubernetesClustersOK, error) + ListKubernetesClusters(params *ListKubernetesClustersParams, opts ...ClientOption) (*ListKubernetesClustersOK, error) - RegisterKubernetesCluster(params *RegisterKubernetesClusterParams) (*RegisterKubernetesClusterOK, error) + RegisterKubernetesCluster(params *RegisterKubernetesClusterParams, opts ...ClientOption) (*RegisterKubernetesClusterOK, error) - UnregisterKubernetesCluster(params *UnregisterKubernetesClusterParams) (*UnregisterKubernetesClusterOK, error) + UnregisterKubernetesCluster(params *UnregisterKubernetesClusterParams, opts ...ClientOption) (*UnregisterKubernetesClusterOK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { /* GetKubernetesCluster gets kubernetes cluster return kube auth with kubernetes config */ -func (a *Client) GetKubernetesCluster(params *GetKubernetesClusterParams) (*GetKubernetesClusterOK, error) { +func (a *Client) GetKubernetesCluster(params *GetKubernetesClusterParams, opts ...ClientOption) (*GetKubernetesClusterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetKubernetesClusterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetKubernetesCluster", Method: "POST", PathPattern: "/v1/management/DBaaS/Kubernetes/Get", @@ -58,7 +60,12 @@ func (a *Client) GetKubernetesCluster(params *GetKubernetesClusterParams) (*GetK Reader: &GetKubernetesClusterReader{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 } @@ -74,13 +81,12 @@ func (a *Client) GetKubernetesCluster(params *GetKubernetesClusterParams) (*GetK /* GetResources gets resources returns all and available resources of a kubernetes cluster n o t e the user defined in kubeconfig for the cluster has to have rights to list and get pods from all namespaces also getting and listing nodes has to be allowed */ -func (a *Client) GetResources(params *GetResourcesParams) (*GetResourcesOK, error) { +func (a *Client) GetResources(params *GetResourcesParams, opts ...ClientOption) (*GetResourcesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetResourcesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetResources", Method: "POST", PathPattern: "/v1/management/DBaaS/Kubernetes/Resources/Get", @@ -91,7 +97,12 @@ func (a *Client) GetResources(params *GetResourcesParams) (*GetResourcesOK, erro Reader: &GetResourcesReader{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 } @@ -107,13 +118,12 @@ func (a *Client) GetResources(params *GetResourcesParams) (*GetResourcesOK, erro /* ListKubernetesClusters lists kubernetes clusters returns a list of all registered kubernetes clusters */ -func (a *Client) ListKubernetesClusters(params *ListKubernetesClustersParams) (*ListKubernetesClustersOK, error) { +func (a *Client) ListKubernetesClusters(params *ListKubernetesClustersParams, opts ...ClientOption) (*ListKubernetesClustersOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListKubernetesClustersParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListKubernetesClusters", Method: "POST", PathPattern: "/v1/management/DBaaS/Kubernetes/List", @@ -124,7 +134,12 @@ func (a *Client) ListKubernetesClusters(params *ListKubernetesClustersParams) (* Reader: &ListKubernetesClustersReader{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 } @@ -140,13 +155,12 @@ func (a *Client) ListKubernetesClusters(params *ListKubernetesClustersParams) (* /* RegisterKubernetesCluster registers kubernetes cluster registers an existing kubernetes cluster in PMM */ -func (a *Client) RegisterKubernetesCluster(params *RegisterKubernetesClusterParams) (*RegisterKubernetesClusterOK, error) { +func (a *Client) RegisterKubernetesCluster(params *RegisterKubernetesClusterParams, opts ...ClientOption) (*RegisterKubernetesClusterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRegisterKubernetesClusterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RegisterKubernetesCluster", Method: "POST", PathPattern: "/v1/management/DBaaS/Kubernetes/Register", @@ -157,7 +171,12 @@ func (a *Client) RegisterKubernetesCluster(params *RegisterKubernetesClusterPara Reader: &RegisterKubernetesClusterReader{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 } @@ -173,13 +192,12 @@ func (a *Client) RegisterKubernetesCluster(params *RegisterKubernetesClusterPara /* UnregisterKubernetesCluster unregisters kubernetes cluster removes a registered kubernetes cluster from PMM */ -func (a *Client) UnregisterKubernetesCluster(params *UnregisterKubernetesClusterParams) (*UnregisterKubernetesClusterOK, error) { +func (a *Client) UnregisterKubernetesCluster(params *UnregisterKubernetesClusterParams, opts ...ClientOption) (*UnregisterKubernetesClusterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUnregisterKubernetesClusterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "UnregisterKubernetesCluster", Method: "POST", PathPattern: "/v1/management/DBaaS/Kubernetes/Unregister", @@ -190,7 +208,12 @@ func (a *Client) UnregisterKubernetesCluster(params *UnregisterKubernetesCluster Reader: &UnregisterKubernetesClusterReader{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 } diff --git a/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_parameters.go b/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_parameters.go index c0013b57f3..d527de9ca7 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_parameters.go +++ b/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListKubernetesClustersParams creates a new ListKubernetesClustersParams object -// with the default values initialized. +// NewListKubernetesClustersParams creates a new ListKubernetesClustersParams 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 NewListKubernetesClustersParams() *ListKubernetesClustersParams { - var () return &ListKubernetesClustersParams{ - timeout: cr.DefaultTimeout, } } // NewListKubernetesClustersParamsWithTimeout creates a new ListKubernetesClustersParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListKubernetesClustersParamsWithTimeout(timeout time.Duration) *ListKubernetesClustersParams { - var () return &ListKubernetesClustersParams{ - timeout: timeout, } } // NewListKubernetesClustersParamsWithContext creates a new ListKubernetesClustersParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListKubernetesClustersParamsWithContext(ctx context.Context) *ListKubernetesClustersParams { - var () return &ListKubernetesClustersParams{ - Context: ctx, } } // NewListKubernetesClustersParamsWithHTTPClient creates a new ListKubernetesClustersParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListKubernetesClustersParamsWithHTTPClient(client *http.Client) *ListKubernetesClustersParams { - var () return &ListKubernetesClustersParams{ HTTPClient: client, } } -/*ListKubernetesClustersParams contains all the parameters to send to the API endpoint -for the list kubernetes clusters operation typically these are written to a http.Request +/* ListKubernetesClustersParams contains all the parameters to send to the API endpoint + for the list kubernetes clusters operation. + + Typically these are written to a http.Request. */ type ListKubernetesClustersParams struct { - /*Body*/ + // Body. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type ListKubernetesClustersParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list kubernetes clusters params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListKubernetesClustersParams) WithDefaults() *ListKubernetesClustersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list kubernetes clusters params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListKubernetesClustersParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list kubernetes clusters params func (o *ListKubernetesClustersParams) WithTimeout(timeout time.Duration) *ListKubernetesClustersParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ListKubernetesClustersParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_responses.go b/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_responses.go index 33c620e78f..ae5c244d53 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_responses.go +++ b/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_responses.go @@ -6,6 +6,7 @@ package kubernetes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListKubernetesClustersOK() *ListKubernetesClustersOK { return &ListKubernetesClustersOK{} } -/*ListKubernetesClustersOK handles this case with default header values. +/* ListKubernetesClustersOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListKubernetesClustersOK struct { func (o *ListKubernetesClustersOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/List][%d] listKubernetesClustersOk %+v", 200, o.Payload) } - func (o *ListKubernetesClustersOK) GetPayload() *ListKubernetesClustersOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListKubernetesClustersDefault(code int) *ListKubernetesClustersDefault { } } -/*ListKubernetesClustersDefault handles this case with default header values. +/* ListKubernetesClustersDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListKubernetesClustersDefault) Code() int { func (o *ListKubernetesClustersDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/List][%d] ListKubernetesClusters default %+v", o._statusCode, o.Payload) } - func (o *ListKubernetesClustersDefault) GetPayload() *ListKubernetesClustersDefaultBody { return o.Payload } @@ -119,15 +118,270 @@ func (o *ListKubernetesClustersDefault) readResponse(response runtime.ClientResp return nil } -/*KubernetesClustersItems0 Cluster contains public info about Kubernetes cluster. +/*ListKubernetesClustersDefaultBody list kubernetes clusters default body +swagger:model ListKubernetesClustersDefaultBody +*/ +type ListKubernetesClustersDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*ListKubernetesClustersDefaultBodyDetailsItems0 `json:"details"` +} + +// Validate validates this list kubernetes clusters default body +func (o *ListKubernetesClustersDefaultBody) 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 *ListKubernetesClustersDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListKubernetesClusters default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListKubernetesClusters default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list kubernetes clusters default body based on the context it is used +func (o *ListKubernetesClustersDefaultBody) 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 *ListKubernetesClustersDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListKubernetesClusters default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListKubernetesClusters default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ListKubernetesClustersDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListKubernetesClustersDefaultBody) UnmarshalBinary(b []byte) error { + var res ListKubernetesClustersDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListKubernetesClustersDefaultBodyDetailsItems0 list kubernetes clusters default body details items0 +swagger:model ListKubernetesClustersDefaultBodyDetailsItems0 +*/ +type ListKubernetesClustersDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this list kubernetes clusters default body details items0 +func (o *ListKubernetesClustersDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list kubernetes clusters default body details items0 based on context it is used +func (o *ListKubernetesClustersDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListKubernetesClustersDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListKubernetesClustersDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ListKubernetesClustersDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListKubernetesClustersOKBody list kubernetes clusters OK body +swagger:model ListKubernetesClustersOKBody +*/ +type ListKubernetesClustersOKBody struct { + + // Kubernetes clusters. + KubernetesClusters []*ListKubernetesClustersOKBodyKubernetesClustersItems0 `json:"kubernetes_clusters"` +} + +// Validate validates this list kubernetes clusters OK body +func (o *ListKubernetesClustersOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateKubernetesClusters(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListKubernetesClustersOKBody) validateKubernetesClusters(formats strfmt.Registry) error { + if swag.IsZero(o.KubernetesClusters) { // not required + return nil + } + + for i := 0; i < len(o.KubernetesClusters); i++ { + if swag.IsZero(o.KubernetesClusters[i]) { // not required + continue + } + + if o.KubernetesClusters[i] != nil { + if err := o.KubernetesClusters[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listKubernetesClustersOk" + "." + "kubernetes_clusters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listKubernetesClustersOk" + "." + "kubernetes_clusters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list kubernetes clusters OK body based on the context it is used +func (o *ListKubernetesClustersOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateKubernetesClusters(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListKubernetesClustersOKBody) contextValidateKubernetesClusters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.KubernetesClusters); i++ { + + if o.KubernetesClusters[i] != nil { + if err := o.KubernetesClusters[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listKubernetesClustersOk" + "." + "kubernetes_clusters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listKubernetesClustersOk" + "." + "kubernetes_clusters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ListKubernetesClustersOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListKubernetesClustersOKBody) UnmarshalBinary(b []byte) error { + var res ListKubernetesClustersOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListKubernetesClustersOKBodyKubernetesClustersItems0 Cluster contains public info about Kubernetes cluster. // TODO Do not use inner messages in all public APIs (for consistency). -swagger:model KubernetesClustersItems0 +swagger:model ListKubernetesClustersOKBodyKubernetesClustersItems0 */ -type KubernetesClustersItems0 struct { +type ListKubernetesClustersOKBodyKubernetesClustersItems0 struct { // Kubernetes cluster name. KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` + // operators + Operators *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators `json:"operators,omitempty"` + // KubernetesClusterStatus defines status of Kubernetes cluster. // // - KUBERNETES_CLUSTER_STATUS_INVALID: KUBERNETES_CLUSTER_STATUS_INVALID represents unknown state. @@ -135,20 +389,17 @@ type KubernetesClustersItems0 struct { // - KUBERNETES_CLUSTER_STATUS_UNAVAILABLE: KUBERNETES_CLUSTER_STATUS_UNAVAILABLE represents that Kubernetes cluster is not accessible. // Enum: [KUBERNETES_CLUSTER_STATUS_INVALID KUBERNETES_CLUSTER_STATUS_OK KUBERNETES_CLUSTER_STATUS_UNAVAILABLE] Status *string `json:"status,omitempty"` - - // operators - Operators *KubernetesClustersItems0Operators `json:"operators,omitempty"` } -// Validate validates this kubernetes clusters items0 -func (o *KubernetesClustersItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list kubernetes clusters OK body kubernetes clusters items0 +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateStatus(formats); err != nil { + if err := o.validateOperators(formats); err != nil { res = append(res, err) } - if err := o.validateOperators(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -158,7 +409,26 @@ func (o *KubernetesClustersItems0) Validate(formats strfmt.Registry) error { return nil } -var kubernetesClustersItems0TypeStatusPropEnum []interface{} +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0) validateOperators(formats strfmt.Registry) error { + if swag.IsZero(o.Operators) { // not required + return nil + } + + if o.Operators != nil { + if err := o.Operators.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operators") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operators") + } + return err + } + } + + return nil +} + +var listKubernetesClustersOkBodyKubernetesClustersItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -166,32 +436,31 @@ func init() { panic(err) } for _, v := range res { - kubernetesClustersItems0TypeStatusPropEnum = append(kubernetesClustersItems0TypeStatusPropEnum, v) + listKubernetesClustersOkBodyKubernetesClustersItems0TypeStatusPropEnum = append(listKubernetesClustersOkBodyKubernetesClustersItems0TypeStatusPropEnum, v) } } const ( - // KubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSINVALID captures enum value "KUBERNETES_CLUSTER_STATUS_INVALID" - KubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSINVALID string = "KUBERNETES_CLUSTER_STATUS_INVALID" + // ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSINVALID captures enum value "KUBERNETES_CLUSTER_STATUS_INVALID" + ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSINVALID string = "KUBERNETES_CLUSTER_STATUS_INVALID" - // KubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSOK captures enum value "KUBERNETES_CLUSTER_STATUS_OK" - KubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSOK string = "KUBERNETES_CLUSTER_STATUS_OK" + // ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSOK captures enum value "KUBERNETES_CLUSTER_STATUS_OK" + ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSOK string = "KUBERNETES_CLUSTER_STATUS_OK" - // KubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSUNAVAILABLE captures enum value "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" - KubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSUNAVAILABLE string = "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" + // ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSUNAVAILABLE captures enum value "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" + ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSUNAVAILABLE string = "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" ) // prop value enum -func (o *KubernetesClustersItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, kubernetesClustersItems0TypeStatusPropEnum, true); err != nil { +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listKubernetesClustersOkBodyKubernetesClustersItems0TypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *KubernetesClustersItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -204,16 +473,28 @@ func (o *KubernetesClustersItems0) validateStatus(formats strfmt.Registry) error return nil } -func (o *KubernetesClustersItems0) validateOperators(formats strfmt.Registry) error { +// ContextValidate validate this list kubernetes clusters OK body kubernetes clusters items0 based on the context it is used +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.Operators) { // not required - return nil + if err := o.contextValidateOperators(ctx, formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0) contextValidateOperators(ctx context.Context, formats strfmt.Registry) error { + if o.Operators != nil { - if err := o.Operators.Validate(formats); err != nil { + if err := o.Operators.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("operators") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operators") } return err } @@ -223,7 +504,7 @@ func (o *KubernetesClustersItems0) validateOperators(formats strfmt.Registry) er } // MarshalBinary interface implementation -func (o *KubernetesClustersItems0) MarshalBinary() ([]byte, error) { +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -231,8 +512,8 @@ func (o *KubernetesClustersItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *KubernetesClustersItems0) UnmarshalBinary(b []byte) error { - var res KubernetesClustersItems0 +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0) UnmarshalBinary(b []byte) error { + var res ListKubernetesClustersOKBodyKubernetesClustersItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -240,20 +521,20 @@ func (o *KubernetesClustersItems0) UnmarshalBinary(b []byte) error { return nil } -/*KubernetesClustersItems0Operators Operators contains list of operators installed in Kubernetes cluster. -swagger:model KubernetesClustersItems0Operators +/*ListKubernetesClustersOKBodyKubernetesClustersItems0Operators Operators contains list of operators installed in Kubernetes cluster. +swagger:model ListKubernetesClustersOKBodyKubernetesClustersItems0Operators */ -type KubernetesClustersItems0Operators struct { +type ListKubernetesClustersOKBodyKubernetesClustersItems0Operators struct { // psmdb - PSMDB *KubernetesClustersItems0OperatorsPSMDB `json:"psmdb,omitempty"` + PSMDB *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB `json:"psmdb,omitempty"` // pxc - PXC *KubernetesClustersItems0OperatorsPXC `json:"pxc,omitempty"` + PXC *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC `json:"pxc,omitempty"` } -// Validate validates this kubernetes clusters items0 operators -func (o *KubernetesClustersItems0Operators) Validate(formats strfmt.Registry) error { +// Validate validates this list kubernetes clusters OK body kubernetes clusters items0 operators +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) Validate(formats strfmt.Registry) error { var res []error if err := o.validatePSMDB(formats); err != nil { @@ -270,8 +551,7 @@ func (o *KubernetesClustersItems0Operators) Validate(formats strfmt.Registry) er return nil } -func (o *KubernetesClustersItems0Operators) validatePSMDB(formats strfmt.Registry) error { - +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) validatePSMDB(formats strfmt.Registry) error { if swag.IsZero(o.PSMDB) { // not required return nil } @@ -280,6 +560,8 @@ func (o *KubernetesClustersItems0Operators) validatePSMDB(formats strfmt.Registr if err := o.PSMDB.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("operators" + "." + "psmdb") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operators" + "." + "psmdb") } return err } @@ -288,8 +570,7 @@ func (o *KubernetesClustersItems0Operators) validatePSMDB(formats strfmt.Registr return nil } -func (o *KubernetesClustersItems0Operators) validatePXC(formats strfmt.Registry) error { - +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) validatePXC(formats strfmt.Registry) error { if swag.IsZero(o.PXC) { // not required return nil } @@ -298,6 +579,58 @@ func (o *KubernetesClustersItems0Operators) validatePXC(formats strfmt.Registry) if err := o.PXC.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("operators" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operators" + "." + "pxc") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list kubernetes clusters OK body kubernetes clusters items0 operators based on the context it is used +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePSMDB(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePXC(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) contextValidatePSMDB(ctx context.Context, formats strfmt.Registry) error { + + if o.PSMDB != nil { + if err := o.PSMDB.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operators" + "." + "psmdb") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operators" + "." + "psmdb") + } + return err + } + } + + return nil +} + +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) contextValidatePXC(ctx context.Context, formats strfmt.Registry) error { + + if o.PXC != nil { + if err := o.PXC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operators" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operators" + "." + "pxc") } return err } @@ -307,7 +640,7 @@ func (o *KubernetesClustersItems0Operators) validatePXC(formats strfmt.Registry) } // MarshalBinary interface implementation -func (o *KubernetesClustersItems0Operators) MarshalBinary() ([]byte, error) { +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -315,8 +648,8 @@ func (o *KubernetesClustersItems0Operators) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *KubernetesClustersItems0Operators) UnmarshalBinary(b []byte) error { - var res KubernetesClustersItems0Operators +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) UnmarshalBinary(b []byte) error { + var res ListKubernetesClustersOKBodyKubernetesClustersItems0Operators if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -324,10 +657,13 @@ func (o *KubernetesClustersItems0Operators) UnmarshalBinary(b []byte) error { return nil } -/*KubernetesClustersItems0OperatorsPSMDB Operator contains all information about operator installed in Kubernetes cluster. -swagger:model KubernetesClustersItems0OperatorsPSMDB +/*ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB Operator contains all information about operator installed in Kubernetes cluster. +swagger:model ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB */ -type KubernetesClustersItems0OperatorsPSMDB struct { +type ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB struct { + + // version + Version string `json:"version,omitempty"` // OperatorsStatus defines status of operators installed in Kubernetes cluster. // @@ -337,13 +673,10 @@ type KubernetesClustersItems0OperatorsPSMDB struct { // - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed. // Enum: [OPERATORS_STATUS_INVALID OPERATORS_STATUS_OK OPERATORS_STATUS_UNSUPPORTED OPERATORS_STATUS_NOT_INSTALLED] Status *string `json:"status,omitempty"` - - // version - Version string `json:"version,omitempty"` } -// Validate validates this kubernetes clusters items0 operators PSMDB -func (o *KubernetesClustersItems0OperatorsPSMDB) Validate(formats strfmt.Registry) error { +// Validate validates this list kubernetes clusters OK body kubernetes clusters items0 operators PSMDB +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB) Validate(formats strfmt.Registry) error { var res []error if err := o.validateStatus(formats); err != nil { @@ -356,7 +689,7 @@ func (o *KubernetesClustersItems0OperatorsPSMDB) Validate(formats strfmt.Registr return nil } -var kubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum []interface{} +var listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum []interface{} func init() { var res []string @@ -364,35 +697,34 @@ func init() { panic(err) } for _, v := range res { - kubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum = append(kubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum, v) + listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum = append(listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum, v) } } const ( - // KubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSINVALID captures enum value "OPERATORS_STATUS_INVALID" - KubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSINVALID string = "OPERATORS_STATUS_INVALID" + // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSINVALID captures enum value "OPERATORS_STATUS_INVALID" + ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSINVALID string = "OPERATORS_STATUS_INVALID" - // KubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSOK captures enum value "OPERATORS_STATUS_OK" - KubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSOK string = "OPERATORS_STATUS_OK" + // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSOK captures enum value "OPERATORS_STATUS_OK" + ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSOK string = "OPERATORS_STATUS_OK" - // KubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSUNSUPPORTED captures enum value "OPERATORS_STATUS_UNSUPPORTED" - KubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSUNSUPPORTED string = "OPERATORS_STATUS_UNSUPPORTED" + // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSUNSUPPORTED captures enum value "OPERATORS_STATUS_UNSUPPORTED" + ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSUNSUPPORTED string = "OPERATORS_STATUS_UNSUPPORTED" - // KubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSNOTINSTALLED captures enum value "OPERATORS_STATUS_NOT_INSTALLED" - KubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSNOTINSTALLED string = "OPERATORS_STATUS_NOT_INSTALLED" + // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSNOTINSTALLED captures enum value "OPERATORS_STATUS_NOT_INSTALLED" + ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSNOTINSTALLED string = "OPERATORS_STATUS_NOT_INSTALLED" ) // prop value enum -func (o *KubernetesClustersItems0OperatorsPSMDB) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, kubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum, true); err != nil { +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *KubernetesClustersItems0OperatorsPSMDB) validateStatus(formats strfmt.Registry) error { - +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -405,8 +737,13 @@ func (o *KubernetesClustersItems0OperatorsPSMDB) validateStatus(formats strfmt.R return nil } +// ContextValidate validates this list kubernetes clusters OK body kubernetes clusters items0 operators PSMDB based on context it is used +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *KubernetesClustersItems0OperatorsPSMDB) MarshalBinary() ([]byte, error) { +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -414,8 +751,8 @@ func (o *KubernetesClustersItems0OperatorsPSMDB) MarshalBinary() ([]byte, error) } // UnmarshalBinary interface implementation -func (o *KubernetesClustersItems0OperatorsPSMDB) UnmarshalBinary(b []byte) error { - var res KubernetesClustersItems0OperatorsPSMDB +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB) UnmarshalBinary(b []byte) error { + var res ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -423,10 +760,13 @@ func (o *KubernetesClustersItems0OperatorsPSMDB) UnmarshalBinary(b []byte) error return nil } -/*KubernetesClustersItems0OperatorsPXC Operator contains all information about operator installed in Kubernetes cluster. -swagger:model KubernetesClustersItems0OperatorsPXC +/*ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC Operator contains all information about operator installed in Kubernetes cluster. +swagger:model ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC */ -type KubernetesClustersItems0OperatorsPXC struct { +type ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC struct { + + // version + Version string `json:"version,omitempty"` // OperatorsStatus defines status of operators installed in Kubernetes cluster. // @@ -436,13 +776,10 @@ type KubernetesClustersItems0OperatorsPXC struct { // - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed. // Enum: [OPERATORS_STATUS_INVALID OPERATORS_STATUS_OK OPERATORS_STATUS_UNSUPPORTED OPERATORS_STATUS_NOT_INSTALLED] Status *string `json:"status,omitempty"` - - // version - Version string `json:"version,omitempty"` } -// Validate validates this kubernetes clusters items0 operators PXC -func (o *KubernetesClustersItems0OperatorsPXC) Validate(formats strfmt.Registry) error { +// Validate validates this list kubernetes clusters OK body kubernetes clusters items0 operators PXC +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC) Validate(formats strfmt.Registry) error { var res []error if err := o.validateStatus(formats); err != nil { @@ -455,7 +792,7 @@ func (o *KubernetesClustersItems0OperatorsPXC) Validate(formats strfmt.Registry) return nil } -var kubernetesClustersItems0OperatorsPxcTypeStatusPropEnum []interface{} +var listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPxcTypeStatusPropEnum []interface{} func init() { var res []string @@ -463,35 +800,34 @@ func init() { panic(err) } for _, v := range res { - kubernetesClustersItems0OperatorsPxcTypeStatusPropEnum = append(kubernetesClustersItems0OperatorsPxcTypeStatusPropEnum, v) + listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPxcTypeStatusPropEnum = append(listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPxcTypeStatusPropEnum, v) } } const ( - // KubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSINVALID captures enum value "OPERATORS_STATUS_INVALID" - KubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSINVALID string = "OPERATORS_STATUS_INVALID" + // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSINVALID captures enum value "OPERATORS_STATUS_INVALID" + ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSINVALID string = "OPERATORS_STATUS_INVALID" - // KubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSOK captures enum value "OPERATORS_STATUS_OK" - KubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSOK string = "OPERATORS_STATUS_OK" + // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSOK captures enum value "OPERATORS_STATUS_OK" + ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSOK string = "OPERATORS_STATUS_OK" - // KubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSUNSUPPORTED captures enum value "OPERATORS_STATUS_UNSUPPORTED" - KubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSUNSUPPORTED string = "OPERATORS_STATUS_UNSUPPORTED" + // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSUNSUPPORTED captures enum value "OPERATORS_STATUS_UNSUPPORTED" + ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSUNSUPPORTED string = "OPERATORS_STATUS_UNSUPPORTED" - // KubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSNOTINSTALLED captures enum value "OPERATORS_STATUS_NOT_INSTALLED" - KubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSNOTINSTALLED string = "OPERATORS_STATUS_NOT_INSTALLED" + // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSNOTINSTALLED captures enum value "OPERATORS_STATUS_NOT_INSTALLED" + ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSNOTINSTALLED string = "OPERATORS_STATUS_NOT_INSTALLED" ) // prop value enum -func (o *KubernetesClustersItems0OperatorsPXC) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, kubernetesClustersItems0OperatorsPxcTypeStatusPropEnum, true); err != nil { +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPxcTypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *KubernetesClustersItems0OperatorsPXC) validateStatus(formats strfmt.Registry) error { - +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -504,149 +840,13 @@ func (o *KubernetesClustersItems0OperatorsPXC) validateStatus(formats strfmt.Reg return nil } -// MarshalBinary interface implementation -func (o *KubernetesClustersItems0OperatorsPXC) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *KubernetesClustersItems0OperatorsPXC) UnmarshalBinary(b []byte) error { - var res KubernetesClustersItems0OperatorsPXC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*ListKubernetesClustersDefaultBody list kubernetes clusters default body -swagger:model ListKubernetesClustersDefaultBody -*/ -type ListKubernetesClustersDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `json:"details"` -} - -// Validate validates this list kubernetes clusters default body -func (o *ListKubernetesClustersDefaultBody) 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 *ListKubernetesClustersDefaultBody) validateDetails(formats strfmt.Registry) error { - - if swag.IsZero(o.Details) { // not required - return nil - } - - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ListKubernetesClusters default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListKubernetesClustersDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListKubernetesClustersDefaultBody) UnmarshalBinary(b []byte) error { - var res ListKubernetesClustersDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*ListKubernetesClustersOKBody list kubernetes clusters OK body -swagger:model ListKubernetesClustersOKBody -*/ -type ListKubernetesClustersOKBody struct { - - // Kubernetes clusters. - KubernetesClusters []*KubernetesClustersItems0 `json:"kubernetes_clusters"` -} - -// Validate validates this list kubernetes clusters OK body -func (o *ListKubernetesClustersOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateKubernetesClusters(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListKubernetesClustersOKBody) validateKubernetesClusters(formats strfmt.Registry) error { - - if swag.IsZero(o.KubernetesClusters) { // not required - return nil - } - - for i := 0; i < len(o.KubernetesClusters); i++ { - if swag.IsZero(o.KubernetesClusters[i]) { // not required - continue - } - - if o.KubernetesClusters[i] != nil { - if err := o.KubernetesClusters[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listKubernetesClustersOk" + "." + "kubernetes_clusters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - +// ContextValidate validates this list kubernetes clusters OK body kubernetes clusters items0 operators PXC based on context it is used +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ListKubernetesClustersOKBody) MarshalBinary() ([]byte, error) { +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -654,8 +854,8 @@ func (o *ListKubernetesClustersOKBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListKubernetesClustersOKBody) UnmarshalBinary(b []byte) error { - var res ListKubernetesClustersOKBody +func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC) UnmarshalBinary(b []byte) error { + var res ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_parameters.go b/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_parameters.go index bdf3794577..480747cdc2 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_parameters.go +++ b/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRegisterKubernetesClusterParams creates a new RegisterKubernetesClusterParams object -// with the default values initialized. +// NewRegisterKubernetesClusterParams creates a new RegisterKubernetesClusterParams 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 NewRegisterKubernetesClusterParams() *RegisterKubernetesClusterParams { - var () return &RegisterKubernetesClusterParams{ - timeout: cr.DefaultTimeout, } } // NewRegisterKubernetesClusterParamsWithTimeout creates a new RegisterKubernetesClusterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRegisterKubernetesClusterParamsWithTimeout(timeout time.Duration) *RegisterKubernetesClusterParams { - var () return &RegisterKubernetesClusterParams{ - timeout: timeout, } } // NewRegisterKubernetesClusterParamsWithContext creates a new RegisterKubernetesClusterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRegisterKubernetesClusterParamsWithContext(ctx context.Context) *RegisterKubernetesClusterParams { - var () return &RegisterKubernetesClusterParams{ - Context: ctx, } } // NewRegisterKubernetesClusterParamsWithHTTPClient creates a new RegisterKubernetesClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRegisterKubernetesClusterParamsWithHTTPClient(client *http.Client) *RegisterKubernetesClusterParams { - var () return &RegisterKubernetesClusterParams{ HTTPClient: client, } } -/*RegisterKubernetesClusterParams contains all the parameters to send to the API endpoint -for the register kubernetes cluster operation typically these are written to a http.Request +/* RegisterKubernetesClusterParams contains all the parameters to send to the API endpoint + for the register kubernetes cluster operation. + + Typically these are written to a http.Request. */ type RegisterKubernetesClusterParams struct { - /*Body*/ + // Body. Body RegisterKubernetesClusterBody timeout time.Duration @@ -68,6 +67,21 @@ type RegisterKubernetesClusterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the register kubernetes cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RegisterKubernetesClusterParams) WithDefaults() *RegisterKubernetesClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the register kubernetes cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RegisterKubernetesClusterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the register kubernetes cluster params func (o *RegisterKubernetesClusterParams) WithTimeout(timeout time.Duration) *RegisterKubernetesClusterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *RegisterKubernetesClusterParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_responses.go b/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_responses.go index f52fd50da0..ae15c6577a 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_responses.go +++ b/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_responses.go @@ -6,6 +6,7 @@ package kubernetes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewRegisterKubernetesClusterOK() *RegisterKubernetesClusterOK { return &RegisterKubernetesClusterOK{} } -/*RegisterKubernetesClusterOK handles this case with default header values. +/* RegisterKubernetesClusterOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type RegisterKubernetesClusterOK struct { func (o *RegisterKubernetesClusterOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/Register][%d] registerKubernetesClusterOk %+v", 200, o.Payload) } - func (o *RegisterKubernetesClusterOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewRegisterKubernetesClusterDefault(code int) *RegisterKubernetesClusterDef } } -/*RegisterKubernetesClusterDefault handles this case with default header values. +/* RegisterKubernetesClusterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *RegisterKubernetesClusterDefault) Code() int { func (o *RegisterKubernetesClusterDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/Register][%d] RegisterKubernetesCluster default %+v", o._statusCode, o.Payload) } - func (o *RegisterKubernetesClusterDefault) GetPayload() *RegisterKubernetesClusterDefaultBody { return o.Payload } @@ -148,7 +147,6 @@ func (o *RegisterKubernetesClusterBody) Validate(formats strfmt.Registry) error } func (o *RegisterKubernetesClusterBody) validateKubeAuth(formats strfmt.Registry) error { - if swag.IsZero(o.KubeAuth) { // not required return nil } @@ -157,6 +155,38 @@ func (o *RegisterKubernetesClusterBody) validateKubeAuth(formats strfmt.Registry if err := o.KubeAuth.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "kube_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "kube_auth") + } + return err + } + } + + return nil +} + +// ContextValidate validate this register kubernetes cluster body based on the context it is used +func (o *RegisterKubernetesClusterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateKubeAuth(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *RegisterKubernetesClusterBody) contextValidateKubeAuth(ctx context.Context, formats strfmt.Registry) error { + + if o.KubeAuth != nil { + if err := o.KubeAuth.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "kube_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "kube_auth") } return err } @@ -198,7 +228,7 @@ type RegisterKubernetesClusterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RegisterKubernetesClusterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this register kubernetes cluster default body @@ -216,7 +246,6 @@ func (o *RegisterKubernetesClusterDefaultBody) Validate(formats strfmt.Registry) } func (o *RegisterKubernetesClusterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -230,6 +259,42 @@ func (o *RegisterKubernetesClusterDefaultBody) validateDetails(formats strfmt.Re if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RegisterKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RegisterKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this register kubernetes cluster default body based on the context it is used +func (o *RegisterKubernetesClusterDefaultBody) 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 *RegisterKubernetesClusterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RegisterKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RegisterKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -258,6 +323,47 @@ func (o *RegisterKubernetesClusterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*RegisterKubernetesClusterDefaultBodyDetailsItems0 register kubernetes cluster default body details items0 +swagger:model RegisterKubernetesClusterDefaultBodyDetailsItems0 +*/ +type RegisterKubernetesClusterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this register kubernetes cluster default body details items0 +func (o *RegisterKubernetesClusterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this register kubernetes cluster default body details items0 based on context it is used +func (o *RegisterKubernetesClusterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *RegisterKubernetesClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RegisterKubernetesClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res RegisterKubernetesClusterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*RegisterKubernetesClusterParamsBodyKubeAuth KubeAuth represents Kubernetes / kubectl authentication and authorization information. swagger:model RegisterKubernetesClusterParamsBodyKubeAuth */ @@ -272,6 +378,11 @@ func (o *RegisterKubernetesClusterParamsBodyKubeAuth) Validate(formats strfmt.Re return nil } +// ContextValidate validates this register kubernetes cluster params body kube auth based on context it is used +func (o *RegisterKubernetesClusterParamsBodyKubeAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *RegisterKubernetesClusterParamsBodyKubeAuth) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_parameters.go b/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_parameters.go index 703048bc92..9ee55eea15 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_parameters.go +++ b/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUnregisterKubernetesClusterParams creates a new UnregisterKubernetesClusterParams object -// with the default values initialized. +// NewUnregisterKubernetesClusterParams creates a new UnregisterKubernetesClusterParams 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 NewUnregisterKubernetesClusterParams() *UnregisterKubernetesClusterParams { - var () return &UnregisterKubernetesClusterParams{ - timeout: cr.DefaultTimeout, } } // NewUnregisterKubernetesClusterParamsWithTimeout creates a new UnregisterKubernetesClusterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUnregisterKubernetesClusterParamsWithTimeout(timeout time.Duration) *UnregisterKubernetesClusterParams { - var () return &UnregisterKubernetesClusterParams{ - timeout: timeout, } } // NewUnregisterKubernetesClusterParamsWithContext creates a new UnregisterKubernetesClusterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUnregisterKubernetesClusterParamsWithContext(ctx context.Context) *UnregisterKubernetesClusterParams { - var () return &UnregisterKubernetesClusterParams{ - Context: ctx, } } // NewUnregisterKubernetesClusterParamsWithHTTPClient creates a new UnregisterKubernetesClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUnregisterKubernetesClusterParamsWithHTTPClient(client *http.Client) *UnregisterKubernetesClusterParams { - var () return &UnregisterKubernetesClusterParams{ HTTPClient: client, } } -/*UnregisterKubernetesClusterParams contains all the parameters to send to the API endpoint -for the unregister kubernetes cluster operation typically these are written to a http.Request +/* UnregisterKubernetesClusterParams contains all the parameters to send to the API endpoint + for the unregister kubernetes cluster operation. + + Typically these are written to a http.Request. */ type UnregisterKubernetesClusterParams struct { - /*Body*/ + // Body. Body UnregisterKubernetesClusterBody timeout time.Duration @@ -68,6 +67,21 @@ type UnregisterKubernetesClusterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the unregister kubernetes cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UnregisterKubernetesClusterParams) WithDefaults() *UnregisterKubernetesClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the unregister kubernetes cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UnregisterKubernetesClusterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the unregister kubernetes cluster params func (o *UnregisterKubernetesClusterParams) WithTimeout(timeout time.Duration) *UnregisterKubernetesClusterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *UnregisterKubernetesClusterParams) WriteToRequest(r runtime.ClientReque return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_responses.go b/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_responses.go index a122017c60..396fc19960 100644 --- a/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_responses.go +++ b/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_responses.go @@ -6,6 +6,7 @@ package kubernetes // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewUnregisterKubernetesClusterOK() *UnregisterKubernetesClusterOK { return &UnregisterKubernetesClusterOK{} } -/*UnregisterKubernetesClusterOK handles this case with default header values. +/* UnregisterKubernetesClusterOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type UnregisterKubernetesClusterOK struct { func (o *UnregisterKubernetesClusterOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/Unregister][%d] unregisterKubernetesClusterOk %+v", 200, o.Payload) } - func (o *UnregisterKubernetesClusterOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewUnregisterKubernetesClusterDefault(code int) *UnregisterKubernetesCluste } } -/*UnregisterKubernetesClusterDefault handles this case with default header values. +/* UnregisterKubernetesClusterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *UnregisterKubernetesClusterDefault) Code() int { func (o *UnregisterKubernetesClusterDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/Unregister][%d] UnregisterKubernetesCluster default %+v", o._statusCode, o.Payload) } - func (o *UnregisterKubernetesClusterDefault) GetPayload() *UnregisterKubernetesClusterDefaultBody { return o.Payload } @@ -133,6 +132,11 @@ func (o *UnregisterKubernetesClusterBody) Validate(formats strfmt.Registry) erro return nil } +// ContextValidate validates this unregister kubernetes cluster body based on context it is used +func (o *UnregisterKubernetesClusterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *UnregisterKubernetesClusterBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -166,7 +170,7 @@ type UnregisterKubernetesClusterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*UnregisterKubernetesClusterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this unregister kubernetes cluster default body @@ -184,7 +188,6 @@ func (o *UnregisterKubernetesClusterDefaultBody) Validate(formats strfmt.Registr } func (o *UnregisterKubernetesClusterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -198,6 +201,42 @@ func (o *UnregisterKubernetesClusterDefaultBody) validateDetails(formats strfmt. if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("UnregisterKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UnregisterKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this unregister kubernetes cluster default body based on the context it is used +func (o *UnregisterKubernetesClusterDefaultBody) 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 *UnregisterKubernetesClusterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UnregisterKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UnregisterKubernetesCluster default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -225,3 +264,44 @@ func (o *UnregisterKubernetesClusterDefaultBody) UnmarshalBinary(b []byte) error *o = res return nil } + +/*UnregisterKubernetesClusterDefaultBodyDetailsItems0 unregister kubernetes cluster default body details items0 +swagger:model UnregisterKubernetesClusterDefaultBodyDetailsItems0 +*/ +type UnregisterKubernetesClusterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this unregister kubernetes cluster default body details items0 +func (o *UnregisterKubernetesClusterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this unregister kubernetes cluster default body details items0 based on context it is used +func (o *UnregisterKubernetesClusterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UnregisterKubernetesClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UnregisterKubernetesClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res UnregisterKubernetesClusterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/dbaas/json/client/logs_api/get_logs_parameters.go b/api/managementpb/dbaas/json/client/logs_api/get_logs_parameters.go index 8773b23461..05a22007e9 100644 --- a/api/managementpb/dbaas/json/client/logs_api/get_logs_parameters.go +++ b/api/managementpb/dbaas/json/client/logs_api/get_logs_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLogsParams creates a new GetLogsParams object -// with the default values initialized. +// 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 { - var () return &GetLogsParams{ - timeout: cr.DefaultTimeout, } } // NewGetLogsParamsWithTimeout creates a new GetLogsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetLogsParamsWithTimeout(timeout time.Duration) *GetLogsParams { - var () return &GetLogsParams{ - timeout: timeout, } } // NewGetLogsParamsWithContext creates a new GetLogsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetLogsParamsWithContext(ctx context.Context) *GetLogsParams { - var () return &GetLogsParams{ - Context: ctx, } } // NewGetLogsParamsWithHTTPClient creates a new GetLogsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetLogsParamsWithHTTPClient(client *http.Client) *GetLogsParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body GetLogsBody timeout time.Duration @@ -68,6 +67,21 @@ type GetLogsParams struct { 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) @@ -119,7 +133,6 @@ func (o *GetLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/logs_api/get_logs_responses.go b/api/managementpb/dbaas/json/client/logs_api/get_logs_responses.go index 46ca8a4528..857bb1e963 100644 --- a/api/managementpb/dbaas/json/client/logs_api/get_logs_responses.go +++ b/api/managementpb/dbaas/json/client/logs_api/get_logs_responses.go @@ -6,6 +6,7 @@ package logs_api // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetLogsOK() *GetLogsOK { return &GetLogsOK{} } -/*GetLogsOK handles this case with default header values. +/* GetLogsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetLogsOK struct { func (o *GetLogsOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/GetLogs][%d] getLogsOk %+v", 200, o.Payload) } - func (o *GetLogsOK) GetPayload() *GetLogsOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetLogsDefault(code int) *GetLogsDefault { } } -/*GetLogsDefault handles this case with default header values. +/* GetLogsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetLogsDefault) Code() int { func (o *GetLogsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/GetLogs][%d] GetLogs default %+v", o._statusCode, o.Payload) } - func (o *GetLogsDefault) GetPayload() *GetLogsDefaultBody { return o.Payload } @@ -117,42 +116,6 @@ func (o *GetLogsDefault) readResponse(response runtime.ClientResponse, consumer return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*GetLogsBody get logs body swagger:model GetLogsBody */ @@ -170,6 +133,11 @@ func (o *GetLogsBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get logs body based on context it is used +func (o *GetLogsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetLogsBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -203,7 +171,7 @@ type GetLogsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetLogsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get logs default body @@ -221,7 +189,6 @@ func (o *GetLogsDefaultBody) Validate(formats strfmt.Registry) error { } func (o *GetLogsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -235,6 +202,42 @@ func (o *GetLogsDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetLogs default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetLogs default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetLogs default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -263,6 +266,47 @@ func (o *GetLogsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetLogsDefaultBodyDetailsItems0 get logs default body details items0 +swagger:model GetLogsDefaultBodyDetailsItems0 +*/ +type GetLogsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -270,7 +314,7 @@ type GetLogsOKBody struct { // Log represents list of logs. Each entry contains either container's logs or, // when container field is empty, pod's events. - Logs []*LogsItems0 `json:"logs"` + Logs []*GetLogsOKBodyLogsItems0 `json:"logs"` } // Validate validates this get logs OK body @@ -288,7 +332,6 @@ func (o *GetLogsOKBody) Validate(formats strfmt.Registry) error { } func (o *GetLogsOKBody) validateLogs(formats strfmt.Registry) error { - if swag.IsZero(o.Logs) { // not required return nil } @@ -302,6 +345,42 @@ func (o *GetLogsOKBody) validateLogs(formats strfmt.Registry) error { if err := o.Logs[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Logs[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getLogsOk" + "." + "logs" + "." + strconv.Itoa(i)) } return err } @@ -330,11 +409,11 @@ func (o *GetLogsOKBody) UnmarshalBinary(b []byte) error { return nil } -/*LogsItems0 Logs contain logs for certain pod's container. If container is an empty +/*GetLogsOKBodyLogsItems0 Logs contain logs for certain pod's container. If container is an empty // string, logs contain pod's events. -swagger:model LogsItems0 +swagger:model GetLogsOKBodyLogsItems0 */ -type LogsItems0 struct { +type GetLogsOKBodyLogsItems0 struct { // Pod name. Pod string `json:"pod,omitempty"` @@ -346,13 +425,18 @@ type LogsItems0 struct { Logs []string `json:"logs"` } -// Validate validates this logs items0 -func (o *LogsItems0) Validate(formats strfmt.Registry) error { +// 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 *LogsItems0) MarshalBinary() ([]byte, error) { +func (o *GetLogsOKBodyLogsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -360,8 +444,8 @@ func (o *LogsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *LogsItems0) UnmarshalBinary(b []byte) error { - var res LogsItems0 +func (o *GetLogsOKBodyLogsItems0) UnmarshalBinary(b []byte) error { + var res GetLogsOKBodyLogsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/logs_api/logs_api_client.go b/api/managementpb/dbaas/json/client/logs_api/logs_api_client.go index ab0064c537..764f1a5c12 100644 --- a/api/managementpb/dbaas/json/client/logs_api/logs_api_client.go +++ b/api/managementpb/dbaas/json/client/logs_api/logs_api_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetLogs(params *GetLogsParams) (*GetLogsOK, error) + GetLogs(params *GetLogsParams, opts ...ClientOption) (*GetLogsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -33,13 +36,12 @@ type ClientService interface { /* GetLogs gets logs gets all logs from db cluster */ -func (a *Client) GetLogs(params *GetLogsParams) (*GetLogsOK, error) { +func (a *Client) GetLogs(params *GetLogsParams, opts ...ClientOption) (*GetLogsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetLogsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetLogs", Method: "POST", PathPattern: "/v1/management/DBaaS/GetLogs", @@ -50,7 +52,12 @@ func (a *Client) GetLogs(params *GetLogsParams) (*GetLogsOK, error) { 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 } diff --git a/api/managementpb/dbaas/json/client/pmm_d_baa_s_client.go b/api/managementpb/dbaas/json/client/pmm_d_baa_s_api_client.go similarity index 88% rename from api/managementpb/dbaas/json/client/pmm_d_baa_s_client.go rename to api/managementpb/dbaas/json/client/pmm_d_baa_s_api_client.go index 4b8d65f6b1..3fe7f5d231 100644 --- a/api/managementpb/dbaas/json/client/pmm_d_baa_s_client.go +++ b/api/managementpb/dbaas/json/client/pmm_d_baa_s_api_client.go @@ -18,7 +18,7 @@ import ( "github.com/percona/pmm/api/managementpb/dbaas/json/client/pxc_clusters" ) -// Default PMM d baa s HTTP client. +// Default PMM d baa s API HTTP client. var Default = NewHTTPClient(nil) const ( @@ -33,14 +33,14 @@ const ( // DefaultSchemes are the default schemes found in Meta (info) section of spec file var DefaultSchemes = []string{"http", "https"} -// NewHTTPClient creates a new PMM d baa s HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMDBaaS { +// NewHTTPClient creates a new PMM d baa s API HTTP client. +func NewHTTPClient(formats strfmt.Registry) *PMMDBaaSAPI { return NewHTTPClientWithConfig(formats, nil) } -// NewHTTPClientWithConfig creates a new PMM d baa s HTTP client, +// NewHTTPClientWithConfig creates a new PMM d baa s API HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMDBaaS { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMDBaaSAPI { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -51,14 +51,14 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMM return New(transport, formats) } -// New creates a new PMM d baa s client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMDBaaS { +// New creates a new PMM d baa s API client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMDBaaSAPI { // ensure nullable parameters have default if formats == nil { formats = strfmt.Default } - cli := new(PMMDBaaS) + cli := new(PMMDBaaSAPI) cli.Transport = transport cli.Components = components.New(transport, formats) cli.DBClusters = db_clusters.New(transport, formats) @@ -108,8 +108,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// PMMDBaaS is a client for PMM d baa s -type PMMDBaaS struct { +// PMMDBaaSAPI is a client for PMM d baa s API +type PMMDBaaSAPI struct { Components components.ClientService DBClusters db_clusters.ClientService @@ -126,7 +126,7 @@ type PMMDBaaS struct { } // SetTransport changes the transport on the client and all its subresources -func (c *PMMDBaaS) SetTransport(transport runtime.ClientTransport) { +func (c *PMMDBaaSAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Components.SetTransport(transport) c.DBClusters.SetTransport(transport) diff --git a/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_parameters.go b/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_parameters.go index 54b09f1802..ffa2ba2ac4 100644 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_parameters.go +++ b/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCreatePSMDBClusterParams creates a new CreatePSMDBClusterParams object -// with the default values initialized. +// NewCreatePSMDBClusterParams creates a new CreatePSMDBClusterParams 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 NewCreatePSMDBClusterParams() *CreatePSMDBClusterParams { - var () return &CreatePSMDBClusterParams{ - timeout: cr.DefaultTimeout, } } // NewCreatePSMDBClusterParamsWithTimeout creates a new CreatePSMDBClusterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreatePSMDBClusterParamsWithTimeout(timeout time.Duration) *CreatePSMDBClusterParams { - var () return &CreatePSMDBClusterParams{ - timeout: timeout, } } // NewCreatePSMDBClusterParamsWithContext creates a new CreatePSMDBClusterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreatePSMDBClusterParamsWithContext(ctx context.Context) *CreatePSMDBClusterParams { - var () return &CreatePSMDBClusterParams{ - Context: ctx, } } // NewCreatePSMDBClusterParamsWithHTTPClient creates a new CreatePSMDBClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreatePSMDBClusterParamsWithHTTPClient(client *http.Client) *CreatePSMDBClusterParams { - var () return &CreatePSMDBClusterParams{ HTTPClient: client, } } -/*CreatePSMDBClusterParams contains all the parameters to send to the API endpoint -for the create PSMDB cluster operation typically these are written to a http.Request +/* CreatePSMDBClusterParams contains all the parameters to send to the API endpoint + for the create PSMDB cluster operation. + + Typically these are written to a http.Request. */ type CreatePSMDBClusterParams struct { - /*Body*/ + // Body. Body CreatePSMDBClusterBody timeout time.Duration @@ -68,6 +67,21 @@ type CreatePSMDBClusterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create PSMDB cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePSMDBClusterParams) WithDefaults() *CreatePSMDBClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create PSMDB cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePSMDBClusterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create PSMDB cluster params func (o *CreatePSMDBClusterParams) WithTimeout(timeout time.Duration) *CreatePSMDBClusterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *CreatePSMDBClusterParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_responses.go b/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_responses.go index 9436eeda40..b23a343f5a 100644 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_responses.go +++ b/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_responses.go @@ -6,6 +6,7 @@ package psmdb_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewCreatePSMDBClusterOK() *CreatePSMDBClusterOK { return &CreatePSMDBClusterOK{} } -/*CreatePSMDBClusterOK handles this case with default header values. +/* CreatePSMDBClusterOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type CreatePSMDBClusterOK struct { func (o *CreatePSMDBClusterOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PSMDBCluster/Create][%d] createPsmdbClusterOk %+v", 200, o.Payload) } - func (o *CreatePSMDBClusterOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewCreatePSMDBClusterDefault(code int) *CreatePSMDBClusterDefault { } } -/*CreatePSMDBClusterDefault handles this case with default header values. +/* CreatePSMDBClusterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *CreatePSMDBClusterDefault) Code() int { func (o *CreatePSMDBClusterDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PSMDBCluster/Create][%d] CreatePSMDBCluster default %+v", o._statusCode, o.Payload) } - func (o *CreatePSMDBClusterDefault) GetPayload() *CreatePSMDBClusterDefaultBody { return o.Payload } @@ -151,7 +150,6 @@ func (o *CreatePSMDBClusterBody) Validate(formats strfmt.Registry) error { } func (o *CreatePSMDBClusterBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required return nil } @@ -160,6 +158,38 @@ func (o *CreatePSMDBClusterBody) validateParams(formats strfmt.Registry) error { if err := o.Params.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create PSMDB cluster body based on the context it is used +func (o *CreatePSMDBClusterBody) 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 *CreatePSMDBClusterBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { + + if o.Params != nil { + if err := o.Params.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") } return err } @@ -201,7 +231,7 @@ type CreatePSMDBClusterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*CreatePSMDBClusterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this create PSMDB cluster default body @@ -219,7 +249,6 @@ func (o *CreatePSMDBClusterDefaultBody) Validate(formats strfmt.Registry) error } func (o *CreatePSMDBClusterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -233,6 +262,42 @@ func (o *CreatePSMDBClusterDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("CreatePSMDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CreatePSMDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create PSMDB cluster default body based on the context it is used +func (o *CreatePSMDBClusterDefaultBody) 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 *CreatePSMDBClusterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CreatePSMDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CreatePSMDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -261,6 +326,47 @@ func (o *CreatePSMDBClusterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*CreatePSMDBClusterDefaultBodyDetailsItems0 create PSMDB cluster default body details items0 +swagger:model CreatePSMDBClusterDefaultBodyDetailsItems0 +*/ +type CreatePSMDBClusterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this create PSMDB cluster default body details items0 +func (o *CreatePSMDBClusterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create PSMDB cluster default body details items0 based on context it is used +func (o *CreatePSMDBClusterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *CreatePSMDBClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CreatePSMDBClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res CreatePSMDBClusterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*CreatePSMDBClusterParamsBodyParams PSMDBClusterParams represents PSMDB cluster parameters that can be updated. swagger:model CreatePSMDBClusterParamsBodyParams */ @@ -291,7 +397,6 @@ func (o *CreatePSMDBClusterParamsBodyParams) Validate(formats strfmt.Registry) e } func (o *CreatePSMDBClusterParamsBodyParams) validateReplicaset(formats strfmt.Registry) error { - if swag.IsZero(o.Replicaset) { // not required return nil } @@ -300,6 +405,38 @@ func (o *CreatePSMDBClusterParamsBodyParams) validateReplicaset(formats strfmt.R if err := o.Replicaset.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "replicaset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create PSMDB cluster params body params based on the context it is used +func (o *CreatePSMDBClusterParamsBodyParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateReplicaset(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CreatePSMDBClusterParamsBodyParams) contextValidateReplicaset(ctx context.Context, formats strfmt.Registry) error { + + if o.Replicaset != nil { + if err := o.Replicaset.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "replicaset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset") } return err } @@ -354,7 +491,6 @@ func (o *CreatePSMDBClusterParamsBodyParamsReplicaset) Validate(formats strfmt.R } func (o *CreatePSMDBClusterParamsBodyParamsReplicaset) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -363,6 +499,38 @@ func (o *CreatePSMDBClusterParamsBodyParamsReplicaset) validateComputeResources( if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create PSMDB cluster params body params replicaset based on the context it is used +func (o *CreatePSMDBClusterParamsBodyParamsReplicaset) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CreatePSMDBClusterParamsBodyParamsReplicaset) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") } return err } @@ -406,44 +574,13 @@ func (o *CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources) Validate( return nil } -// MarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources) UnmarshalBinary(b []byte) error { - var res CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this create PSMDB cluster params body params replicaset compute resources based on context it is used +func (o *CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -451,8 +588,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources) UnmarshalBinary(b []byte) error { + var res CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_credentials_parameters.go b/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_credentials_parameters.go index 9134ed8ebd..86f7a829f9 100644 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_credentials_parameters.go +++ b/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_credentials_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetPSMDBClusterCredentialsParams creates a new GetPSMDBClusterCredentialsParams object -// with the default values initialized. +// NewGetPSMDBClusterCredentialsParams creates a new GetPSMDBClusterCredentialsParams 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 NewGetPSMDBClusterCredentialsParams() *GetPSMDBClusterCredentialsParams { - var () return &GetPSMDBClusterCredentialsParams{ - timeout: cr.DefaultTimeout, } } // NewGetPSMDBClusterCredentialsParamsWithTimeout creates a new GetPSMDBClusterCredentialsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPSMDBClusterCredentialsParamsWithTimeout(timeout time.Duration) *GetPSMDBClusterCredentialsParams { - var () return &GetPSMDBClusterCredentialsParams{ - timeout: timeout, } } // NewGetPSMDBClusterCredentialsParamsWithContext creates a new GetPSMDBClusterCredentialsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPSMDBClusterCredentialsParamsWithContext(ctx context.Context) *GetPSMDBClusterCredentialsParams { - var () return &GetPSMDBClusterCredentialsParams{ - Context: ctx, } } // NewGetPSMDBClusterCredentialsParamsWithHTTPClient creates a new GetPSMDBClusterCredentialsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPSMDBClusterCredentialsParamsWithHTTPClient(client *http.Client) *GetPSMDBClusterCredentialsParams { - var () return &GetPSMDBClusterCredentialsParams{ HTTPClient: client, } } -/*GetPSMDBClusterCredentialsParams contains all the parameters to send to the API endpoint -for the get PSMDB cluster credentials operation typically these are written to a http.Request +/* GetPSMDBClusterCredentialsParams contains all the parameters to send to the API endpoint + for the get PSMDB cluster credentials operation. + + Typically these are written to a http.Request. */ type GetPSMDBClusterCredentialsParams struct { - /*Body*/ + // Body. Body GetPSMDBClusterCredentialsBody timeout time.Duration @@ -68,6 +67,21 @@ type GetPSMDBClusterCredentialsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get PSMDB cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPSMDBClusterCredentialsParams) WithDefaults() *GetPSMDBClusterCredentialsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get PSMDB cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPSMDBClusterCredentialsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get PSMDB cluster credentials params func (o *GetPSMDBClusterCredentialsParams) WithTimeout(timeout time.Duration) *GetPSMDBClusterCredentialsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *GetPSMDBClusterCredentialsParams) WriteToRequest(r runtime.ClientReques return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_credentials_responses.go b/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_credentials_responses.go index 96bb520af5..d340170d9b 100644 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_credentials_responses.go +++ b/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_credentials_responses.go @@ -6,6 +6,7 @@ package psmdb_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetPSMDBClusterCredentialsOK() *GetPSMDBClusterCredentialsOK { return &GetPSMDBClusterCredentialsOK{} } -/*GetPSMDBClusterCredentialsOK handles this case with default header values. +/* GetPSMDBClusterCredentialsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetPSMDBClusterCredentialsOK struct { func (o *GetPSMDBClusterCredentialsOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PSMDBClusters/GetCredentials][%d] getPsmdbClusterCredentialsOk %+v", 200, o.Payload) } - func (o *GetPSMDBClusterCredentialsOK) GetPayload() *GetPSMDBClusterCredentialsOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetPSMDBClusterCredentialsDefault(code int) *GetPSMDBClusterCredentialsD } } -/*GetPSMDBClusterCredentialsDefault handles this case with default header values. +/* GetPSMDBClusterCredentialsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetPSMDBClusterCredentialsDefault) Code() int { func (o *GetPSMDBClusterCredentialsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PSMDBClusters/GetCredentials][%d] GetPSMDBClusterCredentials default %+v", o._statusCode, o.Payload) } - func (o *GetPSMDBClusterCredentialsDefault) GetPayload() *GetPSMDBClusterCredentialsDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ func (o *GetPSMDBClusterCredentialsBody) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this get PSMDB cluster credentials body based on context it is used +func (o *GetPSMDBClusterCredentialsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPSMDBClusterCredentialsBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -167,7 +171,7 @@ type GetPSMDBClusterCredentialsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetPSMDBClusterCredentialsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get PSMDB cluster credentials default body @@ -185,7 +189,6 @@ func (o *GetPSMDBClusterCredentialsDefaultBody) Validate(formats strfmt.Registry } func (o *GetPSMDBClusterCredentialsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *GetPSMDBClusterCredentialsDefaultBody) validateDetails(formats strfmt.R if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetPSMDBClusterCredentials default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPSMDBClusterCredentials default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get PSMDB cluster credentials default body based on the context it is used +func (o *GetPSMDBClusterCredentialsDefaultBody) 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 *GetPSMDBClusterCredentialsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetPSMDBClusterCredentials default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPSMDBClusterCredentials default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,6 +266,47 @@ func (o *GetPSMDBClusterCredentialsDefaultBody) UnmarshalBinary(b []byte) error return nil } +/*GetPSMDBClusterCredentialsDefaultBodyDetailsItems0 get PSMDB cluster credentials default body details items0 +swagger:model GetPSMDBClusterCredentialsDefaultBodyDetailsItems0 +*/ +type GetPSMDBClusterCredentialsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this get PSMDB cluster credentials default body details items0 +func (o *GetPSMDBClusterCredentialsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB cluster credentials default body details items0 based on context it is used +func (o *GetPSMDBClusterCredentialsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPSMDBClusterCredentialsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPSMDBClusterCredentialsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res GetPSMDBClusterCredentialsDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*GetPSMDBClusterCredentialsOKBody get PSMDB cluster credentials OK body swagger:model GetPSMDBClusterCredentialsOKBody */ @@ -251,7 +331,6 @@ func (o *GetPSMDBClusterCredentialsOKBody) Validate(formats strfmt.Registry) err } func (o *GetPSMDBClusterCredentialsOKBody) validateConnectionCredentials(formats strfmt.Registry) error { - if swag.IsZero(o.ConnectionCredentials) { // not required return nil } @@ -260,6 +339,38 @@ func (o *GetPSMDBClusterCredentialsOKBody) validateConnectionCredentials(formats if err := o.ConnectionCredentials.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getPsmdbClusterCredentialsOk" + "." + "connection_credentials") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPsmdbClusterCredentialsOk" + "." + "connection_credentials") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PSMDB cluster credentials OK body based on the context it is used +func (o *GetPSMDBClusterCredentialsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateConnectionCredentials(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPSMDBClusterCredentialsOKBody) contextValidateConnectionCredentials(ctx context.Context, formats strfmt.Registry) error { + + if o.ConnectionCredentials != nil { + if err := o.ConnectionCredentials.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getPsmdbClusterCredentialsOk" + "." + "connection_credentials") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPsmdbClusterCredentialsOk" + "." + "connection_credentials") } return err } @@ -313,6 +424,11 @@ func (o *GetPSMDBClusterCredentialsOKBodyConnectionCredentials) Validate(formats return nil } +// ContextValidate validates this get PSMDB cluster credentials OK body connection credentials based on context it is used +func (o *GetPSMDBClusterCredentialsOKBodyConnectionCredentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPSMDBClusterCredentialsOKBodyConnectionCredentials) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_resources_parameters.go b/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_resources_parameters.go index a16544dd1e..99f940987e 100644 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_resources_parameters.go +++ b/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_resources_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetPSMDBClusterResourcesParams creates a new GetPSMDBClusterResourcesParams object -// with the default values initialized. +// NewGetPSMDBClusterResourcesParams creates a new GetPSMDBClusterResourcesParams 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 NewGetPSMDBClusterResourcesParams() *GetPSMDBClusterResourcesParams { - var () return &GetPSMDBClusterResourcesParams{ - timeout: cr.DefaultTimeout, } } // NewGetPSMDBClusterResourcesParamsWithTimeout creates a new GetPSMDBClusterResourcesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPSMDBClusterResourcesParamsWithTimeout(timeout time.Duration) *GetPSMDBClusterResourcesParams { - var () return &GetPSMDBClusterResourcesParams{ - timeout: timeout, } } // NewGetPSMDBClusterResourcesParamsWithContext creates a new GetPSMDBClusterResourcesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPSMDBClusterResourcesParamsWithContext(ctx context.Context) *GetPSMDBClusterResourcesParams { - var () return &GetPSMDBClusterResourcesParams{ - Context: ctx, } } // NewGetPSMDBClusterResourcesParamsWithHTTPClient creates a new GetPSMDBClusterResourcesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPSMDBClusterResourcesParamsWithHTTPClient(client *http.Client) *GetPSMDBClusterResourcesParams { - var () return &GetPSMDBClusterResourcesParams{ HTTPClient: client, } } -/*GetPSMDBClusterResourcesParams contains all the parameters to send to the API endpoint -for the get PSMDB cluster resources operation typically these are written to a http.Request +/* GetPSMDBClusterResourcesParams contains all the parameters to send to the API endpoint + for the get PSMDB cluster resources operation. + + Typically these are written to a http.Request. */ type GetPSMDBClusterResourcesParams struct { - /*Body*/ + // Body. Body GetPSMDBClusterResourcesBody timeout time.Duration @@ -68,6 +67,21 @@ type GetPSMDBClusterResourcesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get PSMDB cluster resources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPSMDBClusterResourcesParams) WithDefaults() *GetPSMDBClusterResourcesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get PSMDB cluster resources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPSMDBClusterResourcesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get PSMDB cluster resources params func (o *GetPSMDBClusterResourcesParams) WithTimeout(timeout time.Duration) *GetPSMDBClusterResourcesParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *GetPSMDBClusterResourcesParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_resources_responses.go b/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_resources_responses.go index b66cfe3262..fc35cce6d2 100644 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_resources_responses.go +++ b/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_resources_responses.go @@ -6,6 +6,7 @@ package psmdb_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetPSMDBClusterResourcesOK() *GetPSMDBClusterResourcesOK { return &GetPSMDBClusterResourcesOK{} } -/*GetPSMDBClusterResourcesOK handles this case with default header values. +/* GetPSMDBClusterResourcesOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetPSMDBClusterResourcesOK struct { func (o *GetPSMDBClusterResourcesOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PSMDBCluster/Resources/Get][%d] getPsmdbClusterResourcesOk %+v", 200, o.Payload) } - func (o *GetPSMDBClusterResourcesOK) GetPayload() *GetPSMDBClusterResourcesOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetPSMDBClusterResourcesDefault(code int) *GetPSMDBClusterResourcesDefau } } -/*GetPSMDBClusterResourcesDefault handles this case with default header values. +/* GetPSMDBClusterResourcesDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetPSMDBClusterResourcesDefault) Code() int { func (o *GetPSMDBClusterResourcesDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PSMDBCluster/Resources/Get][%d] GetPSMDBClusterResources default %+v", o._statusCode, o.Payload) } - func (o *GetPSMDBClusterResourcesDefault) GetPayload() *GetPSMDBClusterResourcesDefaultBody { return o.Payload } @@ -141,7 +140,6 @@ func (o *GetPSMDBClusterResourcesBody) Validate(formats strfmt.Registry) error { } func (o *GetPSMDBClusterResourcesBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required return nil } @@ -150,6 +148,38 @@ func (o *GetPSMDBClusterResourcesBody) validateParams(formats strfmt.Registry) e if err := o.Params.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PSMDB cluster resources body based on the context it is used +func (o *GetPSMDBClusterResourcesBody) 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 *GetPSMDBClusterResourcesBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { + + if o.Params != nil { + if err := o.Params.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") } return err } @@ -191,7 +221,7 @@ type GetPSMDBClusterResourcesDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetPSMDBClusterResourcesDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get PSMDB cluster resources default body @@ -209,7 +239,6 @@ func (o *GetPSMDBClusterResourcesDefaultBody) Validate(formats strfmt.Registry) } func (o *GetPSMDBClusterResourcesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -223,6 +252,42 @@ func (o *GetPSMDBClusterResourcesDefaultBody) validateDetails(formats strfmt.Reg if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetPSMDBClusterResources default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPSMDBClusterResources default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get PSMDB cluster resources default body based on the context it is used +func (o *GetPSMDBClusterResourcesDefaultBody) 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 *GetPSMDBClusterResourcesDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetPSMDBClusterResources default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPSMDBClusterResources default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -251,6 +316,47 @@ func (o *GetPSMDBClusterResourcesDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetPSMDBClusterResourcesDefaultBodyDetailsItems0 get PSMDB cluster resources default body details items0 +swagger:model GetPSMDBClusterResourcesDefaultBodyDetailsItems0 +*/ +type GetPSMDBClusterResourcesDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this get PSMDB cluster resources default body details items0 +func (o *GetPSMDBClusterResourcesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PSMDB cluster resources default body details items0 based on context it is used +func (o *GetPSMDBClusterResourcesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPSMDBClusterResourcesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPSMDBClusterResourcesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res GetPSMDBClusterResourcesDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*GetPSMDBClusterResourcesOKBody get PSMDB cluster resources OK body swagger:model GetPSMDBClusterResourcesOKBody */ @@ -275,7 +381,6 @@ func (o *GetPSMDBClusterResourcesOKBody) Validate(formats strfmt.Registry) error } func (o *GetPSMDBClusterResourcesOKBody) validateExpected(formats strfmt.Registry) error { - if swag.IsZero(o.Expected) { // not required return nil } @@ -284,6 +389,38 @@ func (o *GetPSMDBClusterResourcesOKBody) validateExpected(formats strfmt.Registr if err := o.Expected.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getPsmdbClusterResourcesOk" + "." + "expected") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPsmdbClusterResourcesOk" + "." + "expected") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PSMDB cluster resources OK body based on the context it is used +func (o *GetPSMDBClusterResourcesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateExpected(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPSMDBClusterResourcesOKBody) contextValidateExpected(ctx context.Context, formats strfmt.Registry) error { + + if o.Expected != nil { + if err := o.Expected.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getPsmdbClusterResourcesOk" + "." + "expected") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPsmdbClusterResourcesOk" + "." + "expected") } return err } @@ -331,6 +468,11 @@ func (o *GetPSMDBClusterResourcesOKBodyExpected) Validate(formats strfmt.Registr return nil } +// ContextValidate validates this get PSMDB cluster resources OK body expected based on context it is used +func (o *GetPSMDBClusterResourcesOKBodyExpected) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPSMDBClusterResourcesOKBodyExpected) MarshalBinary() ([]byte, error) { if o == nil { @@ -379,7 +521,6 @@ func (o *GetPSMDBClusterResourcesParamsBodyParams) Validate(formats strfmt.Regis } func (o *GetPSMDBClusterResourcesParamsBodyParams) validateReplicaset(formats strfmt.Registry) error { - if swag.IsZero(o.Replicaset) { // not required return nil } @@ -388,6 +529,38 @@ func (o *GetPSMDBClusterResourcesParamsBodyParams) validateReplicaset(formats st if err := o.Replicaset.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "replicaset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PSMDB cluster resources params body params based on the context it is used +func (o *GetPSMDBClusterResourcesParamsBodyParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateReplicaset(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPSMDBClusterResourcesParamsBodyParams) contextValidateReplicaset(ctx context.Context, formats strfmt.Registry) error { + + if o.Replicaset != nil { + if err := o.Replicaset.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "replicaset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset") } return err } @@ -442,7 +615,6 @@ func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicaset) Validate(formats st } func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicaset) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -451,6 +623,38 @@ func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicaset) validateComputeReso if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PSMDB cluster resources params body params replicaset based on the context it is used +func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicaset) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicaset) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") } return err } @@ -494,6 +698,11 @@ func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources) Val return nil } +// ContextValidate validates this get PSMDB cluster resources params body params replicaset compute resources based on context it is used +func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/client/psmdb_clusters/psmdb_clusters_client.go b/api/managementpb/dbaas/json/client/psmdb_clusters/psmdb_clusters_client.go index 045b8a2cc1..d342970c4e 100644 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/psmdb_clusters_client.go +++ b/api/managementpb/dbaas/json/client/psmdb_clusters/psmdb_clusters_client.go @@ -23,15 +23,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreatePSMDBCluster(params *CreatePSMDBClusterParams) (*CreatePSMDBClusterOK, error) + CreatePSMDBCluster(params *CreatePSMDBClusterParams, opts ...ClientOption) (*CreatePSMDBClusterOK, error) - GetPSMDBClusterCredentials(params *GetPSMDBClusterCredentialsParams) (*GetPSMDBClusterCredentialsOK, error) + GetPSMDBClusterCredentials(params *GetPSMDBClusterCredentialsParams, opts ...ClientOption) (*GetPSMDBClusterCredentialsOK, error) - GetPSMDBClusterResources(params *GetPSMDBClusterResourcesParams) (*GetPSMDBClusterResourcesOK, error) + GetPSMDBClusterResources(params *GetPSMDBClusterResourcesParams, opts ...ClientOption) (*GetPSMDBClusterResourcesOK, error) - UpdatePSMDBCluster(params *UpdatePSMDBClusterParams) (*UpdatePSMDBClusterOK, error) + UpdatePSMDBCluster(params *UpdatePSMDBClusterParams, opts ...ClientOption) (*UpdatePSMDBClusterOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { /* CreatePSMDBCluster creates PSMDB cluster creates a new PSMDB cluster */ -func (a *Client) CreatePSMDBCluster(params *CreatePSMDBClusterParams) (*CreatePSMDBClusterOK, error) { +func (a *Client) CreatePSMDBCluster(params *CreatePSMDBClusterParams, opts ...ClientOption) (*CreatePSMDBClusterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCreatePSMDBClusterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "CreatePSMDBCluster", Method: "POST", PathPattern: "/v1/management/DBaaS/PSMDBCluster/Create", @@ -56,7 +58,12 @@ func (a *Client) CreatePSMDBCluster(params *CreatePSMDBClusterParams) (*CreatePS Reader: &CreatePSMDBClusterReader{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 } @@ -72,13 +79,12 @@ func (a *Client) CreatePSMDBCluster(params *CreatePSMDBClusterParams) (*CreatePS /* GetPSMDBClusterCredentials gets PSMDB cluster credentials returns a PSMDB cluster credentials by cluster name */ -func (a *Client) GetPSMDBClusterCredentials(params *GetPSMDBClusterCredentialsParams) (*GetPSMDBClusterCredentialsOK, error) { +func (a *Client) GetPSMDBClusterCredentials(params *GetPSMDBClusterCredentialsParams, opts ...ClientOption) (*GetPSMDBClusterCredentialsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPSMDBClusterCredentialsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetPSMDBClusterCredentials", Method: "POST", PathPattern: "/v1/management/DBaaS/PSMDBClusters/GetCredentials", @@ -89,7 +95,12 @@ func (a *Client) GetPSMDBClusterCredentials(params *GetPSMDBClusterCredentialsPa Reader: &GetPSMDBClusterCredentialsReader{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 } @@ -105,13 +116,12 @@ func (a *Client) GetPSMDBClusterCredentials(params *GetPSMDBClusterCredentialsPa /* GetPSMDBClusterResources gets PSMDB cluster resources returns expected resources to be consumed by the cluster */ -func (a *Client) GetPSMDBClusterResources(params *GetPSMDBClusterResourcesParams) (*GetPSMDBClusterResourcesOK, error) { +func (a *Client) GetPSMDBClusterResources(params *GetPSMDBClusterResourcesParams, opts ...ClientOption) (*GetPSMDBClusterResourcesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPSMDBClusterResourcesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetPSMDBClusterResources", Method: "POST", PathPattern: "/v1/management/DBaaS/PSMDBCluster/Resources/Get", @@ -122,7 +132,12 @@ func (a *Client) GetPSMDBClusterResources(params *GetPSMDBClusterResourcesParams Reader: &GetPSMDBClusterResourcesReader{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 } @@ -138,13 +153,12 @@ func (a *Client) GetPSMDBClusterResources(params *GetPSMDBClusterResourcesParams /* UpdatePSMDBCluster updates PSMDB cluster updates existing PSMDB cluster */ -func (a *Client) UpdatePSMDBCluster(params *UpdatePSMDBClusterParams) (*UpdatePSMDBClusterOK, error) { +func (a *Client) UpdatePSMDBCluster(params *UpdatePSMDBClusterParams, opts ...ClientOption) (*UpdatePSMDBClusterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdatePSMDBClusterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "UpdatePSMDBCluster", Method: "POST", PathPattern: "/v1/management/DBaaS/PSMDBCluster/Update", @@ -155,7 +169,12 @@ func (a *Client) UpdatePSMDBCluster(params *UpdatePSMDBClusterParams) (*UpdatePS Reader: &UpdatePSMDBClusterReader{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 } diff --git a/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_parameters.go b/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_parameters.go index c1f32ff457..7c9a857129 100644 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_parameters.go +++ b/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUpdatePSMDBClusterParams creates a new UpdatePSMDBClusterParams object -// with the default values initialized. +// NewUpdatePSMDBClusterParams creates a new UpdatePSMDBClusterParams 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 NewUpdatePSMDBClusterParams() *UpdatePSMDBClusterParams { - var () return &UpdatePSMDBClusterParams{ - timeout: cr.DefaultTimeout, } } // NewUpdatePSMDBClusterParamsWithTimeout creates a new UpdatePSMDBClusterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdatePSMDBClusterParamsWithTimeout(timeout time.Duration) *UpdatePSMDBClusterParams { - var () return &UpdatePSMDBClusterParams{ - timeout: timeout, } } // NewUpdatePSMDBClusterParamsWithContext creates a new UpdatePSMDBClusterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdatePSMDBClusterParamsWithContext(ctx context.Context) *UpdatePSMDBClusterParams { - var () return &UpdatePSMDBClusterParams{ - Context: ctx, } } // NewUpdatePSMDBClusterParamsWithHTTPClient creates a new UpdatePSMDBClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdatePSMDBClusterParamsWithHTTPClient(client *http.Client) *UpdatePSMDBClusterParams { - var () return &UpdatePSMDBClusterParams{ HTTPClient: client, } } -/*UpdatePSMDBClusterParams contains all the parameters to send to the API endpoint -for the update PSMDB cluster operation typically these are written to a http.Request +/* UpdatePSMDBClusterParams contains all the parameters to send to the API endpoint + for the update PSMDB cluster operation. + + Typically these are written to a http.Request. */ type UpdatePSMDBClusterParams struct { - /*Body*/ + // Body. Body UpdatePSMDBClusterBody timeout time.Duration @@ -68,6 +67,21 @@ type UpdatePSMDBClusterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update PSMDB cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePSMDBClusterParams) WithDefaults() *UpdatePSMDBClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update PSMDB cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePSMDBClusterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update PSMDB cluster params func (o *UpdatePSMDBClusterParams) WithTimeout(timeout time.Duration) *UpdatePSMDBClusterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *UpdatePSMDBClusterParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_responses.go b/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_responses.go index 620e87be8f..10f46369e9 100644 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_responses.go +++ b/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_responses.go @@ -6,6 +6,7 @@ package psmdb_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewUpdatePSMDBClusterOK() *UpdatePSMDBClusterOK { return &UpdatePSMDBClusterOK{} } -/*UpdatePSMDBClusterOK handles this case with default header values. +/* UpdatePSMDBClusterOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type UpdatePSMDBClusterOK struct { func (o *UpdatePSMDBClusterOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PSMDBCluster/Update][%d] updatePsmdbClusterOk %+v", 200, o.Payload) } - func (o *UpdatePSMDBClusterOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewUpdatePSMDBClusterDefault(code int) *UpdatePSMDBClusterDefault { } } -/*UpdatePSMDBClusterDefault handles this case with default header values. +/* UpdatePSMDBClusterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *UpdatePSMDBClusterDefault) Code() int { func (o *UpdatePSMDBClusterDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PSMDBCluster/Update][%d] UpdatePSMDBCluster default %+v", o._statusCode, o.Payload) } - func (o *UpdatePSMDBClusterDefault) GetPayload() *UpdatePSMDBClusterDefaultBody { return o.Payload } @@ -145,7 +144,6 @@ func (o *UpdatePSMDBClusterBody) Validate(formats strfmt.Registry) error { } func (o *UpdatePSMDBClusterBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required return nil } @@ -154,6 +152,38 @@ func (o *UpdatePSMDBClusterBody) validateParams(formats strfmt.Registry) error { if err := o.Params.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update PSMDB cluster body based on the context it is used +func (o *UpdatePSMDBClusterBody) 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 *UpdatePSMDBClusterBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { + + if o.Params != nil { + if err := o.Params.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") } return err } @@ -195,7 +225,7 @@ type UpdatePSMDBClusterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*UpdatePSMDBClusterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this update PSMDB cluster default body @@ -213,7 +243,6 @@ func (o *UpdatePSMDBClusterDefaultBody) Validate(formats strfmt.Registry) error } func (o *UpdatePSMDBClusterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -227,6 +256,42 @@ func (o *UpdatePSMDBClusterDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("UpdatePSMDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UpdatePSMDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update PSMDB cluster default body based on the context it is used +func (o *UpdatePSMDBClusterDefaultBody) 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 *UpdatePSMDBClusterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UpdatePSMDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UpdatePSMDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -255,6 +320,47 @@ func (o *UpdatePSMDBClusterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*UpdatePSMDBClusterDefaultBodyDetailsItems0 update PSMDB cluster default body details items0 +swagger:model UpdatePSMDBClusterDefaultBodyDetailsItems0 +*/ +type UpdatePSMDBClusterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this update PSMDB cluster default body details items0 +func (o *UpdatePSMDBClusterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update PSMDB cluster default body details items0 based on context it is used +func (o *UpdatePSMDBClusterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UpdatePSMDBClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UpdatePSMDBClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res UpdatePSMDBClusterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*UpdatePSMDBClusterParamsBodyParams UpdatePSMDBClusterParams represents PSMDB cluster parameters that can be updated. swagger:model UpdatePSMDBClusterParamsBodyParams */ @@ -292,7 +398,6 @@ func (o *UpdatePSMDBClusterParamsBodyParams) Validate(formats strfmt.Registry) e } func (o *UpdatePSMDBClusterParamsBodyParams) validateReplicaset(formats strfmt.Registry) error { - if swag.IsZero(o.Replicaset) { // not required return nil } @@ -301,6 +406,38 @@ func (o *UpdatePSMDBClusterParamsBodyParams) validateReplicaset(formats strfmt.R if err := o.Replicaset.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "replicaset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update PSMDB cluster params body params based on the context it is used +func (o *UpdatePSMDBClusterParamsBodyParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateReplicaset(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *UpdatePSMDBClusterParamsBodyParams) contextValidateReplicaset(ctx context.Context, formats strfmt.Registry) error { + + if o.Replicaset != nil { + if err := o.Replicaset.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "replicaset") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset") } return err } @@ -351,7 +488,6 @@ func (o *UpdatePSMDBClusterParamsBodyParamsReplicaset) Validate(formats strfmt.R } func (o *UpdatePSMDBClusterParamsBodyParamsReplicaset) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -360,6 +496,38 @@ func (o *UpdatePSMDBClusterParamsBodyParamsReplicaset) validateComputeResources( if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update PSMDB cluster params body params replicaset based on the context it is used +func (o *UpdatePSMDBClusterParamsBodyParamsReplicaset) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *UpdatePSMDBClusterParamsBodyParamsReplicaset) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "replicaset" + "." + "compute_resources") } return err } @@ -403,6 +571,11 @@ func (o *UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources) Validate( return nil } +// ContextValidate validates this update PSMDB cluster params body params replicaset compute resources based on context it is used +func (o *UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_parameters.go b/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_parameters.go index 8e37fe038f..d45ff33ca5 100644 --- a/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_parameters.go +++ b/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCreatePXCClusterParams creates a new CreatePXCClusterParams object -// with the default values initialized. +// NewCreatePXCClusterParams creates a new CreatePXCClusterParams 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 NewCreatePXCClusterParams() *CreatePXCClusterParams { - var () return &CreatePXCClusterParams{ - timeout: cr.DefaultTimeout, } } // NewCreatePXCClusterParamsWithTimeout creates a new CreatePXCClusterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreatePXCClusterParamsWithTimeout(timeout time.Duration) *CreatePXCClusterParams { - var () return &CreatePXCClusterParams{ - timeout: timeout, } } // NewCreatePXCClusterParamsWithContext creates a new CreatePXCClusterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreatePXCClusterParamsWithContext(ctx context.Context) *CreatePXCClusterParams { - var () return &CreatePXCClusterParams{ - Context: ctx, } } // NewCreatePXCClusterParamsWithHTTPClient creates a new CreatePXCClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreatePXCClusterParamsWithHTTPClient(client *http.Client) *CreatePXCClusterParams { - var () return &CreatePXCClusterParams{ HTTPClient: client, } } -/*CreatePXCClusterParams contains all the parameters to send to the API endpoint -for the create PXC cluster operation typically these are written to a http.Request +/* CreatePXCClusterParams contains all the parameters to send to the API endpoint + for the create PXC cluster operation. + + Typically these are written to a http.Request. */ type CreatePXCClusterParams struct { - /*Body*/ + // Body. Body CreatePXCClusterBody timeout time.Duration @@ -68,6 +67,21 @@ type CreatePXCClusterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create PXC cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePXCClusterParams) WithDefaults() *CreatePXCClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create PXC cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePXCClusterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create PXC cluster params func (o *CreatePXCClusterParams) WithTimeout(timeout time.Duration) *CreatePXCClusterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *CreatePXCClusterParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_responses.go b/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_responses.go index bc6cd56b84..aea8d6a018 100644 --- a/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_responses.go +++ b/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_responses.go @@ -6,6 +6,7 @@ package pxc_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewCreatePXCClusterOK() *CreatePXCClusterOK { return &CreatePXCClusterOK{} } -/*CreatePXCClusterOK handles this case with default header values. +/* CreatePXCClusterOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type CreatePXCClusterOK struct { func (o *CreatePXCClusterOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PXCCluster/Create][%d] createPxcClusterOk %+v", 200, o.Payload) } - func (o *CreatePXCClusterOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewCreatePXCClusterDefault(code int) *CreatePXCClusterDefault { } } -/*CreatePXCClusterDefault handles this case with default header values. +/* CreatePXCClusterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *CreatePXCClusterDefault) Code() int { func (o *CreatePXCClusterDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PXCCluster/Create][%d] CreatePXCCluster default %+v", o._statusCode, o.Payload) } - func (o *CreatePXCClusterDefault) GetPayload() *CreatePXCClusterDefaultBody { return o.Payload } @@ -151,7 +150,6 @@ func (o *CreatePXCClusterBody) Validate(formats strfmt.Registry) error { } func (o *CreatePXCClusterBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required return nil } @@ -160,6 +158,38 @@ func (o *CreatePXCClusterBody) validateParams(formats strfmt.Registry) error { if err := o.Params.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create PXC cluster body based on the context it is used +func (o *CreatePXCClusterBody) 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 *CreatePXCClusterBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { + + if o.Params != nil { + if err := o.Params.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") } return err } @@ -201,7 +231,7 @@ type CreatePXCClusterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*CreatePXCClusterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this create PXC cluster default body @@ -219,7 +249,6 @@ func (o *CreatePXCClusterDefaultBody) Validate(formats strfmt.Registry) error { } func (o *CreatePXCClusterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -233,6 +262,42 @@ func (o *CreatePXCClusterDefaultBody) validateDetails(formats strfmt.Registry) e if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("CreatePXCCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CreatePXCCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create PXC cluster default body based on the context it is used +func (o *CreatePXCClusterDefaultBody) 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 *CreatePXCClusterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CreatePXCCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CreatePXCCluster default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -261,6 +326,47 @@ func (o *CreatePXCClusterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*CreatePXCClusterDefaultBodyDetailsItems0 create PXC cluster default body details items0 +swagger:model CreatePXCClusterDefaultBodyDetailsItems0 +*/ +type CreatePXCClusterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this create PXC cluster default body details items0 +func (o *CreatePXCClusterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create PXC cluster default body details items0 based on context it is used +func (o *CreatePXCClusterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *CreatePXCClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CreatePXCClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res CreatePXCClusterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*CreatePXCClusterParamsBodyParams PXCClusterParams represents PXC cluster parameters that can be updated. swagger:model CreatePXCClusterParamsBodyParams */ @@ -302,7 +408,6 @@ func (o *CreatePXCClusterParamsBodyParams) Validate(formats strfmt.Registry) err } func (o *CreatePXCClusterParamsBodyParams) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required return nil } @@ -311,6 +416,8 @@ func (o *CreatePXCClusterParamsBodyParams) validateHaproxy(formats strfmt.Regist if err := o.Haproxy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy") } return err } @@ -320,7 +427,6 @@ func (o *CreatePXCClusterParamsBodyParams) validateHaproxy(formats strfmt.Regist } func (o *CreatePXCClusterParamsBodyParams) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required return nil } @@ -329,6 +435,8 @@ func (o *CreatePXCClusterParamsBodyParams) validateProxysql(formats strfmt.Regis if err := o.Proxysql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql") } return err } @@ -338,7 +446,6 @@ func (o *CreatePXCClusterParamsBodyParams) validateProxysql(formats strfmt.Regis } func (o *CreatePXCClusterParamsBodyParams) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required return nil } @@ -347,6 +454,78 @@ func (o *CreatePXCClusterParamsBodyParams) validatePXC(formats strfmt.Registry) if err := o.PXC.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create PXC cluster params body params based on the context it is used +func (o *CreatePXCClusterParamsBodyParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHaproxy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateProxysql(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePXC(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CreatePXCClusterParamsBodyParams) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { + + if o.Haproxy != nil { + if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy") + } + return err + } + } + + return nil +} + +func (o *CreatePXCClusterParamsBodyParams) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { + + if o.Proxysql != nil { + if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql") + } + return err + } + } + + return nil +} + +func (o *CreatePXCClusterParamsBodyParams) contextValidatePXC(ctx context.Context, formats strfmt.Registry) error { + + if o.PXC != nil { + if err := o.PXC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc") } return err } @@ -401,7 +580,6 @@ func (o *CreatePXCClusterParamsBodyParamsHaproxy) Validate(formats strfmt.Regist } func (o *CreatePXCClusterParamsBodyParamsHaproxy) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -410,6 +588,38 @@ func (o *CreatePXCClusterParamsBodyParamsHaproxy) validateComputeResources(forma if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create PXC cluster params body params haproxy based on the context it is used +func (o *CreatePXCClusterParamsBodyParamsHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CreatePXCClusterParamsBodyParamsHaproxy) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") } return err } @@ -453,6 +663,11 @@ func (o *CreatePXCClusterParamsBodyParamsHaproxyComputeResources) Validate(forma return nil } +// ContextValidate validates this create PXC cluster params body params haproxy compute resources based on context it is used +func (o *CreatePXCClusterParamsBodyParamsHaproxyComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *CreatePXCClusterParamsBodyParamsHaproxyComputeResources) MarshalBinary() ([]byte, error) { if o == nil { @@ -502,7 +717,6 @@ func (o *CreatePXCClusterParamsBodyParamsPXC) Validate(formats strfmt.Registry) } func (o *CreatePXCClusterParamsBodyParamsPXC) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -511,6 +725,38 @@ func (o *CreatePXCClusterParamsBodyParamsPXC) validateComputeResources(formats s if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create PXC cluster params body params PXC based on the context it is used +func (o *CreatePXCClusterParamsBodyParamsPXC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CreatePXCClusterParamsBodyParamsPXC) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") } return err } @@ -554,6 +800,11 @@ func (o *CreatePXCClusterParamsBodyParamsPXCComputeResources) Validate(formats s return nil } +// ContextValidate validates this create PXC cluster params body params PXC compute resources based on context it is used +func (o *CreatePXCClusterParamsBodyParamsPXCComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *CreatePXCClusterParamsBodyParamsPXCComputeResources) MarshalBinary() ([]byte, error) { if o == nil { @@ -603,7 +854,6 @@ func (o *CreatePXCClusterParamsBodyParamsProxysql) Validate(formats strfmt.Regis } func (o *CreatePXCClusterParamsBodyParamsProxysql) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -612,6 +862,38 @@ func (o *CreatePXCClusterParamsBodyParamsProxysql) validateComputeResources(form if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create PXC cluster params body params proxysql based on the context it is used +func (o *CreatePXCClusterParamsBodyParamsProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CreatePXCClusterParamsBodyParamsProxysql) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") } return err } @@ -655,44 +937,13 @@ func (o *CreatePXCClusterParamsBodyParamsProxysqlComputeResources) Validate(form return nil } -// MarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsProxysqlComputeResources) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsProxysqlComputeResources) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterParamsBodyParamsProxysqlComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this create PXC cluster params body params proxysql compute resources based on context it is used +func (o *CreatePXCClusterParamsBodyParamsProxysqlComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *CreatePXCClusterParamsBodyParamsProxysqlComputeResources) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -700,8 +951,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *CreatePXCClusterParamsBodyParamsProxysqlComputeResources) UnmarshalBinary(b []byte) error { + var res CreatePXCClusterParamsBodyParamsProxysqlComputeResources if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_credentials_parameters.go b/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_credentials_parameters.go index 760043339e..468c29f723 100644 --- a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_credentials_parameters.go +++ b/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_credentials_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetPXCClusterCredentialsParams creates a new GetPXCClusterCredentialsParams object -// with the default values initialized. +// NewGetPXCClusterCredentialsParams creates a new GetPXCClusterCredentialsParams 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 NewGetPXCClusterCredentialsParams() *GetPXCClusterCredentialsParams { - var () return &GetPXCClusterCredentialsParams{ - timeout: cr.DefaultTimeout, } } // NewGetPXCClusterCredentialsParamsWithTimeout creates a new GetPXCClusterCredentialsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPXCClusterCredentialsParamsWithTimeout(timeout time.Duration) *GetPXCClusterCredentialsParams { - var () return &GetPXCClusterCredentialsParams{ - timeout: timeout, } } // NewGetPXCClusterCredentialsParamsWithContext creates a new GetPXCClusterCredentialsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPXCClusterCredentialsParamsWithContext(ctx context.Context) *GetPXCClusterCredentialsParams { - var () return &GetPXCClusterCredentialsParams{ - Context: ctx, } } // NewGetPXCClusterCredentialsParamsWithHTTPClient creates a new GetPXCClusterCredentialsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPXCClusterCredentialsParamsWithHTTPClient(client *http.Client) *GetPXCClusterCredentialsParams { - var () return &GetPXCClusterCredentialsParams{ HTTPClient: client, } } -/*GetPXCClusterCredentialsParams contains all the parameters to send to the API endpoint -for the get PXC cluster credentials operation typically these are written to a http.Request +/* GetPXCClusterCredentialsParams contains all the parameters to send to the API endpoint + for the get PXC cluster credentials operation. + + Typically these are written to a http.Request. */ type GetPXCClusterCredentialsParams struct { - /*Body*/ + // Body. Body GetPXCClusterCredentialsBody timeout time.Duration @@ -68,6 +67,21 @@ type GetPXCClusterCredentialsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get PXC cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPXCClusterCredentialsParams) WithDefaults() *GetPXCClusterCredentialsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get PXC cluster credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPXCClusterCredentialsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get PXC cluster credentials params func (o *GetPXCClusterCredentialsParams) WithTimeout(timeout time.Duration) *GetPXCClusterCredentialsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *GetPXCClusterCredentialsParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_credentials_responses.go b/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_credentials_responses.go index 03d4dd1fce..2055d8952e 100644 --- a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_credentials_responses.go +++ b/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_credentials_responses.go @@ -6,6 +6,7 @@ package pxc_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetPXCClusterCredentialsOK() *GetPXCClusterCredentialsOK { return &GetPXCClusterCredentialsOK{} } -/*GetPXCClusterCredentialsOK handles this case with default header values. +/* GetPXCClusterCredentialsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetPXCClusterCredentialsOK struct { func (o *GetPXCClusterCredentialsOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PXCClusters/GetCredentials][%d] getPxcClusterCredentialsOk %+v", 200, o.Payload) } - func (o *GetPXCClusterCredentialsOK) GetPayload() *GetPXCClusterCredentialsOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetPXCClusterCredentialsDefault(code int) *GetPXCClusterCredentialsDefau } } -/*GetPXCClusterCredentialsDefault handles this case with default header values. +/* GetPXCClusterCredentialsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetPXCClusterCredentialsDefault) Code() int { func (o *GetPXCClusterCredentialsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PXCClusters/GetCredentials][%d] GetPXCClusterCredentials default %+v", o._statusCode, o.Payload) } - func (o *GetPXCClusterCredentialsDefault) GetPayload() *GetPXCClusterCredentialsDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ func (o *GetPXCClusterCredentialsBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get PXC cluster credentials body based on context it is used +func (o *GetPXCClusterCredentialsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPXCClusterCredentialsBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -167,7 +171,7 @@ type GetPXCClusterCredentialsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetPXCClusterCredentialsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get PXC cluster credentials default body @@ -185,7 +189,6 @@ func (o *GetPXCClusterCredentialsDefaultBody) Validate(formats strfmt.Registry) } func (o *GetPXCClusterCredentialsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *GetPXCClusterCredentialsDefaultBody) validateDetails(formats strfmt.Reg if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetPXCClusterCredentials default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPXCClusterCredentials default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get PXC cluster credentials default body based on the context it is used +func (o *GetPXCClusterCredentialsDefaultBody) 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 *GetPXCClusterCredentialsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetPXCClusterCredentials default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPXCClusterCredentials default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,6 +266,47 @@ func (o *GetPXCClusterCredentialsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetPXCClusterCredentialsDefaultBodyDetailsItems0 get PXC cluster credentials default body details items0 +swagger:model GetPXCClusterCredentialsDefaultBodyDetailsItems0 +*/ +type GetPXCClusterCredentialsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this get PXC cluster credentials default body details items0 +func (o *GetPXCClusterCredentialsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC cluster credentials default body details items0 based on context it is used +func (o *GetPXCClusterCredentialsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCClusterCredentialsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCClusterCredentialsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res GetPXCClusterCredentialsDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*GetPXCClusterCredentialsOKBody get PXC cluster credentials OK body swagger:model GetPXCClusterCredentialsOKBody */ @@ -251,7 +331,6 @@ func (o *GetPXCClusterCredentialsOKBody) Validate(formats strfmt.Registry) error } func (o *GetPXCClusterCredentialsOKBody) validateConnectionCredentials(formats strfmt.Registry) error { - if swag.IsZero(o.ConnectionCredentials) { // not required return nil } @@ -260,6 +339,38 @@ func (o *GetPXCClusterCredentialsOKBody) validateConnectionCredentials(formats s if err := o.ConnectionCredentials.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getPxcClusterCredentialsOk" + "." + "connection_credentials") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPxcClusterCredentialsOk" + "." + "connection_credentials") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PXC cluster credentials OK body based on the context it is used +func (o *GetPXCClusterCredentialsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateConnectionCredentials(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCClusterCredentialsOKBody) contextValidateConnectionCredentials(ctx context.Context, formats strfmt.Registry) error { + + if o.ConnectionCredentials != nil { + if err := o.ConnectionCredentials.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getPxcClusterCredentialsOk" + "." + "connection_credentials") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPxcClusterCredentialsOk" + "." + "connection_credentials") } return err } @@ -309,6 +420,11 @@ func (o *GetPXCClusterCredentialsOKBodyConnectionCredentials) Validate(formats s return nil } +// ContextValidate validates this get PXC cluster credentials OK body connection credentials based on context it is used +func (o *GetPXCClusterCredentialsOKBodyConnectionCredentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPXCClusterCredentialsOKBodyConnectionCredentials) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_resources_parameters.go b/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_resources_parameters.go index 9646dfe878..188d479bd3 100644 --- a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_resources_parameters.go +++ b/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_resources_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetPXCClusterResourcesParams creates a new GetPXCClusterResourcesParams object -// with the default values initialized. +// NewGetPXCClusterResourcesParams creates a new GetPXCClusterResourcesParams 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 NewGetPXCClusterResourcesParams() *GetPXCClusterResourcesParams { - var () return &GetPXCClusterResourcesParams{ - timeout: cr.DefaultTimeout, } } // NewGetPXCClusterResourcesParamsWithTimeout creates a new GetPXCClusterResourcesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetPXCClusterResourcesParamsWithTimeout(timeout time.Duration) *GetPXCClusterResourcesParams { - var () return &GetPXCClusterResourcesParams{ - timeout: timeout, } } // NewGetPXCClusterResourcesParamsWithContext creates a new GetPXCClusterResourcesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetPXCClusterResourcesParamsWithContext(ctx context.Context) *GetPXCClusterResourcesParams { - var () return &GetPXCClusterResourcesParams{ - Context: ctx, } } // NewGetPXCClusterResourcesParamsWithHTTPClient creates a new GetPXCClusterResourcesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetPXCClusterResourcesParamsWithHTTPClient(client *http.Client) *GetPXCClusterResourcesParams { - var () return &GetPXCClusterResourcesParams{ HTTPClient: client, } } -/*GetPXCClusterResourcesParams contains all the parameters to send to the API endpoint -for the get PXC cluster resources operation typically these are written to a http.Request +/* GetPXCClusterResourcesParams contains all the parameters to send to the API endpoint + for the get PXC cluster resources operation. + + Typically these are written to a http.Request. */ type GetPXCClusterResourcesParams struct { - /*Body*/ + // Body. Body GetPXCClusterResourcesBody timeout time.Duration @@ -68,6 +67,21 @@ type GetPXCClusterResourcesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get PXC cluster resources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPXCClusterResourcesParams) WithDefaults() *GetPXCClusterResourcesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get PXC cluster resources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPXCClusterResourcesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get PXC cluster resources params func (o *GetPXCClusterResourcesParams) WithTimeout(timeout time.Duration) *GetPXCClusterResourcesParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *GetPXCClusterResourcesParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_resources_responses.go b/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_resources_responses.go index c493229a65..814ee52a42 100644 --- a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_resources_responses.go +++ b/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_resources_responses.go @@ -6,6 +6,7 @@ package pxc_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetPXCClusterResourcesOK() *GetPXCClusterResourcesOK { return &GetPXCClusterResourcesOK{} } -/*GetPXCClusterResourcesOK handles this case with default header values. +/* GetPXCClusterResourcesOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetPXCClusterResourcesOK struct { func (o *GetPXCClusterResourcesOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PXCCluster/Resources/Get][%d] getPxcClusterResourcesOk %+v", 200, o.Payload) } - func (o *GetPXCClusterResourcesOK) GetPayload() *GetPXCClusterResourcesOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetPXCClusterResourcesDefault(code int) *GetPXCClusterResourcesDefault { } } -/*GetPXCClusterResourcesDefault handles this case with default header values. +/* GetPXCClusterResourcesDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetPXCClusterResourcesDefault) Code() int { func (o *GetPXCClusterResourcesDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PXCCluster/Resources/Get][%d] GetPXCClusterResources default %+v", o._statusCode, o.Payload) } - func (o *GetPXCClusterResourcesDefault) GetPayload() *GetPXCClusterResourcesDefaultBody { return o.Payload } @@ -141,7 +140,6 @@ func (o *GetPXCClusterResourcesBody) Validate(formats strfmt.Registry) error { } func (o *GetPXCClusterResourcesBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required return nil } @@ -150,6 +148,38 @@ func (o *GetPXCClusterResourcesBody) validateParams(formats strfmt.Registry) err if err := o.Params.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PXC cluster resources body based on the context it is used +func (o *GetPXCClusterResourcesBody) 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 *GetPXCClusterResourcesBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { + + if o.Params != nil { + if err := o.Params.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") } return err } @@ -191,7 +221,7 @@ type GetPXCClusterResourcesDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetPXCClusterResourcesDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get PXC cluster resources default body @@ -209,7 +239,6 @@ func (o *GetPXCClusterResourcesDefaultBody) Validate(formats strfmt.Registry) er } func (o *GetPXCClusterResourcesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -223,6 +252,42 @@ func (o *GetPXCClusterResourcesDefaultBody) validateDetails(formats strfmt.Regis if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetPXCClusterResources default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPXCClusterResources default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get PXC cluster resources default body based on the context it is used +func (o *GetPXCClusterResourcesDefaultBody) 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 *GetPXCClusterResourcesDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetPXCClusterResources default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetPXCClusterResources default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -251,6 +316,47 @@ func (o *GetPXCClusterResourcesDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetPXCClusterResourcesDefaultBodyDetailsItems0 get PXC cluster resources default body details items0 +swagger:model GetPXCClusterResourcesDefaultBodyDetailsItems0 +*/ +type GetPXCClusterResourcesDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this get PXC cluster resources default body details items0 +func (o *GetPXCClusterResourcesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get PXC cluster resources default body details items0 based on context it is used +func (o *GetPXCClusterResourcesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetPXCClusterResourcesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetPXCClusterResourcesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res GetPXCClusterResourcesDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*GetPXCClusterResourcesOKBody get PXC cluster resources OK body swagger:model GetPXCClusterResourcesOKBody */ @@ -275,7 +381,6 @@ func (o *GetPXCClusterResourcesOKBody) Validate(formats strfmt.Registry) error { } func (o *GetPXCClusterResourcesOKBody) validateExpected(formats strfmt.Registry) error { - if swag.IsZero(o.Expected) { // not required return nil } @@ -284,6 +389,38 @@ func (o *GetPXCClusterResourcesOKBody) validateExpected(formats strfmt.Registry) if err := o.Expected.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getPxcClusterResourcesOk" + "." + "expected") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPxcClusterResourcesOk" + "." + "expected") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PXC cluster resources OK body based on the context it is used +func (o *GetPXCClusterResourcesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateExpected(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCClusterResourcesOKBody) contextValidateExpected(ctx context.Context, formats strfmt.Registry) error { + + if o.Expected != nil { + if err := o.Expected.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getPxcClusterResourcesOk" + "." + "expected") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getPxcClusterResourcesOk" + "." + "expected") } return err } @@ -331,6 +468,11 @@ func (o *GetPXCClusterResourcesOKBodyExpected) Validate(formats strfmt.Registry) return nil } +// ContextValidate validates this get PXC cluster resources OK body expected based on context it is used +func (o *GetPXCClusterResourcesOKBodyExpected) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPXCClusterResourcesOKBodyExpected) MarshalBinary() ([]byte, error) { if o == nil { @@ -390,7 +532,6 @@ func (o *GetPXCClusterResourcesParamsBodyParams) Validate(formats strfmt.Registr } func (o *GetPXCClusterResourcesParamsBodyParams) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required return nil } @@ -399,6 +540,8 @@ func (o *GetPXCClusterResourcesParamsBodyParams) validateHaproxy(formats strfmt. if err := o.Haproxy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy") } return err } @@ -408,7 +551,6 @@ func (o *GetPXCClusterResourcesParamsBodyParams) validateHaproxy(formats strfmt. } func (o *GetPXCClusterResourcesParamsBodyParams) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required return nil } @@ -417,6 +559,8 @@ func (o *GetPXCClusterResourcesParamsBodyParams) validateProxysql(formats strfmt if err := o.Proxysql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql") } return err } @@ -426,7 +570,6 @@ func (o *GetPXCClusterResourcesParamsBodyParams) validateProxysql(formats strfmt } func (o *GetPXCClusterResourcesParamsBodyParams) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required return nil } @@ -435,6 +578,78 @@ func (o *GetPXCClusterResourcesParamsBodyParams) validatePXC(formats strfmt.Regi if err := o.PXC.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PXC cluster resources params body params based on the context it is used +func (o *GetPXCClusterResourcesParamsBodyParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHaproxy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateProxysql(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePXC(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCClusterResourcesParamsBodyParams) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { + + if o.Haproxy != nil { + if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy") + } + return err + } + } + + return nil +} + +func (o *GetPXCClusterResourcesParamsBodyParams) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { + + if o.Proxysql != nil { + if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql") + } + return err + } + } + + return nil +} + +func (o *GetPXCClusterResourcesParamsBodyParams) contextValidatePXC(ctx context.Context, formats strfmt.Registry) error { + + if o.PXC != nil { + if err := o.PXC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc") } return err } @@ -489,7 +704,6 @@ func (o *GetPXCClusterResourcesParamsBodyParamsHaproxy) Validate(formats strfmt. } func (o *GetPXCClusterResourcesParamsBodyParamsHaproxy) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -498,6 +712,38 @@ func (o *GetPXCClusterResourcesParamsBodyParamsHaproxy) validateComputeResources if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PXC cluster resources params body params haproxy based on the context it is used +func (o *GetPXCClusterResourcesParamsBodyParamsHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCClusterResourcesParamsBodyParamsHaproxy) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") } return err } @@ -541,6 +787,11 @@ func (o *GetPXCClusterResourcesParamsBodyParamsHaproxyComputeResources) Validate return nil } +// ContextValidate validates this get PXC cluster resources params body params haproxy compute resources based on context it is used +func (o *GetPXCClusterResourcesParamsBodyParamsHaproxyComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPXCClusterResourcesParamsBodyParamsHaproxyComputeResources) MarshalBinary() ([]byte, error) { if o == nil { @@ -590,7 +841,6 @@ func (o *GetPXCClusterResourcesParamsBodyParamsPXC) Validate(formats strfmt.Regi } func (o *GetPXCClusterResourcesParamsBodyParamsPXC) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -599,6 +849,38 @@ func (o *GetPXCClusterResourcesParamsBodyParamsPXC) validateComputeResources(for if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PXC cluster resources params body params PXC based on the context it is used +func (o *GetPXCClusterResourcesParamsBodyParamsPXC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCClusterResourcesParamsBodyParamsPXC) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") } return err } @@ -642,6 +924,11 @@ func (o *GetPXCClusterResourcesParamsBodyParamsPXCComputeResources) Validate(for return nil } +// ContextValidate validates this get PXC cluster resources params body params PXC compute resources based on context it is used +func (o *GetPXCClusterResourcesParamsBodyParamsPXCComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPXCClusterResourcesParamsBodyParamsPXCComputeResources) MarshalBinary() ([]byte, error) { if o == nil { @@ -691,7 +978,6 @@ func (o *GetPXCClusterResourcesParamsBodyParamsProxysql) Validate(formats strfmt } func (o *GetPXCClusterResourcesParamsBodyParamsProxysql) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -700,6 +986,38 @@ func (o *GetPXCClusterResourcesParamsBodyParamsProxysql) validateComputeResource if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get PXC cluster resources params body params proxysql based on the context it is used +func (o *GetPXCClusterResourcesParamsBodyParamsProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetPXCClusterResourcesParamsBodyParamsProxysql) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") } return err } @@ -743,6 +1061,11 @@ func (o *GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources) Validat return nil } +// ContextValidate validates this get PXC cluster resources params body params proxysql compute resources based on context it is used +func (o *GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/client/pxc_clusters/pxc_clusters_client.go b/api/managementpb/dbaas/json/client/pxc_clusters/pxc_clusters_client.go index 5a4d6a5f73..e7214edfe4 100644 --- a/api/managementpb/dbaas/json/client/pxc_clusters/pxc_clusters_client.go +++ b/api/managementpb/dbaas/json/client/pxc_clusters/pxc_clusters_client.go @@ -23,15 +23,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreatePXCCluster(params *CreatePXCClusterParams) (*CreatePXCClusterOK, error) + CreatePXCCluster(params *CreatePXCClusterParams, opts ...ClientOption) (*CreatePXCClusterOK, error) - GetPXCClusterCredentials(params *GetPXCClusterCredentialsParams) (*GetPXCClusterCredentialsOK, error) + GetPXCClusterCredentials(params *GetPXCClusterCredentialsParams, opts ...ClientOption) (*GetPXCClusterCredentialsOK, error) - GetPXCClusterResources(params *GetPXCClusterResourcesParams) (*GetPXCClusterResourcesOK, error) + GetPXCClusterResources(params *GetPXCClusterResourcesParams, opts ...ClientOption) (*GetPXCClusterResourcesOK, error) - UpdatePXCCluster(params *UpdatePXCClusterParams) (*UpdatePXCClusterOK, error) + UpdatePXCCluster(params *UpdatePXCClusterParams, opts ...ClientOption) (*UpdatePXCClusterOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { /* CreatePXCCluster creates PXC cluster creates a new PXC cluster */ -func (a *Client) CreatePXCCluster(params *CreatePXCClusterParams) (*CreatePXCClusterOK, error) { +func (a *Client) CreatePXCCluster(params *CreatePXCClusterParams, opts ...ClientOption) (*CreatePXCClusterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCreatePXCClusterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "CreatePXCCluster", Method: "POST", PathPattern: "/v1/management/DBaaS/PXCCluster/Create", @@ -56,7 +58,12 @@ func (a *Client) CreatePXCCluster(params *CreatePXCClusterParams) (*CreatePXCClu Reader: &CreatePXCClusterReader{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 } @@ -72,13 +79,12 @@ func (a *Client) CreatePXCCluster(params *CreatePXCClusterParams) (*CreatePXCClu /* GetPXCClusterCredentials gets PXC cluster credentials returns a PXC cluster credentials by cluster name */ -func (a *Client) GetPXCClusterCredentials(params *GetPXCClusterCredentialsParams) (*GetPXCClusterCredentialsOK, error) { +func (a *Client) GetPXCClusterCredentials(params *GetPXCClusterCredentialsParams, opts ...ClientOption) (*GetPXCClusterCredentialsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPXCClusterCredentialsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetPXCClusterCredentials", Method: "POST", PathPattern: "/v1/management/DBaaS/PXCClusters/GetCredentials", @@ -89,7 +95,12 @@ func (a *Client) GetPXCClusterCredentials(params *GetPXCClusterCredentialsParams Reader: &GetPXCClusterCredentialsReader{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 } @@ -105,13 +116,12 @@ func (a *Client) GetPXCClusterCredentials(params *GetPXCClusterCredentialsParams /* GetPXCClusterResources gets PXC cluster resources returns expected resources to be consumed by the cluster */ -func (a *Client) GetPXCClusterResources(params *GetPXCClusterResourcesParams) (*GetPXCClusterResourcesOK, error) { +func (a *Client) GetPXCClusterResources(params *GetPXCClusterResourcesParams, opts ...ClientOption) (*GetPXCClusterResourcesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetPXCClusterResourcesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetPXCClusterResources", Method: "POST", PathPattern: "/v1/management/DBaaS/PXCCluster/Resources/Get", @@ -122,7 +132,12 @@ func (a *Client) GetPXCClusterResources(params *GetPXCClusterResourcesParams) (* Reader: &GetPXCClusterResourcesReader{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 } @@ -138,13 +153,12 @@ func (a *Client) GetPXCClusterResources(params *GetPXCClusterResourcesParams) (* /* UpdatePXCCluster updates PXC cluster updates existing PXC cluster */ -func (a *Client) UpdatePXCCluster(params *UpdatePXCClusterParams) (*UpdatePXCClusterOK, error) { +func (a *Client) UpdatePXCCluster(params *UpdatePXCClusterParams, opts ...ClientOption) (*UpdatePXCClusterOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdatePXCClusterParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "UpdatePXCCluster", Method: "POST", PathPattern: "/v1/management/DBaaS/PXCCluster/Update", @@ -155,7 +169,12 @@ func (a *Client) UpdatePXCCluster(params *UpdatePXCClusterParams) (*UpdatePXCClu Reader: &UpdatePXCClusterReader{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 } diff --git a/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_parameters.go b/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_parameters.go index 845fc6307b..e2a95be9f0 100644 --- a/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_parameters.go +++ b/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUpdatePXCClusterParams creates a new UpdatePXCClusterParams object -// with the default values initialized. +// NewUpdatePXCClusterParams creates a new UpdatePXCClusterParams 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 NewUpdatePXCClusterParams() *UpdatePXCClusterParams { - var () return &UpdatePXCClusterParams{ - timeout: cr.DefaultTimeout, } } // NewUpdatePXCClusterParamsWithTimeout creates a new UpdatePXCClusterParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdatePXCClusterParamsWithTimeout(timeout time.Duration) *UpdatePXCClusterParams { - var () return &UpdatePXCClusterParams{ - timeout: timeout, } } // NewUpdatePXCClusterParamsWithContext creates a new UpdatePXCClusterParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdatePXCClusterParamsWithContext(ctx context.Context) *UpdatePXCClusterParams { - var () return &UpdatePXCClusterParams{ - Context: ctx, } } // NewUpdatePXCClusterParamsWithHTTPClient creates a new UpdatePXCClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdatePXCClusterParamsWithHTTPClient(client *http.Client) *UpdatePXCClusterParams { - var () return &UpdatePXCClusterParams{ HTTPClient: client, } } -/*UpdatePXCClusterParams contains all the parameters to send to the API endpoint -for the update PXC cluster operation typically these are written to a http.Request +/* UpdatePXCClusterParams contains all the parameters to send to the API endpoint + for the update PXC cluster operation. + + Typically these are written to a http.Request. */ type UpdatePXCClusterParams struct { - /*Body*/ + // Body. Body UpdatePXCClusterBody timeout time.Duration @@ -68,6 +67,21 @@ type UpdatePXCClusterParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update PXC cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePXCClusterParams) WithDefaults() *UpdatePXCClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update PXC cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePXCClusterParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update PXC cluster params func (o *UpdatePXCClusterParams) WithTimeout(timeout time.Duration) *UpdatePXCClusterParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *UpdatePXCClusterParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_responses.go b/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_responses.go index e6871d3dd1..8394dd125c 100644 --- a/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_responses.go +++ b/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_responses.go @@ -6,6 +6,7 @@ package pxc_clusters // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewUpdatePXCClusterOK() *UpdatePXCClusterOK { return &UpdatePXCClusterOK{} } -/*UpdatePXCClusterOK handles this case with default header values. +/* UpdatePXCClusterOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type UpdatePXCClusterOK struct { func (o *UpdatePXCClusterOK) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PXCCluster/Update][%d] updatePxcClusterOk %+v", 200, o.Payload) } - func (o *UpdatePXCClusterOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewUpdatePXCClusterDefault(code int) *UpdatePXCClusterDefault { } } -/*UpdatePXCClusterDefault handles this case with default header values. +/* UpdatePXCClusterDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *UpdatePXCClusterDefault) Code() int { func (o *UpdatePXCClusterDefault) Error() string { return fmt.Sprintf("[POST /v1/management/DBaaS/PXCCluster/Update][%d] UpdatePXCCluster default %+v", o._statusCode, o.Payload) } - func (o *UpdatePXCClusterDefault) GetPayload() *UpdatePXCClusterDefaultBody { return o.Payload } @@ -145,7 +144,6 @@ func (o *UpdatePXCClusterBody) Validate(formats strfmt.Registry) error { } func (o *UpdatePXCClusterBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required return nil } @@ -154,6 +152,38 @@ func (o *UpdatePXCClusterBody) validateParams(formats strfmt.Registry) error { if err := o.Params.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update PXC cluster body based on the context it is used +func (o *UpdatePXCClusterBody) 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 *UpdatePXCClusterBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { + + if o.Params != nil { + if err := o.Params.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params") } return err } @@ -195,7 +225,7 @@ type UpdatePXCClusterDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*UpdatePXCClusterDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this update PXC cluster default body @@ -213,7 +243,6 @@ func (o *UpdatePXCClusterDefaultBody) Validate(formats strfmt.Registry) error { } func (o *UpdatePXCClusterDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -227,6 +256,42 @@ func (o *UpdatePXCClusterDefaultBody) validateDetails(formats strfmt.Registry) e if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("UpdatePXCCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UpdatePXCCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update PXC cluster default body based on the context it is used +func (o *UpdatePXCClusterDefaultBody) 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 *UpdatePXCClusterDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UpdatePXCCluster default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UpdatePXCCluster default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -255,6 +320,47 @@ func (o *UpdatePXCClusterDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*UpdatePXCClusterDefaultBodyDetailsItems0 update PXC cluster default body details items0 +swagger:model UpdatePXCClusterDefaultBodyDetailsItems0 +*/ +type UpdatePXCClusterDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this update PXC cluster default body details items0 +func (o *UpdatePXCClusterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update PXC cluster default body details items0 based on context it is used +func (o *UpdatePXCClusterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UpdatePXCClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UpdatePXCClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res UpdatePXCClusterDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*UpdatePXCClusterParamsBodyParams UpdatePXCClusterParams represents PXC cluster parameters that can be updated. swagger:model UpdatePXCClusterParamsBodyParams */ @@ -302,7 +408,6 @@ func (o *UpdatePXCClusterParamsBodyParams) Validate(formats strfmt.Registry) err } func (o *UpdatePXCClusterParamsBodyParams) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required return nil } @@ -311,6 +416,8 @@ func (o *UpdatePXCClusterParamsBodyParams) validateHaproxy(formats strfmt.Regist if err := o.Haproxy.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy") } return err } @@ -320,7 +427,6 @@ func (o *UpdatePXCClusterParamsBodyParams) validateHaproxy(formats strfmt.Regist } func (o *UpdatePXCClusterParamsBodyParams) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required return nil } @@ -329,6 +435,8 @@ func (o *UpdatePXCClusterParamsBodyParams) validateProxysql(formats strfmt.Regis if err := o.Proxysql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql") } return err } @@ -338,7 +446,6 @@ func (o *UpdatePXCClusterParamsBodyParams) validateProxysql(formats strfmt.Regis } func (o *UpdatePXCClusterParamsBodyParams) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required return nil } @@ -347,6 +454,78 @@ func (o *UpdatePXCClusterParamsBodyParams) validatePXC(formats strfmt.Registry) if err := o.PXC.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update PXC cluster params body params based on the context it is used +func (o *UpdatePXCClusterParamsBodyParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHaproxy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateProxysql(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePXC(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *UpdatePXCClusterParamsBodyParams) contextValidateHaproxy(ctx context.Context, formats strfmt.Registry) error { + + if o.Haproxy != nil { + if err := o.Haproxy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "haproxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy") + } + return err + } + } + + return nil +} + +func (o *UpdatePXCClusterParamsBodyParams) contextValidateProxysql(ctx context.Context, formats strfmt.Registry) error { + + if o.Proxysql != nil { + if err := o.Proxysql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "proxysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql") + } + return err + } + } + + return nil +} + +func (o *UpdatePXCClusterParamsBodyParams) contextValidatePXC(ctx context.Context, formats strfmt.Registry) error { + + if o.PXC != nil { + if err := o.PXC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "pxc") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc") } return err } @@ -397,7 +576,6 @@ func (o *UpdatePXCClusterParamsBodyParamsHaproxy) Validate(formats strfmt.Regist } func (o *UpdatePXCClusterParamsBodyParamsHaproxy) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -406,6 +584,38 @@ func (o *UpdatePXCClusterParamsBodyParamsHaproxy) validateComputeResources(forma if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update PXC cluster params body params haproxy based on the context it is used +func (o *UpdatePXCClusterParamsBodyParamsHaproxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *UpdatePXCClusterParamsBodyParamsHaproxy) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "haproxy" + "." + "compute_resources") } return err } @@ -449,6 +659,11 @@ func (o *UpdatePXCClusterParamsBodyParamsHaproxyComputeResources) Validate(forma return nil } +// ContextValidate validates this update PXC cluster params body params haproxy compute resources based on context it is used +func (o *UpdatePXCClusterParamsBodyParamsHaproxyComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *UpdatePXCClusterParamsBodyParamsHaproxyComputeResources) MarshalBinary() ([]byte, error) { if o == nil { @@ -495,7 +710,6 @@ func (o *UpdatePXCClusterParamsBodyParamsPXC) Validate(formats strfmt.Registry) } func (o *UpdatePXCClusterParamsBodyParamsPXC) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -504,6 +718,38 @@ func (o *UpdatePXCClusterParamsBodyParamsPXC) validateComputeResources(formats s if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update PXC cluster params body params PXC based on the context it is used +func (o *UpdatePXCClusterParamsBodyParamsPXC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *UpdatePXCClusterParamsBodyParamsPXC) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "pxc" + "." + "compute_resources") } return err } @@ -547,6 +793,11 @@ func (o *UpdatePXCClusterParamsBodyParamsPXCComputeResources) Validate(formats s return nil } +// ContextValidate validates this update PXC cluster params body params PXC compute resources based on context it is used +func (o *UpdatePXCClusterParamsBodyParamsPXCComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *UpdatePXCClusterParamsBodyParamsPXCComputeResources) MarshalBinary() ([]byte, error) { if o == nil { @@ -589,7 +840,6 @@ func (o *UpdatePXCClusterParamsBodyParamsProxysql) Validate(formats strfmt.Regis } func (o *UpdatePXCClusterParamsBodyParamsProxysql) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required return nil } @@ -598,6 +848,38 @@ func (o *UpdatePXCClusterParamsBodyParamsProxysql) validateComputeResources(form if err := o.ComputeResources.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update PXC cluster params body params proxysql based on the context it is used +func (o *UpdatePXCClusterParamsBodyParamsProxysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateComputeResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *UpdatePXCClusterParamsBodyParamsProxysql) contextValidateComputeResources(ctx context.Context, formats strfmt.Registry) error { + + if o.ComputeResources != nil { + if err := o.ComputeResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + "proxysql" + "." + "compute_resources") } return err } @@ -641,6 +923,11 @@ func (o *UpdatePXCClusterParamsBodyParamsProxysqlComputeResources) Validate(form return nil } +// ContextValidate validates this update PXC cluster params body params proxysql compute resources based on context it is used +func (o *UpdatePXCClusterParamsBodyParamsProxysqlComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *UpdatePXCClusterParamsBodyParamsProxysqlComputeResources) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/dbaas/json/dbaas.json b/api/managementpb/dbaas/json/dbaas.json index b2d3677e06..e2270bacc2 100644 --- a/api/managementpb/dbaas/json/dbaas.json +++ b/api/managementpb/dbaas/json/dbaas.json @@ -65,8 +65,7 @@ }, "x-order": 1 } - }, - "x-order": 1 + } } } } @@ -166,8 +165,7 @@ }, "x-order": 1 } - }, - "x-order": 3 + } }, "kubernetes_cluster_name": { "description": "Kubernetes cluster name.", @@ -204,8 +202,7 @@ }, "x-order": 1 } - }, - "x-order": 2 + } }, "pxc": { "description": "ChangeComponent contains fields to manage components.", @@ -237,8 +234,7 @@ }, "x-order": 1 } - }, - "x-order": 1 + } } } } @@ -704,8 +700,7 @@ }, "x-order": 1 } - }, - "x-order": 2 + } }, "operator": { "type": "string", @@ -1081,8 +1076,7 @@ }, "x-order": 1 } - }, - "x-order": 2 + } }, "operator": { "type": "string", @@ -1190,8 +1184,7 @@ "OPERATORS_STATUS_OK", "OPERATORS_STATUS_UNSUPPORTED", "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 + ] } } } @@ -1261,8 +1254,7 @@ "DB_CLUSTER_TYPE_INVALID", "DB_CLUSTER_TYPE_PXC", "DB_CLUSTER_TYPE_PSMDB" - ], - "x-order": 2 + ] }, "kubernetes_cluster_name": { "description": "Kubernetes cluster name.", @@ -1405,8 +1397,7 @@ "format": "int32", "x-order": 2 } - }, - "x-order": 2 + } }, "params": { "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", @@ -1443,8 +1434,7 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 0 + } }, "disk_size": { "description": "Disk size in bytes.", @@ -1452,11 +1442,9 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } } - }, - "x-order": 3 + } }, "state": { "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", @@ -1470,8 +1458,7 @@ "DB_CLUSTER_STATE_DELETING", "DB_CLUSTER_STATE_PAUSED", "DB_CLUSTER_STATE_UPGRADING" - ], - "x-order": 1 + ] } } }, @@ -1525,8 +1512,7 @@ "format": "int32", "x-order": 2 } - }, - "x-order": 2 + } }, "params": { "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", @@ -1558,16 +1544,14 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } }, "image": { "description": "Docker image used for HAProxy.", "type": "string", "x-order": 0 } - }, - "x-order": 3 + } }, "proxysql": { "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", @@ -1589,8 +1573,7 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } }, "disk_size": { "description": "Disk size in bytes.", @@ -1603,8 +1586,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 2 + } }, "pxc": { "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", @@ -1626,8 +1608,7 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } }, "disk_size": { "description": "Disk size in bytes.", @@ -1640,11 +1621,9 @@ "type": "string", "x-order": 0 } - }, - "x-order": 1 + } } - }, - "x-order": 3 + } }, "state": { "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", @@ -1658,8 +1637,7 @@ "DB_CLUSTER_STATE_DELETING", "DB_CLUSTER_STATE_PAUSED", "DB_CLUSTER_STATE_UPGRADING" - ], - "x-order": 1 + ] } } }, @@ -1733,8 +1711,7 @@ "DB_CLUSTER_TYPE_INVALID", "DB_CLUSTER_TYPE_PXC", "DB_CLUSTER_TYPE_PSMDB" - ], - "x-order": 2 + ] }, "kubernetes_cluster_name": { "description": "Kubernetes cluster name.", @@ -1947,8 +1924,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 0 + } } } } @@ -2047,15 +2023,13 @@ "OPERATORS_STATUS_OK", "OPERATORS_STATUS_UNSUPPORTED", "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 + ] }, "version": { "type": "string", "x-order": 1 } - }, - "x-order": 1 + } }, "pxc": { "description": "Operator contains all information about operator installed in Kubernetes cluster.", @@ -2070,18 +2044,15 @@ "OPERATORS_STATUS_OK", "OPERATORS_STATUS_UNSUPPORTED", "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 + ] }, "version": { "type": "string", "x-order": 1 } - }, - "x-order": 0 + } } - }, - "x-order": 1 + } }, "status": { "description": "KubernetesClusterStatus defines status of Kubernetes cluster.\n\n - KUBERNETES_CLUSTER_STATUS_INVALID: KUBERNETES_CLUSTER_STATUS_INVALID represents unknown state.\n - KUBERNETES_CLUSTER_STATUS_OK: KUBERNETES_CLUSTER_STATUS_OK represents that Kubernetes cluster is accessible.\n - KUBERNETES_CLUSTER_STATUS_UNAVAILABLE: KUBERNETES_CLUSTER_STATUS_UNAVAILABLE represents that Kubernetes cluster is not accessible.", @@ -2091,8 +2062,7 @@ "KUBERNETES_CLUSTER_STATUS_INVALID", "KUBERNETES_CLUSTER_STATUS_OK", "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" - ], - "x-order": 2 + ] } } }, @@ -2177,8 +2147,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 1 + } }, "kubernetes_cluster_name": { "description": "Kubernetes cluster name.", @@ -2290,8 +2259,7 @@ "format": "uint64", "x-order": 0 } - }, - "x-order": 0 + } }, "available": { "description": "Resources contains Kubernetes cluster resources.", @@ -2315,8 +2283,7 @@ "format": "uint64", "x-order": 0 } - }, - "x-order": 1 + } } } } @@ -2506,8 +2473,7 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 0 + } }, "disk_size": { "description": "Disk size in bytes.", @@ -2515,11 +2481,9 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } } - }, - "x-order": 2 + } } } } @@ -2624,8 +2588,7 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 0 + } }, "disk_size": { "description": "Disk size in bytes.", @@ -2633,11 +2596,9 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } } - }, - "x-order": 0 + } } } } @@ -2671,8 +2632,7 @@ "format": "uint64", "x-order": 0 } - }, - "x-order": 0 + } } } } @@ -2779,11 +2739,9 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 0 + } } - }, - "x-order": 1 + } }, "resume": { "description": "Resume cluster `pause: false`.", @@ -2795,8 +2753,7 @@ "type": "boolean", "x-order": 2 } - }, - "x-order": 2 + } } } } @@ -2916,8 +2873,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 0 + } } } } @@ -3024,16 +2980,14 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } }, "image": { "description": "Docker image used for HAProxy.", "type": "string", "x-order": 0 } - }, - "x-order": 3 + } }, "proxysql": { "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", @@ -3055,8 +3009,7 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } }, "disk_size": { "description": "Disk size in bytes.", @@ -3069,8 +3022,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 2 + } }, "pxc": { "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", @@ -3092,8 +3044,7 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } }, "disk_size": { "description": "Disk size in bytes.", @@ -3106,11 +3057,9 @@ "type": "string", "x-order": 0 } - }, - "x-order": 1 + } } - }, - "x-order": 2 + } } } } @@ -3210,16 +3159,14 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } }, "image": { "description": "Docker image used for HAProxy.", "type": "string", "x-order": 0 } - }, - "x-order": 3 + } }, "proxysql": { "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", @@ -3241,8 +3188,7 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } }, "disk_size": { "description": "Disk size in bytes.", @@ -3255,8 +3201,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 2 + } }, "pxc": { "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", @@ -3278,8 +3223,7 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 1 + } }, "disk_size": { "description": "Disk size in bytes.", @@ -3292,11 +3236,9 @@ "type": "string", "x-order": 0 } - }, - "x-order": 1 + } } - }, - "x-order": 0 + } } } } @@ -3330,8 +3272,7 @@ "format": "uint64", "x-order": 0 } - }, - "x-order": 0 + } } } } @@ -3433,11 +3374,9 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 0 + } } - }, - "x-order": 5 + } }, "proxysql": { "description": "ProxySQL container parameters.", @@ -3459,11 +3398,9 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 0 + } } - }, - "x-order": 2 + } }, "pxc": { "description": "PXC container parameters.", @@ -3485,16 +3422,14 @@ "format": "int64", "x-order": 1 } - }, - "x-order": 0 + } }, "image": { "description": "Image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", "type": "string", "x-order": 1 } - }, - "x-order": 1 + } }, "resume": { "description": "Resume cluster `pause: false`.", @@ -3506,8 +3441,7 @@ "type": "boolean", "x-order": 3 } - }, - "x-order": 2 + } } } } @@ -3622,8 +3556,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 0 + } } } } diff --git a/api/managementpb/dbaas/kubernetes.pb.go b/api/managementpb/dbaas/kubernetes.pb.go index 826622ba3c..bcc554657f 100644 --- a/api/managementpb/dbaas/kubernetes.pb.go +++ b/api/managementpb/dbaas/kubernetes.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/dbaas/kubernetes.proto diff --git a/api/managementpb/dbaas/logs.pb.go b/api/managementpb/dbaas/logs.pb.go index f4f5c7460e..9dd001ee37 100644 --- a/api/managementpb/dbaas/logs.pb.go +++ b/api/managementpb/dbaas/logs.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/dbaas/logs.proto diff --git a/api/managementpb/dbaas/psmdb_clusters.pb.go b/api/managementpb/dbaas/psmdb_clusters.pb.go index 519d343159..7279023733 100644 --- a/api/managementpb/dbaas/psmdb_clusters.pb.go +++ b/api/managementpb/dbaas/psmdb_clusters.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/dbaas/psmdb_clusters.proto diff --git a/api/managementpb/dbaas/pxc_clusters.pb.go b/api/managementpb/dbaas/pxc_clusters.pb.go index 6822f134da..bb8b25901c 100644 --- a/api/managementpb/dbaas/pxc_clusters.pb.go +++ b/api/managementpb/dbaas/pxc_clusters.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/dbaas/pxc_clusters.proto diff --git a/api/managementpb/external.pb.go b/api/managementpb/external.pb.go index cdc921b45a..bc025865df 100644 --- a/api/managementpb/external.pb.go +++ b/api/managementpb/external.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/external.proto diff --git a/api/managementpb/haproxy.pb.go b/api/managementpb/haproxy.pb.go index de8a19d240..110d127bfd 100644 --- a/api/managementpb/haproxy.pb.go +++ b/api/managementpb/haproxy.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/haproxy.proto diff --git a/api/managementpb/ia/alerts.pb.go b/api/managementpb/ia/alerts.pb.go index 292fc57f2b..478bb5122d 100644 --- a/api/managementpb/ia/alerts.pb.go +++ b/api/managementpb/ia/alerts.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/ia/alerts.proto diff --git a/api/managementpb/ia/boolean_flag.pb.go b/api/managementpb/ia/boolean_flag.pb.go index ac9a79e465..f98075d890 100644 --- a/api/managementpb/ia/boolean_flag.pb.go +++ b/api/managementpb/ia/boolean_flag.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/ia/boolean_flag.proto diff --git a/api/managementpb/ia/channels.pb.go b/api/managementpb/ia/channels.pb.go index 3eaa809a28..c70385d553 100644 --- a/api/managementpb/ia/channels.pb.go +++ b/api/managementpb/ia/channels.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/ia/channels.proto diff --git a/api/managementpb/ia/json/client/alerts/alerts_client.go b/api/managementpb/ia/json/client/alerts/alerts_client.go index acfb55f73d..87c65c5682 100644 --- a/api/managementpb/ia/json/client/alerts/alerts_client.go +++ b/api/managementpb/ia/json/client/alerts/alerts_client.go @@ -23,11 +23,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - ListAlerts(params *ListAlertsParams) (*ListAlertsOK, error) + ListAlerts(params *ListAlertsParams, opts ...ClientOption) (*ListAlertsOK, error) - ToggleAlerts(params *ToggleAlertsParams) (*ToggleAlertsOK, error) + ToggleAlerts(params *ToggleAlertsParams, opts ...ClientOption) (*ToggleAlertsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { /* ListAlerts lists alerts returns a list of all alerts */ -func (a *Client) ListAlerts(params *ListAlertsParams) (*ListAlertsOK, error) { +func (a *Client) ListAlerts(params *ListAlertsParams, opts ...ClientOption) (*ListAlertsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListAlertsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListAlerts", Method: "POST", PathPattern: "/v1/management/ia/Alerts/List", @@ -52,7 +54,12 @@ func (a *Client) ListAlerts(params *ListAlertsParams) (*ListAlertsOK, error) { Reader: &ListAlertsReader{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 } @@ -70,13 +77,12 @@ func (a *Client) ListAlerts(params *ListAlertsParams) (*ListAlertsOK, error) { Pass empty list to apply toggle action to all existing alerts */ -func (a *Client) ToggleAlerts(params *ToggleAlertsParams) (*ToggleAlertsOK, error) { +func (a *Client) ToggleAlerts(params *ToggleAlertsParams, opts ...ClientOption) (*ToggleAlertsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewToggleAlertsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ToggleAlerts", Method: "POST", PathPattern: "/v1/management/ia/Alerts/Toggle", @@ -87,7 +93,12 @@ func (a *Client) ToggleAlerts(params *ToggleAlertsParams) (*ToggleAlertsOK, erro Reader: &ToggleAlertsReader{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 } diff --git a/api/managementpb/ia/json/client/alerts/list_alerts_parameters.go b/api/managementpb/ia/json/client/alerts/list_alerts_parameters.go index 84126bb395..b57a91b1c5 100644 --- a/api/managementpb/ia/json/client/alerts/list_alerts_parameters.go +++ b/api/managementpb/ia/json/client/alerts/list_alerts_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListAlertsParams creates a new ListAlertsParams object -// with the default values initialized. +// NewListAlertsParams creates a new ListAlertsParams 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 NewListAlertsParams() *ListAlertsParams { - var () return &ListAlertsParams{ - timeout: cr.DefaultTimeout, } } // NewListAlertsParamsWithTimeout creates a new ListAlertsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListAlertsParamsWithTimeout(timeout time.Duration) *ListAlertsParams { - var () return &ListAlertsParams{ - timeout: timeout, } } // NewListAlertsParamsWithContext creates a new ListAlertsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListAlertsParamsWithContext(ctx context.Context) *ListAlertsParams { - var () return &ListAlertsParams{ - Context: ctx, } } // NewListAlertsParamsWithHTTPClient creates a new ListAlertsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListAlertsParamsWithHTTPClient(client *http.Client) *ListAlertsParams { - var () return &ListAlertsParams{ HTTPClient: client, } } -/*ListAlertsParams contains all the parameters to send to the API endpoint -for the list alerts operation typically these are written to a http.Request +/* ListAlertsParams contains all the parameters to send to the API endpoint + for the list alerts operation. + + Typically these are written to a http.Request. */ type ListAlertsParams struct { - /*Body*/ + // Body. Body ListAlertsBody timeout time.Duration @@ -68,6 +67,21 @@ type ListAlertsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAlertsParams) WithDefaults() *ListAlertsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAlertsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list alerts params func (o *ListAlertsParams) WithTimeout(timeout time.Duration) *ListAlertsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ListAlertsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/alerts/list_alerts_responses.go b/api/managementpb/ia/json/client/alerts/list_alerts_responses.go index 75f3d8a156..85d3197845 100644 --- a/api/managementpb/ia/json/client/alerts/list_alerts_responses.go +++ b/api/managementpb/ia/json/client/alerts/list_alerts_responses.go @@ -6,6 +6,7 @@ package alerts // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListAlertsOK() *ListAlertsOK { return &ListAlertsOK{} } -/*ListAlertsOK handles this case with default header values. +/* ListAlertsOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,69 +61,455 @@ type ListAlertsOK struct { func (o *ListAlertsOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Alerts/List][%d] listAlertsOk %+v", 200, o.Payload) } +func (o *ListAlertsOK) GetPayload() *ListAlertsOKBody { + return o.Payload +} + +func (o *ListAlertsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ListAlertsOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListAlertsDefault creates a ListAlertsDefault with default headers values +func NewListAlertsDefault(code int) *ListAlertsDefault { + return &ListAlertsDefault{ + _statusCode: code, + } +} + +/* ListAlertsDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type ListAlertsDefault struct { + _statusCode int + + Payload *ListAlertsDefaultBody +} + +// Code gets the status code for the list alerts default response +func (o *ListAlertsDefault) Code() int { + return o._statusCode +} + +func (o *ListAlertsDefault) Error() string { + return fmt.Sprintf("[POST /v1/management/ia/Alerts/List][%d] ListAlerts default %+v", o._statusCode, o.Payload) +} +func (o *ListAlertsDefault) GetPayload() *ListAlertsDefaultBody { + return o.Payload +} + +func (o *ListAlertsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ListAlertsDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*ListAlertsBody list alerts body +swagger:model ListAlertsBody +*/ +type ListAlertsBody struct { + + // page params + PageParams *ListAlertsParamsBodyPageParams `json:"page_params,omitempty"` +} + +// Validate validates this list alerts body +func (o *ListAlertsBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validatePageParams(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertsBody) validatePageParams(formats strfmt.Registry) error { + if swag.IsZero(o.PageParams) { // not required + return nil + } + + if o.PageParams != nil { + if err := o.PageParams.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "page_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "page_params") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list alerts body based on the context it is used +func (o *ListAlertsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePageParams(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertsBody) contextValidatePageParams(ctx context.Context, formats strfmt.Registry) error { + + if o.PageParams != nil { + if err := o.PageParams.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "page_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "page_params") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ListAlertsBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListAlertsBody) UnmarshalBinary(b []byte) error { + var res ListAlertsBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListAlertsDefaultBody list alerts default body +swagger:model ListAlertsDefaultBody +*/ +type ListAlertsDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*ListAlertsDefaultBodyDetailsItems0 `json:"details"` +} + +// Validate validates this list alerts default body +func (o *ListAlertsDefaultBody) 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 *ListAlertsDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListAlerts default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListAlerts default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list alerts default body based on the context it is used +func (o *ListAlertsDefaultBody) 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 *ListAlertsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListAlerts default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListAlerts default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ListAlertsDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListAlertsDefaultBody) UnmarshalBinary(b []byte) error { + var res ListAlertsDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListAlertsDefaultBodyDetailsItems0 list alerts default body details items0 +swagger:model ListAlertsDefaultBodyDetailsItems0 +*/ +type ListAlertsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this list alerts default body details items0 +func (o *ListAlertsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alerts default body details items0 based on context it is used +func (o *ListAlertsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListAlertsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListAlertsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ListAlertsDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListAlertsOKBody list alerts OK body +swagger:model ListAlertsOKBody +*/ +type ListAlertsOKBody struct { + + // alerts + Alerts []*ListAlertsOKBodyAlertsItems0 `json:"alerts"` + + // totals + Totals *ListAlertsOKBodyTotals `json:"totals,omitempty"` +} + +// Validate validates this list alerts OK body +func (o *ListAlertsOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateAlerts(formats); err != nil { + res = append(res, err) + } + + if err := o.validateTotals(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertsOKBody) validateAlerts(formats strfmt.Registry) error { + if swag.IsZero(o.Alerts) { // not required + return nil + } + + for i := 0; i < len(o.Alerts); i++ { + if swag.IsZero(o.Alerts[i]) { // not required + continue + } + + if o.Alerts[i] != nil { + if err := o.Alerts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAlertsOk" + "." + "alerts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAlertsOk" + "." + "alerts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *ListAlertsOKBody) validateTotals(formats strfmt.Registry) error { + if swag.IsZero(o.Totals) { // not required + return nil + } -func (o *ListAlertsOK) GetPayload() *ListAlertsOKBody { - return o.Payload + if o.Totals != nil { + if err := o.Totals.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAlertsOk" + "." + "totals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAlertsOk" + "." + "totals") + } + return err + } + } + + return nil } -func (o *ListAlertsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +// ContextValidate validate this list alerts OK body based on the context it is used +func (o *ListAlertsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - o.Payload = new(ListAlertsOKBody) + if err := o.contextValidateAlerts(ctx, formats); err != nil { + res = append(res, err) + } - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err + if err := o.contextValidateTotals(ctx, formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } return nil } -// NewListAlertsDefault creates a ListAlertsDefault with default headers values -func NewListAlertsDefault(code int) *ListAlertsDefault { - return &ListAlertsDefault{ - _statusCode: code, - } -} +func (o *ListAlertsOKBody) contextValidateAlerts(ctx context.Context, formats strfmt.Registry) error { -/*ListAlertsDefault handles this case with default header values. + for i := 0; i < len(o.Alerts); i++ { -An unexpected error response. -*/ -type ListAlertsDefault struct { - _statusCode int + if o.Alerts[i] != nil { + if err := o.Alerts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAlertsOk" + "." + "alerts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAlertsOk" + "." + "alerts" + "." + strconv.Itoa(i)) + } + return err + } + } - Payload *ListAlertsDefaultBody -} + } -// Code gets the status code for the list alerts default response -func (o *ListAlertsDefault) Code() int { - return o._statusCode + return nil } -func (o *ListAlertsDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/ia/Alerts/List][%d] ListAlerts default %+v", o._statusCode, o.Payload) -} +func (o *ListAlertsOKBody) contextValidateTotals(ctx context.Context, formats strfmt.Registry) error { -func (o *ListAlertsDefault) GetPayload() *ListAlertsDefaultBody { - return o.Payload -} + if o.Totals != nil { + if err := o.Totals.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAlertsOk" + "." + "totals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAlertsOk" + "." + "totals") + } + return err + } + } -func (o *ListAlertsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + return nil +} - o.Payload = new(ListAlertsDefaultBody) +// MarshalBinary interface implementation +func (o *ListAlertsOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { +// UnmarshalBinary interface implementation +func (o *ListAlertsOKBody) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBody + if err := swag.ReadJSON(b, &res); err != nil { return err } - + *o = res return nil } -/*AlertsItems0 Alert represents Alert. -swagger:model AlertsItems0 +/*ListAlertsOKBodyAlertsItems0 Alert represents Alert. +swagger:model ListAlertsOKBodyAlertsItems0 */ -type AlertsItems0 struct { +type ListAlertsOKBodyAlertsItems0 struct { // ID. AlertID string `json:"alert_id,omitempty"` @@ -130,19 +517,6 @@ type AlertsItems0 struct { // Human-readable summary. Summary string `json:"summary,omitempty"` - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - Severity *string `json:"severity,omitempty"` - - // Status represents Alert Rule's and Alert's combined status. - // - // - CLEAR: No alert. - // - PENDING: Pending, but not triggering alert. - // - TRIGGERING: Triggering (firing) alert. - // - SILENCED: Silenced alert. - // Enum: [STATUS_INVALID CLEAR PENDING TRIGGERING SILENCED] - Status *string `json:"status,omitempty"` - // Combined labels. Labels map[string]string `json:"labels,omitempty"` @@ -155,30 +529,43 @@ type AlertsItems0 struct { UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` // rule - Rule *AlertsItems0Rule `json:"rule,omitempty"` + Rule *ListAlertsOKBodyAlertsItems0Rule `json:"rule,omitempty"` + + // Severity represents severity level of the check result or alert. + // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] + Severity *string `json:"severity,omitempty"` + + // Status represents Alert Rule's and Alert's combined status. + // + // - CLEAR: No alert. + // - PENDING: Pending, but not triggering alert. + // - TRIGGERING: Triggering (firing) alert. + // - SILENCED: Silenced alert. + // Enum: [STATUS_INVALID CLEAR PENDING TRIGGERING SILENCED] + Status *string `json:"status,omitempty"` } -// Validate validates this alerts items0 -func (o *AlertsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 +func (o *ListAlertsOKBodyAlertsItems0) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateSeverity(formats); err != nil { + if err := o.validateCreatedAt(formats); err != nil { res = append(res, err) } - if err := o.validateStatus(formats); err != nil { + if err := o.validateUpdatedAt(formats); err != nil { res = append(res, err) } - if err := o.validateCreatedAt(formats); err != nil { + if err := o.validateRule(formats); err != nil { res = append(res, err) } - if err := o.validateUpdatedAt(formats); err != nil { + if err := o.validateSeverity(formats); err != nil { res = append(res, err) } - if err := o.validateRule(formats); err != nil { + if err := o.validateStatus(formats); err != nil { res = append(res, err) } @@ -188,7 +575,50 @@ func (o *AlertsItems0) Validate(formats strfmt.Registry) error { return nil } -var alertsItems0TypeSeverityPropEnum []interface{} +func (o *ListAlertsOKBodyAlertsItems0) 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 *ListAlertsOKBodyAlertsItems0) 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 *ListAlertsOKBodyAlertsItems0) validateRule(formats strfmt.Registry) error { + if swag.IsZero(o.Rule) { // not required + return nil + } + + if o.Rule != nil { + if err := o.Rule.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule") + } + return err + } + } + + return nil +} + +var listAlertsOkBodyAlertsItems0TypeSeverityPropEnum []interface{} func init() { var res []string @@ -196,50 +626,49 @@ func init() { panic(err) } for _, v := range res { - alertsItems0TypeSeverityPropEnum = append(alertsItems0TypeSeverityPropEnum, v) + listAlertsOkBodyAlertsItems0TypeSeverityPropEnum = append(listAlertsOkBodyAlertsItems0TypeSeverityPropEnum, v) } } const ( - // AlertsItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - AlertsItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" + // ListAlertsOKBodyAlertsItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" + ListAlertsOKBodyAlertsItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" - // AlertsItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - AlertsItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" + // ListAlertsOKBodyAlertsItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" + ListAlertsOKBodyAlertsItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - // AlertsItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - AlertsItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" + // ListAlertsOKBodyAlertsItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" + ListAlertsOKBodyAlertsItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" - // AlertsItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - AlertsItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" + // ListAlertsOKBodyAlertsItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" + ListAlertsOKBodyAlertsItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - // AlertsItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - AlertsItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" + // ListAlertsOKBodyAlertsItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" + ListAlertsOKBodyAlertsItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" - // AlertsItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - AlertsItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" + // ListAlertsOKBodyAlertsItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" + ListAlertsOKBodyAlertsItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" - // AlertsItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - AlertsItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" + // ListAlertsOKBodyAlertsItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" + ListAlertsOKBodyAlertsItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - // AlertsItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - AlertsItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" + // ListAlertsOKBodyAlertsItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" + ListAlertsOKBodyAlertsItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" - // AlertsItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - AlertsItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" + // ListAlertsOKBodyAlertsItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" + ListAlertsOKBodyAlertsItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" ) // prop value enum -func (o *AlertsItems0) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, alertsItems0TypeSeverityPropEnum, true); err != nil { +func (o *ListAlertsOKBodyAlertsItems0) validateSeverityEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0TypeSeverityPropEnum, true); err != nil { return err } return nil } -func (o *AlertsItems0) validateSeverity(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0) validateSeverity(formats strfmt.Registry) error { if swag.IsZero(o.Severity) { // not required return nil } @@ -252,7 +681,7 @@ func (o *AlertsItems0) validateSeverity(formats strfmt.Registry) error { return nil } -var alertsItems0TypeStatusPropEnum []interface{} +var listAlertsOkBodyAlertsItems0TypeStatusPropEnum []interface{} func init() { var res []string @@ -260,38 +689,37 @@ func init() { panic(err) } for _, v := range res { - alertsItems0TypeStatusPropEnum = append(alertsItems0TypeStatusPropEnum, v) + listAlertsOkBodyAlertsItems0TypeStatusPropEnum = append(listAlertsOkBodyAlertsItems0TypeStatusPropEnum, v) } } const ( - // AlertsItems0StatusSTATUSINVALID captures enum value "STATUS_INVALID" - AlertsItems0StatusSTATUSINVALID string = "STATUS_INVALID" + // ListAlertsOKBodyAlertsItems0StatusSTATUSINVALID captures enum value "STATUS_INVALID" + ListAlertsOKBodyAlertsItems0StatusSTATUSINVALID string = "STATUS_INVALID" - // AlertsItems0StatusCLEAR captures enum value "CLEAR" - AlertsItems0StatusCLEAR string = "CLEAR" + // ListAlertsOKBodyAlertsItems0StatusCLEAR captures enum value "CLEAR" + ListAlertsOKBodyAlertsItems0StatusCLEAR string = "CLEAR" - // AlertsItems0StatusPENDING captures enum value "PENDING" - AlertsItems0StatusPENDING string = "PENDING" + // ListAlertsOKBodyAlertsItems0StatusPENDING captures enum value "PENDING" + ListAlertsOKBodyAlertsItems0StatusPENDING string = "PENDING" - // AlertsItems0StatusTRIGGERING captures enum value "TRIGGERING" - AlertsItems0StatusTRIGGERING string = "TRIGGERING" + // ListAlertsOKBodyAlertsItems0StatusTRIGGERING captures enum value "TRIGGERING" + ListAlertsOKBodyAlertsItems0StatusTRIGGERING string = "TRIGGERING" - // AlertsItems0StatusSILENCED captures enum value "SILENCED" - AlertsItems0StatusSILENCED string = "SILENCED" + // ListAlertsOKBodyAlertsItems0StatusSILENCED captures enum value "SILENCED" + ListAlertsOKBodyAlertsItems0StatusSILENCED string = "SILENCED" ) // prop value enum -func (o *AlertsItems0) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, alertsItems0TypeStatusPropEnum, true); err != nil { +func (o *ListAlertsOKBodyAlertsItems0) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0TypeStatusPropEnum, true); err != nil { return err } return nil } -func (o *AlertsItems0) validateStatus(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0) validateStatus(formats strfmt.Registry) error { if swag.IsZero(o.Status) { // not required return nil } @@ -304,42 +732,28 @@ func (o *AlertsItems0) validateStatus(formats strfmt.Registry) error { return nil } -func (o *AlertsItems0) 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 *AlertsItems0) validateUpdatedAt(formats strfmt.Registry) error { +// ContextValidate validate this list alerts OK body alerts items0 based on the context it is used +func (o *ListAlertsOKBodyAlertsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.UpdatedAt) { // not required - return nil + if err := o.contextValidateRule(ctx, formats); err != nil { + res = append(res, err) } - if err := validate.FormatOf("updated_at", "body", "date-time", o.UpdatedAt.String(), formats); err != nil { - return err + if len(res) > 0 { + return errors.CompositeValidationError(res...) } - return nil } -func (o *AlertsItems0) validateRule(formats strfmt.Registry) error { - - if swag.IsZero(o.Rule) { // not required - return nil - } +func (o *ListAlertsOKBodyAlertsItems0) contextValidateRule(ctx context.Context, formats strfmt.Registry) error { if o.Rule != nil { - if err := o.Rule.Validate(formats); err != nil { + if err := o.Rule.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("rule") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule") } return err } @@ -349,7 +763,7 @@ func (o *AlertsItems0) validateRule(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (o *AlertsItems0) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -357,8 +771,8 @@ func (o *AlertsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *AlertsItems0) UnmarshalBinary(b []byte) error { - var res AlertsItems0 +func (o *ListAlertsOKBodyAlertsItems0) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -366,10 +780,10 @@ func (o *AlertsItems0) UnmarshalBinary(b []byte) error { return nil } -/*AlertsItems0Rule Rule represents Alert Rule. -swagger:model AlertsItems0Rule +/*ListAlertsOKBodyAlertsItems0Rule Rule represents Alert Rule. +swagger:model ListAlertsOKBodyAlertsItems0Rule */ -type AlertsItems0Rule struct { +type ListAlertsOKBodyAlertsItems0Rule struct { // Rule ID. RuleID string `json:"rule_id,omitempty"` @@ -393,10 +807,10 @@ type AlertsItems0Rule struct { Expr string `json:"expr,omitempty"` // Expression parameters definitions. - ParamsDefinitions []*AlertsItems0RuleParamsDefinitionsItems0 `json:"params_definitions"` + ParamsDefinitions []*ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0 `json:"params_definitions"` // Expression parameters values. - ParamsValues []*AlertsItems0RuleParamsValuesItems0 `json:"params_values"` + ParamsValues []*ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0 `json:"params_values"` // Default for duration. DefaultFor string `json:"default_for,omitempty"` @@ -404,14 +818,6 @@ type AlertsItems0Rule struct { // For duration. For string `json:"for,omitempty"` - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - DefaultSeverity *string `json:"default_severity,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - Severity *string `json:"severity,omitempty"` - // Custom labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` @@ -422,18 +828,26 @@ type AlertsItems0Rule struct { Annotations map[string]string `json:"annotations,omitempty"` // Filters. - Filters []*AlertsItems0RuleFiltersItems0 `json:"filters"` + Filters []*ListAlertsOKBodyAlertsItems0RuleFiltersItems0 `json:"filters"` // Channels. - Channels []*AlertsItems0RuleChannelsItems0 `json:"channels"` + Channels []*ListAlertsOKBodyAlertsItems0RuleChannelsItems0 `json:"channels"` // Rule creation time. // Format: date-time CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Severity represents severity level of the check result or alert. + // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] + DefaultSeverity *string `json:"default_severity,omitempty"` + + // Severity represents severity level of the check result or alert. + // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] + Severity *string `json:"severity,omitempty"` } -// Validate validates this alerts items0 rule -func (o *AlertsItems0Rule) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule +func (o *ListAlertsOKBodyAlertsItems0Rule) Validate(formats strfmt.Registry) error { var res []error if err := o.validateParamsDefinitions(formats); err != nil { @@ -444,23 +858,23 @@ func (o *AlertsItems0Rule) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateDefaultSeverity(formats); err != nil { + if err := o.validateFilters(formats); err != nil { res = append(res, err) } - if err := o.validateSeverity(formats); err != nil { + if err := o.validateChannels(formats); err != nil { res = append(res, err) } - if err := o.validateFilters(formats); err != nil { + if err := o.validateCreatedAt(formats); err != nil { res = append(res, err) } - if err := o.validateChannels(formats); err != nil { + if err := o.validateDefaultSeverity(formats); err != nil { res = append(res, err) } - if err := o.validateCreatedAt(formats); err != nil { + if err := o.validateSeverity(formats); err != nil { res = append(res, err) } @@ -470,21 +884,74 @@ func (o *AlertsItems0Rule) Validate(formats strfmt.Registry) error { return nil } -func (o *AlertsItems0Rule) validateParamsDefinitions(formats strfmt.Registry) error { +func (o *ListAlertsOKBodyAlertsItems0Rule) validateParamsDefinitions(formats strfmt.Registry) error { + if swag.IsZero(o.ParamsDefinitions) { // not required + return nil + } + + for i := 0; i < len(o.ParamsDefinitions); i++ { + if swag.IsZero(o.ParamsDefinitions[i]) { // not required + continue + } + + if o.ParamsDefinitions[i] != nil { + if err := o.ParamsDefinitions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule" + "." + "params_definitions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule" + "." + "params_definitions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *ListAlertsOKBodyAlertsItems0Rule) validateParamsValues(formats strfmt.Registry) error { + if swag.IsZero(o.ParamsValues) { // not required + return nil + } + + for i := 0; i < len(o.ParamsValues); i++ { + if swag.IsZero(o.ParamsValues[i]) { // not required + continue + } + + if o.ParamsValues[i] != nil { + if err := o.ParamsValues[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule" + "." + "params_values" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule" + "." + "params_values" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} - if swag.IsZero(o.ParamsDefinitions) { // not required +func (o *ListAlertsOKBodyAlertsItems0Rule) validateFilters(formats strfmt.Registry) error { + if swag.IsZero(o.Filters) { // not required return nil } - for i := 0; i < len(o.ParamsDefinitions); i++ { - if swag.IsZero(o.ParamsDefinitions[i]) { // not required + for i := 0; i < len(o.Filters); i++ { + if swag.IsZero(o.Filters[i]) { // not required continue } - if o.ParamsDefinitions[i] != nil { - if err := o.ParamsDefinitions[i].Validate(formats); err != nil { + if o.Filters[i] != nil { + if err := o.Filters[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "params_definitions" + "." + strconv.Itoa(i)) + return ve.ValidateName("rule" + "." + "filters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule" + "." + "filters" + "." + strconv.Itoa(i)) } return err } @@ -495,21 +962,22 @@ func (o *AlertsItems0Rule) validateParamsDefinitions(formats strfmt.Registry) er return nil } -func (o *AlertsItems0Rule) validateParamsValues(formats strfmt.Registry) error { - - if swag.IsZero(o.ParamsValues) { // not required +func (o *ListAlertsOKBodyAlertsItems0Rule) validateChannels(formats strfmt.Registry) error { + if swag.IsZero(o.Channels) { // not required return nil } - for i := 0; i < len(o.ParamsValues); i++ { - if swag.IsZero(o.ParamsValues[i]) { // not required + for i := 0; i < len(o.Channels); i++ { + if swag.IsZero(o.Channels[i]) { // not required continue } - if o.ParamsValues[i] != nil { - if err := o.ParamsValues[i].Validate(formats); err != nil { + if o.Channels[i] != nil { + if err := o.Channels[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "params_values" + "." + strconv.Itoa(i)) + return ve.ValidateName("rule" + "." + "channels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule" + "." + "channels" + "." + strconv.Itoa(i)) } return err } @@ -520,7 +988,19 @@ func (o *AlertsItems0Rule) validateParamsValues(formats strfmt.Registry) error { return nil } -var alertsItems0RuleTypeDefaultSeverityPropEnum []interface{} +func (o *ListAlertsOKBodyAlertsItems0Rule) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(o.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("rule"+"."+"created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +var listAlertsOkBodyAlertsItems0RuleTypeDefaultSeverityPropEnum []interface{} func init() { var res []string @@ -528,50 +1008,49 @@ func init() { panic(err) } for _, v := range res { - alertsItems0RuleTypeDefaultSeverityPropEnum = append(alertsItems0RuleTypeDefaultSeverityPropEnum, v) + listAlertsOkBodyAlertsItems0RuleTypeDefaultSeverityPropEnum = append(listAlertsOkBodyAlertsItems0RuleTypeDefaultSeverityPropEnum, v) } } const ( - // AlertsItems0RuleDefaultSeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - AlertsItems0RuleDefaultSeveritySEVERITYINVALID string = "SEVERITY_INVALID" + // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" + ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYINVALID string = "SEVERITY_INVALID" - // AlertsItems0RuleDefaultSeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - AlertsItems0RuleDefaultSeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" + // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" + ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - // AlertsItems0RuleDefaultSeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - AlertsItems0RuleDefaultSeveritySEVERITYALERT string = "SEVERITY_ALERT" + // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" + ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYALERT string = "SEVERITY_ALERT" - // AlertsItems0RuleDefaultSeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - AlertsItems0RuleDefaultSeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" + // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" + ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - // AlertsItems0RuleDefaultSeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - AlertsItems0RuleDefaultSeveritySEVERITYERROR string = "SEVERITY_ERROR" + // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" + ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYERROR string = "SEVERITY_ERROR" - // AlertsItems0RuleDefaultSeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - AlertsItems0RuleDefaultSeveritySEVERITYWARNING string = "SEVERITY_WARNING" + // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" + ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYWARNING string = "SEVERITY_WARNING" - // AlertsItems0RuleDefaultSeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - AlertsItems0RuleDefaultSeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" + // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" + ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - // AlertsItems0RuleDefaultSeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - AlertsItems0RuleDefaultSeveritySEVERITYINFO string = "SEVERITY_INFO" + // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYINFO captures enum value "SEVERITY_INFO" + ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYINFO string = "SEVERITY_INFO" - // AlertsItems0RuleDefaultSeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - AlertsItems0RuleDefaultSeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" + // ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" + ListAlertsOKBodyAlertsItems0RuleDefaultSeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" ) // prop value enum -func (o *AlertsItems0Rule) validateDefaultSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, alertsItems0RuleTypeDefaultSeverityPropEnum, true); err != nil { +func (o *ListAlertsOKBodyAlertsItems0Rule) validateDefaultSeverityEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleTypeDefaultSeverityPropEnum, true); err != nil { return err } return nil } -func (o *AlertsItems0Rule) validateDefaultSeverity(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0Rule) validateDefaultSeverity(formats strfmt.Registry) error { if swag.IsZero(o.DefaultSeverity) { // not required return nil } @@ -584,7 +1063,7 @@ func (o *AlertsItems0Rule) validateDefaultSeverity(formats strfmt.Registry) erro return nil } -var alertsItems0RuleTypeSeverityPropEnum []interface{} +var listAlertsOkBodyAlertsItems0RuleTypeSeverityPropEnum []interface{} func init() { var res []string @@ -592,50 +1071,49 @@ func init() { panic(err) } for _, v := range res { - alertsItems0RuleTypeSeverityPropEnum = append(alertsItems0RuleTypeSeverityPropEnum, v) + listAlertsOkBodyAlertsItems0RuleTypeSeverityPropEnum = append(listAlertsOkBodyAlertsItems0RuleTypeSeverityPropEnum, v) } } const ( - // AlertsItems0RuleSeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - AlertsItems0RuleSeveritySEVERITYINVALID string = "SEVERITY_INVALID" + // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" + ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYINVALID string = "SEVERITY_INVALID" - // AlertsItems0RuleSeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - AlertsItems0RuleSeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" + // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" + ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - // AlertsItems0RuleSeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - AlertsItems0RuleSeveritySEVERITYALERT string = "SEVERITY_ALERT" + // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" + ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYALERT string = "SEVERITY_ALERT" - // AlertsItems0RuleSeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - AlertsItems0RuleSeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" + // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" + ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - // AlertsItems0RuleSeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - AlertsItems0RuleSeveritySEVERITYERROR string = "SEVERITY_ERROR" + // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" + ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYERROR string = "SEVERITY_ERROR" - // AlertsItems0RuleSeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - AlertsItems0RuleSeveritySEVERITYWARNING string = "SEVERITY_WARNING" + // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" + ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYWARNING string = "SEVERITY_WARNING" - // AlertsItems0RuleSeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - AlertsItems0RuleSeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" + // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" + ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - // AlertsItems0RuleSeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - AlertsItems0RuleSeveritySEVERITYINFO string = "SEVERITY_INFO" + // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYINFO captures enum value "SEVERITY_INFO" + ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYINFO string = "SEVERITY_INFO" - // AlertsItems0RuleSeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - AlertsItems0RuleSeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" + // ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" + ListAlertsOKBodyAlertsItems0RuleSeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" ) // prop value enum -func (o *AlertsItems0Rule) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, alertsItems0RuleTypeSeverityPropEnum, true); err != nil { +func (o *ListAlertsOKBodyAlertsItems0Rule) validateSeverityEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleTypeSeverityPropEnum, true); err != nil { return err } return nil } -func (o *AlertsItems0Rule) validateSeverity(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0Rule) validateSeverity(formats strfmt.Registry) error { if swag.IsZero(o.Severity) { // not required return nil } @@ -648,21 +1126,42 @@ func (o *AlertsItems0Rule) validateSeverity(formats strfmt.Registry) error { return nil } -func (o *AlertsItems0Rule) validateFilters(formats strfmt.Registry) error { +// ContextValidate validate this list alerts OK body alerts items0 rule based on the context it is used +func (o *ListAlertsOKBodyAlertsItems0Rule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.Filters) { // not required - return nil + if err := o.contextValidateParamsDefinitions(ctx, formats); err != nil { + res = append(res, err) } - for i := 0; i < len(o.Filters); i++ { - if swag.IsZero(o.Filters[i]) { // not required - continue - } + if err := o.contextValidateParamsValues(ctx, formats); err != nil { + res = append(res, err) + } - if o.Filters[i] != nil { - if err := o.Filters[i].Validate(formats); err != nil { + if err := o.contextValidateFilters(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateChannels(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertsOKBodyAlertsItems0Rule) contextValidateParamsDefinitions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.ParamsDefinitions); i++ { + + if o.ParamsDefinitions[i] != nil { + if err := o.ParamsDefinitions[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "filters" + "." + strconv.Itoa(i)) + return ve.ValidateName("rule" + "." + "params_definitions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule" + "." + "params_definitions" + "." + strconv.Itoa(i)) } return err } @@ -673,21 +1172,36 @@ func (o *AlertsItems0Rule) validateFilters(formats strfmt.Registry) error { return nil } -func (o *AlertsItems0Rule) validateChannels(formats strfmt.Registry) error { +func (o *ListAlertsOKBodyAlertsItems0Rule) contextValidateParamsValues(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(o.Channels) { // not required - return nil - } + for i := 0; i < len(o.ParamsValues); i++ { - for i := 0; i < len(o.Channels); i++ { - if swag.IsZero(o.Channels[i]) { // not required - continue + if o.ParamsValues[i] != nil { + if err := o.ParamsValues[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule" + "." + "params_values" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule" + "." + "params_values" + "." + strconv.Itoa(i)) + } + return err + } } - if o.Channels[i] != nil { - if err := o.Channels[i].Validate(formats); err != nil { + } + + return nil +} + +func (o *ListAlertsOKBodyAlertsItems0Rule) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Filters); i++ { + + if o.Filters[i] != nil { + if err := o.Filters[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rule" + "." + "channels" + "." + strconv.Itoa(i)) + return ve.ValidateName("rule" + "." + "filters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule" + "." + "filters" + "." + strconv.Itoa(i)) } return err } @@ -698,21 +1212,28 @@ func (o *AlertsItems0Rule) validateChannels(formats strfmt.Registry) error { return nil } -func (o *AlertsItems0Rule) validateCreatedAt(formats strfmt.Registry) error { +func (o *ListAlertsOKBodyAlertsItems0Rule) contextValidateChannels(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } + for i := 0; i < len(o.Channels); i++ { + + if o.Channels[i] != nil { + if err := o.Channels[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule" + "." + "channels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule" + "." + "channels" + "." + strconv.Itoa(i)) + } + return err + } + } - if err := validate.FormatOf("rule"+"."+"created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err } return nil } // MarshalBinary interface implementation -func (o *AlertsItems0Rule) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0Rule) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -720,8 +1241,8 @@ func (o *AlertsItems0Rule) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *AlertsItems0Rule) UnmarshalBinary(b []byte) error { - var res AlertsItems0Rule +func (o *ListAlertsOKBodyAlertsItems0Rule) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0Rule if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -729,10 +1250,10 @@ func (o *AlertsItems0Rule) UnmarshalBinary(b []byte) error { return nil } -/*AlertsItems0RuleChannelsItems0 Channel represents a single Notification Channel. -swagger:model AlertsItems0RuleChannelsItems0 +/*ListAlertsOKBodyAlertsItems0RuleChannelsItems0 Channel represents a single Notification Channel. +swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0 */ -type AlertsItems0RuleChannelsItems0 struct { +type ListAlertsOKBodyAlertsItems0RuleChannelsItems0 struct { // Machine-readable ID. ChannelID string `json:"channel_id,omitempty"` @@ -744,20 +1265,20 @@ type AlertsItems0RuleChannelsItems0 struct { Disabled bool `json:"disabled,omitempty"` // email config - EmailConfig *AlertsItems0RuleChannelsItems0EmailConfig `json:"email_config,omitempty"` + EmailConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig `json:"email_config,omitempty"` // pagerduty config - PagerdutyConfig *AlertsItems0RuleChannelsItems0PagerdutyConfig `json:"pagerduty_config,omitempty"` + PagerdutyConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig `json:"pagerduty_config,omitempty"` // slack config - SlackConfig *AlertsItems0RuleChannelsItems0SlackConfig `json:"slack_config,omitempty"` + SlackConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig `json:"slack_config,omitempty"` // webhook config - WebhookConfig *AlertsItems0RuleChannelsItems0WebhookConfig `json:"webhook_config,omitempty"` + WebhookConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig `json:"webhook_config,omitempty"` } -// Validate validates this alerts items0 rule channels items0 -func (o *AlertsItems0RuleChannelsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule channels items0 +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateEmailConfig(formats); err != nil { @@ -782,8 +1303,7 @@ func (o *AlertsItems0RuleChannelsItems0) Validate(formats strfmt.Registry) error return nil } -func (o *AlertsItems0RuleChannelsItems0) validateEmailConfig(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) validateEmailConfig(formats strfmt.Registry) error { if swag.IsZero(o.EmailConfig) { // not required return nil } @@ -792,6 +1312,8 @@ func (o *AlertsItems0RuleChannelsItems0) validateEmailConfig(formats strfmt.Regi if err := o.EmailConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("email_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("email_config") } return err } @@ -800,8 +1322,7 @@ func (o *AlertsItems0RuleChannelsItems0) validateEmailConfig(formats strfmt.Regi return nil } -func (o *AlertsItems0RuleChannelsItems0) validatePagerdutyConfig(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) validatePagerdutyConfig(formats strfmt.Registry) error { if swag.IsZero(o.PagerdutyConfig) { // not required return nil } @@ -810,6 +1331,8 @@ func (o *AlertsItems0RuleChannelsItems0) validatePagerdutyConfig(formats strfmt. if err := o.PagerdutyConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pagerduty_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pagerduty_config") } return err } @@ -818,8 +1341,7 @@ func (o *AlertsItems0RuleChannelsItems0) validatePagerdutyConfig(formats strfmt. return nil } -func (o *AlertsItems0RuleChannelsItems0) validateSlackConfig(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) validateSlackConfig(formats strfmt.Registry) error { if swag.IsZero(o.SlackConfig) { // not required return nil } @@ -828,6 +1350,8 @@ func (o *AlertsItems0RuleChannelsItems0) validateSlackConfig(formats strfmt.Regi if err := o.SlackConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("slack_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slack_config") } return err } @@ -836,8 +1360,7 @@ func (o *AlertsItems0RuleChannelsItems0) validateSlackConfig(formats strfmt.Regi return nil } -func (o *AlertsItems0RuleChannelsItems0) validateWebhookConfig(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) validateWebhookConfig(formats strfmt.Registry) error { if swag.IsZero(o.WebhookConfig) { // not required return nil } @@ -846,6 +1369,98 @@ func (o *AlertsItems0RuleChannelsItems0) validateWebhookConfig(formats strfmt.Re if err := o.WebhookConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("webhook_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list alerts OK body alerts items0 rule channels items0 based on the context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateEmailConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePagerdutyConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSlackConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateWebhookConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) contextValidateEmailConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.EmailConfig != nil { + if err := o.EmailConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("email_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("email_config") + } + return err + } + } + + return nil +} + +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) contextValidatePagerdutyConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PagerdutyConfig != nil { + if err := o.PagerdutyConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagerduty_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pagerduty_config") + } + return err + } + } + + return nil +} + +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.SlackConfig != nil { + if err := o.SlackConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("slack_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slack_config") + } + return err + } + } + + return nil +} + +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) contextValidateWebhookConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.WebhookConfig != nil { + if err := o.WebhookConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config") } return err } @@ -855,7 +1470,7 @@ func (o *AlertsItems0RuleChannelsItems0) validateWebhookConfig(formats strfmt.Re } // MarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -863,8 +1478,8 @@ func (o *AlertsItems0RuleChannelsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleChannelsItems0 +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -872,10 +1487,10 @@ func (o *AlertsItems0RuleChannelsItems0) UnmarshalBinary(b []byte) error { return nil } -/*AlertsItems0RuleChannelsItems0EmailConfig EmailConfig represents email configuration. -swagger:model AlertsItems0RuleChannelsItems0EmailConfig +/*ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig EmailConfig represents email configuration. +swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig */ -type AlertsItems0RuleChannelsItems0EmailConfig struct { +type ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig struct { // send resolved SendResolved bool `json:"send_resolved,omitempty"` @@ -884,13 +1499,18 @@ type AlertsItems0RuleChannelsItems0EmailConfig struct { To []string `json:"to"` } -// Validate validates this alerts items0 rule channels items0 email config -func (o *AlertsItems0RuleChannelsItems0EmailConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule channels items0 email config +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alerts OK body alerts items0 rule channels items0 email config based on context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0EmailConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -898,8 +1518,8 @@ func (o *AlertsItems0RuleChannelsItems0EmailConfig) MarshalBinary() ([]byte, err } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0EmailConfig) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleChannelsItems0EmailConfig +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0EmailConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -907,10 +1527,10 @@ func (o *AlertsItems0RuleChannelsItems0EmailConfig) UnmarshalBinary(b []byte) er return nil } -/*AlertsItems0RuleChannelsItems0PagerdutyConfig PagerDutyConfig represents PagerDuty configuration. -swagger:model AlertsItems0RuleChannelsItems0PagerdutyConfig +/*ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig PagerDutyConfig represents PagerDuty configuration. +swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig */ -type AlertsItems0RuleChannelsItems0PagerdutyConfig struct { +type ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig struct { // send resolved SendResolved bool `json:"send_resolved,omitempty"` @@ -922,13 +1542,18 @@ type AlertsItems0RuleChannelsItems0PagerdutyConfig struct { ServiceKey string `json:"service_key,omitempty"` } -// Validate validates this alerts items0 rule channels items0 pagerduty config -func (o *AlertsItems0RuleChannelsItems0PagerdutyConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule channels items0 pagerduty config +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alerts OK body alerts items0 rule channels items0 pagerduty config based on context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -936,8 +1561,8 @@ func (o *AlertsItems0RuleChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleChannelsItems0PagerdutyConfig +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0PagerdutyConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -945,10 +1570,10 @@ func (o *AlertsItems0RuleChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte return nil } -/*AlertsItems0RuleChannelsItems0SlackConfig SlackConfig represents Slack configuration. -swagger:model AlertsItems0RuleChannelsItems0SlackConfig +/*ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig SlackConfig represents Slack configuration. +swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig */ -type AlertsItems0RuleChannelsItems0SlackConfig struct { +type ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig struct { // send resolved SendResolved bool `json:"send_resolved,omitempty"` @@ -957,13 +1582,18 @@ type AlertsItems0RuleChannelsItems0SlackConfig struct { Channel string `json:"channel,omitempty"` } -// Validate validates this alerts items0 rule channels items0 slack config -func (o *AlertsItems0RuleChannelsItems0SlackConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule channels items0 slack config +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alerts OK body alerts items0 rule channels items0 slack config based on context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -971,8 +1601,8 @@ func (o *AlertsItems0RuleChannelsItems0SlackConfig) MarshalBinary() ([]byte, err } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleChannelsItems0SlackConfig +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0SlackConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -980,10 +1610,10 @@ func (o *AlertsItems0RuleChannelsItems0SlackConfig) UnmarshalBinary(b []byte) er return nil } -/*AlertsItems0RuleChannelsItems0WebhookConfig WebhookConfig represents webhook configuration. -swagger:model AlertsItems0RuleChannelsItems0WebhookConfig +/*ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig WebhookConfig represents webhook configuration. +swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig */ -type AlertsItems0RuleChannelsItems0WebhookConfig struct { +type ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig struct { // send resolved SendResolved bool `json:"send_resolved,omitempty"` @@ -995,11 +1625,11 @@ type AlertsItems0RuleChannelsItems0WebhookConfig struct { MaxAlerts int32 `json:"max_alerts,omitempty"` // http config - HTTPConfig *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig `json:"http_config,omitempty"` + HTTPConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig `json:"http_config,omitempty"` } -// Validate validates this alerts items0 rule channels items0 webhook config -func (o *AlertsItems0RuleChannelsItems0WebhookConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule channels items0 webhook config +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) Validate(formats strfmt.Registry) error { var res []error if err := o.validateHTTPConfig(formats); err != nil { @@ -1012,8 +1642,7 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfig) Validate(formats strfmt.Re return nil } -func (o *AlertsItems0RuleChannelsItems0WebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { if swag.IsZero(o.HTTPConfig) { // not required return nil } @@ -1022,6 +1651,38 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfig) validateHTTPConfig(formats if err := o.HTTPConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("webhook_config" + "." + "http_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list alerts OK body alerts items0 rule channels items0 webhook config based on the context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHTTPConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) contextValidateHTTPConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.HTTPConfig != nil { + if err := o.HTTPConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config") } return err } @@ -1031,7 +1692,7 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfig) validateHTTPConfig(formats } // MarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1039,8 +1700,8 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfig) MarshalBinary() ([]byte, e } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleChannelsItems0WebhookConfig +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1048,10 +1709,10 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) return nil } -/*AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. -swagger:model AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig +/*ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. +swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig */ -type AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig struct { +type ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig struct { // bearer token BearerToken string `json:"bearer_token,omitempty"` @@ -1063,21 +1724,77 @@ type AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig struct { ProxyURL string `json:"proxy_url,omitempty"` // basic auth - BasicAuth *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` + BasicAuth *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` + + // tls config + TLSConfig *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` +} + +// Validate validates this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateBasicAuth(formats); err != nil { + res = append(res, err) + } + + if err := o.validateTLSConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { + if swag.IsZero(o.BasicAuth) { // not required + return nil + } + + if o.BasicAuth != nil { + if err := o.BasicAuth.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") + } + return err + } + } + + return nil +} + +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { + if swag.IsZero(o.TLSConfig) { // not required + return nil + } + + if o.TLSConfig != nil { + if err := o.TLSConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + } + return err + } + } - // tls config - TLSConfig *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` + return nil } -// Validate validates this alerts items0 rule channels items0 webhook config HTTP config -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { +// ContextValidate validate this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config based on the context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := o.validateBasicAuth(formats); err != nil { + if err := o.contextValidateBasicAuth(ctx, formats); err != nil { res = append(res, err) } - if err := o.validateTLSConfig(formats); err != nil { + if err := o.contextValidateTLSConfig(ctx, formats); err != nil { res = append(res, err) } @@ -1087,16 +1804,14 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) Validate(formats return nil } -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { - - if swag.IsZero(o.BasicAuth) { // not required - return nil - } +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { if o.BasicAuth != nil { - if err := o.BasicAuth.Validate(formats); err != nil { + if err := o.BasicAuth.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") } return err } @@ -1105,16 +1820,14 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) validateBasicAut return nil } -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { - - if swag.IsZero(o.TLSConfig) { // not required - return nil - } +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) contextValidateTLSConfig(ctx context.Context, formats strfmt.Registry) error { if o.TLSConfig != nil { - if err := o.TLSConfig.Validate(formats); err != nil { + if err := o.TLSConfig.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") } return err } @@ -1124,7 +1837,7 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) validateTLSConfi } // MarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1132,8 +1845,8 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1141,10 +1854,10 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary( return nil } -/*AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. -swagger:model AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth +/*ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. +swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth */ -type AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { +type ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { // username Username string `json:"username,omitempty"` @@ -1156,13 +1869,18 @@ type AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { PasswordFile string `json:"password_file,omitempty"` } -// Validate validates this alerts items0 rule channels items0 webhook config HTTP config basic auth -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config basic auth +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config basic auth based on context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1170,8 +1888,8 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) Marshal } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1179,11 +1897,11 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigBasicAuth) Unmarsh return nil } -/*AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager +/*ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager // https://prometheus.io/docs/alerting/latest/configuration/#tls_config -swagger:model AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig +swagger:model ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig */ -type AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { +type ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { // A path to the CA certificate file to validate the server certificate with. // ca_file and ca_file_content should not be set at the same time. @@ -1216,13 +1934,18 @@ type AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { KeyFileContent string `json:"key_file_content,omitempty"` } -// Validate validates this alerts items0 rule channels items0 webhook config HTTP config TLS config -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config TLS config +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alerts OK body alerts items0 rule channels items0 webhook config HTTP config TLS config based on context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1230,8 +1953,8 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) Marshal } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig +func (o *ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1239,10 +1962,16 @@ func (o *AlertsItems0RuleChannelsItems0WebhookConfigHTTPConfigTLSConfig) Unmarsh return nil } -/*AlertsItems0RuleFiltersItems0 Filter repsents a single filter condition. -swagger:model AlertsItems0RuleFiltersItems0 +/*ListAlertsOKBodyAlertsItems0RuleFiltersItems0 Filter repsents a single filter condition. +swagger:model ListAlertsOKBodyAlertsItems0RuleFiltersItems0 */ -type AlertsItems0RuleFiltersItems0 struct { +type ListAlertsOKBodyAlertsItems0RuleFiltersItems0 struct { + + // key + Key string `json:"key,omitempty"` + + // value + Value string `json:"value,omitempty"` // FilterType represents filter matching type. // @@ -1250,16 +1979,10 @@ type AlertsItems0RuleFiltersItems0 struct { // - REGEX: =~ // Enum: [FILTER_TYPE_INVALID EQUAL REGEX] Type *string `json:"type,omitempty"` - - // key - Key string `json:"key,omitempty"` - - // value - Value string `json:"value,omitempty"` } -// Validate validates this alerts items0 rule filters items0 -func (o *AlertsItems0RuleFiltersItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule filters items0 +func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateType(formats); err != nil { @@ -1272,7 +1995,7 @@ func (o *AlertsItems0RuleFiltersItems0) Validate(formats strfmt.Registry) error return nil } -var alertsItems0RuleFiltersItems0TypeTypePropEnum []interface{} +var listAlertsOkBodyAlertsItems0RuleFiltersItems0TypeTypePropEnum []interface{} func init() { var res []string @@ -1280,32 +2003,31 @@ func init() { panic(err) } for _, v := range res { - alertsItems0RuleFiltersItems0TypeTypePropEnum = append(alertsItems0RuleFiltersItems0TypeTypePropEnum, v) + listAlertsOkBodyAlertsItems0RuleFiltersItems0TypeTypePropEnum = append(listAlertsOkBodyAlertsItems0RuleFiltersItems0TypeTypePropEnum, v) } } const ( - // AlertsItems0RuleFiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" - AlertsItems0RuleFiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" + // ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" + ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" - // AlertsItems0RuleFiltersItems0TypeEQUAL captures enum value "EQUAL" - AlertsItems0RuleFiltersItems0TypeEQUAL string = "EQUAL" + // ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeEQUAL captures enum value "EQUAL" + ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeEQUAL string = "EQUAL" - // AlertsItems0RuleFiltersItems0TypeREGEX captures enum value "REGEX" - AlertsItems0RuleFiltersItems0TypeREGEX string = "REGEX" + // ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeREGEX captures enum value "REGEX" + ListAlertsOKBodyAlertsItems0RuleFiltersItems0TypeREGEX string = "REGEX" ) // prop value enum -func (o *AlertsItems0RuleFiltersItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, alertsItems0RuleFiltersItems0TypeTypePropEnum, true); err != nil { +func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleFiltersItems0TypeTypePropEnum, true); err != nil { return err } return nil } -func (o *AlertsItems0RuleFiltersItems0) validateType(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) validateType(formats strfmt.Registry) error { if swag.IsZero(o.Type) { // not required return nil } @@ -1318,8 +2040,13 @@ func (o *AlertsItems0RuleFiltersItems0) validateType(formats strfmt.Registry) er return nil } +// ContextValidate validates this list alerts OK body alerts items0 rule filters items0 based on context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *AlertsItems0RuleFiltersItems0) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1327,8 +2054,8 @@ func (o *AlertsItems0RuleFiltersItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleFiltersItems0) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleFiltersItems0 +func (o *ListAlertsOKBodyAlertsItems0RuleFiltersItems0) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleFiltersItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1336,10 +2063,10 @@ func (o *AlertsItems0RuleFiltersItems0) UnmarshalBinary(b []byte) error { return nil } -/*AlertsItems0RuleParamsDefinitionsItems0 ParamDefinition represents a single query parameter. -swagger:model AlertsItems0RuleParamsDefinitionsItems0 +/*ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0 ParamDefinition represents a single query parameter. +swagger:model ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0 */ -type AlertsItems0RuleParamsDefinitionsItems0 struct { +type ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0 struct { // Machine-readable name (ID) that is used in expression. Name string `json:"name,omitempty"` @@ -1347,6 +2074,19 @@ type AlertsItems0RuleParamsDefinitionsItems0 struct { // Short human-readable parameter summary. Summary string `json:"summary,omitempty"` + // bool + Bool *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool `json:"bool,omitempty"` + + // float + Float *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float `json:"float,omitempty"` + + // string + String *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String `json:"string,omitempty"` + + // ParamType represents template parameter type. + // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] + Type *string `json:"type,omitempty"` + // ParamUnit represents template parameter unit. // // - PARAM_UNIT_INVALID: Invalid, unknown or absent. @@ -1354,42 +2094,29 @@ type AlertsItems0RuleParamsDefinitionsItems0 struct { // - SECONDS: s // Enum: [PARAM_UNIT_INVALID PERCENTAGE SECONDS] Unit *string `json:"unit,omitempty"` - - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - - // bool - Bool *AlertsItems0RuleParamsDefinitionsItems0Bool `json:"bool,omitempty"` - - // float - Float *AlertsItems0RuleParamsDefinitionsItems0Float `json:"float,omitempty"` - - // string - String *AlertsItems0RuleParamsDefinitionsItems0String `json:"string,omitempty"` } -// Validate validates this alerts items0 rule params definitions items0 -func (o *AlertsItems0RuleParamsDefinitionsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule params definitions items0 +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateUnit(formats); err != nil { + if err := o.validateBool(formats); err != nil { res = append(res, err) } - if err := o.validateType(formats); err != nil { + if err := o.validateFloat(formats); err != nil { res = append(res, err) } - if err := o.validateBool(formats); err != nil { + if err := o.validateString(formats); err != nil { res = append(res, err) } - if err := o.validateFloat(formats); err != nil { + if err := o.validateType(formats); err != nil { res = append(res, err) } - if err := o.validateString(formats); err != nil { + if err := o.validateUnit(formats); err != nil { res = append(res, err) } @@ -1399,103 +2126,7 @@ func (o *AlertsItems0RuleParamsDefinitionsItems0) Validate(formats strfmt.Regist return nil } -var alertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_UNIT_INVALID","PERCENTAGE","SECONDS"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - alertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum = append(alertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum, v) - } -} - -const ( - - // AlertsItems0RuleParamsDefinitionsItems0UnitPARAMUNITINVALID captures enum value "PARAM_UNIT_INVALID" - AlertsItems0RuleParamsDefinitionsItems0UnitPARAMUNITINVALID string = "PARAM_UNIT_INVALID" - - // AlertsItems0RuleParamsDefinitionsItems0UnitPERCENTAGE captures enum value "PERCENTAGE" - AlertsItems0RuleParamsDefinitionsItems0UnitPERCENTAGE string = "PERCENTAGE" - - // AlertsItems0RuleParamsDefinitionsItems0UnitSECONDS captures enum value "SECONDS" - AlertsItems0RuleParamsDefinitionsItems0UnitSECONDS string = "SECONDS" -) - -// prop value enum -func (o *AlertsItems0RuleParamsDefinitionsItems0) validateUnitEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, alertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AlertsItems0RuleParamsDefinitionsItems0) 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 alertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - alertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum = append(alertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum, v) - } -} - -const ( - - // AlertsItems0RuleParamsDefinitionsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - AlertsItems0RuleParamsDefinitionsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - - // AlertsItems0RuleParamsDefinitionsItems0TypeBOOL captures enum value "BOOL" - AlertsItems0RuleParamsDefinitionsItems0TypeBOOL string = "BOOL" - - // AlertsItems0RuleParamsDefinitionsItems0TypeFLOAT captures enum value "FLOAT" - AlertsItems0RuleParamsDefinitionsItems0TypeFLOAT string = "FLOAT" - - // AlertsItems0RuleParamsDefinitionsItems0TypeSTRING captures enum value "STRING" - AlertsItems0RuleParamsDefinitionsItems0TypeSTRING string = "STRING" -) - -// prop value enum -func (o *AlertsItems0RuleParamsDefinitionsItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, alertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *AlertsItems0RuleParamsDefinitionsItems0) 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 *AlertsItems0RuleParamsDefinitionsItems0) validateBool(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateBool(formats strfmt.Registry) error { if swag.IsZero(o.Bool) { // not required return nil } @@ -1504,6 +2135,8 @@ func (o *AlertsItems0RuleParamsDefinitionsItems0) validateBool(formats strfmt.Re if err := o.Bool.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("bool") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bool") } return err } @@ -1512,8 +2145,7 @@ func (o *AlertsItems0RuleParamsDefinitionsItems0) validateBool(formats strfmt.Re return nil } -func (o *AlertsItems0RuleParamsDefinitionsItems0) validateFloat(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateFloat(formats strfmt.Registry) error { if swag.IsZero(o.Float) { // not required return nil } @@ -1522,6 +2154,8 @@ func (o *AlertsItems0RuleParamsDefinitionsItems0) validateFloat(formats strfmt.R if err := o.Float.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("float") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("float") } return err } @@ -1530,8 +2164,7 @@ func (o *AlertsItems0RuleParamsDefinitionsItems0) validateFloat(formats strfmt.R return nil } -func (o *AlertsItems0RuleParamsDefinitionsItems0) validateString(formats strfmt.Registry) error { - +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateString(formats strfmt.Registry) error { if swag.IsZero(o.String) { // not required return nil } @@ -1540,6 +2173,8 @@ func (o *AlertsItems0RuleParamsDefinitionsItems0) validateString(formats strfmt. if err := o.String.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("string") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("string") } return err } @@ -1548,183 +2183,171 @@ func (o *AlertsItems0RuleParamsDefinitionsItems0) validateString(formats strfmt. return nil } -// MarshalBinary interface implementation -func (o *AlertsItems0RuleParamsDefinitionsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil +var listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum = append(listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum, v) } - return swag.WriteJSON(o) } -// UnmarshalBinary interface implementation -func (o *AlertsItems0RuleParamsDefinitionsItems0) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleParamsDefinitionsItems0 - if err := swag.ReadJSON(b, &res); err != nil { +const ( + + // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" + ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" + + // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeBOOL captures enum value "BOOL" + ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeBOOL string = "BOOL" + + // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeFLOAT captures enum value "FLOAT" + ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeFLOAT string = "FLOAT" + + // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeSTRING captures enum value "STRING" + ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0TypeSTRING string = "STRING" +) + +// prop value enum +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeTypePropEnum, true); err != nil { return err } - *o = res return nil } -/*AlertsItems0RuleParamsDefinitionsItems0Bool BoolParamDefinition represents boolean parameter's default value. -swagger:model AlertsItems0RuleParamsDefinitionsItems0Bool -*/ -type AlertsItems0RuleParamsDefinitionsItems0Bool struct { - - // BooleanFlag represent a command to set some boolean property to true, - // to false, or avoid changing that property. - // - // - DO_NOT_CHANGE: Do not change boolean property. Default value. - // - TRUE: True. - // - FALSE: False. - // Enum: [DO_NOT_CHANGE TRUE FALSE] - Default *string `json:"default,omitempty"` -} - -// Validate validates this alerts items0 rule params definitions items0 bool -func (o *AlertsItems0RuleParamsDefinitionsItems0Bool) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDefault(formats); err != nil { - res = append(res, err) +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateType(formats strfmt.Registry) error { + if swag.IsZero(o.Type) { // not required + return nil } - if len(res) > 0 { - return errors.CompositeValidationError(res...) + // value enum + if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { + return err } + return nil } -var alertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum []interface{} +var listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["DO_NOT_CHANGE","TRUE","FALSE"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["PARAM_UNIT_INVALID","PERCENTAGE","SECONDS"]`), &res); err != nil { panic(err) } for _, v := range res { - alertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum = append(alertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum, v) + listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum = append(listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum, v) } } const ( - // AlertsItems0RuleParamsDefinitionsItems0BoolDefaultDONOTCHANGE captures enum value "DO_NOT_CHANGE" - AlertsItems0RuleParamsDefinitionsItems0BoolDefaultDONOTCHANGE string = "DO_NOT_CHANGE" + // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitPARAMUNITINVALID captures enum value "PARAM_UNIT_INVALID" + ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitPARAMUNITINVALID string = "PARAM_UNIT_INVALID" - // AlertsItems0RuleParamsDefinitionsItems0BoolDefaultTRUE captures enum value "TRUE" - AlertsItems0RuleParamsDefinitionsItems0BoolDefaultTRUE string = "TRUE" + // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitPERCENTAGE captures enum value "PERCENTAGE" + ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitPERCENTAGE string = "PERCENTAGE" - // AlertsItems0RuleParamsDefinitionsItems0BoolDefaultFALSE captures enum value "FALSE" - AlertsItems0RuleParamsDefinitionsItems0BoolDefaultFALSE string = "FALSE" + // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitSECONDS captures enum value "SECONDS" + ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0UnitSECONDS string = "SECONDS" ) // prop value enum -func (o *AlertsItems0RuleParamsDefinitionsItems0Bool) validateDefaultEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, alertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum, true); err != nil { +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateUnitEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0TypeUnitPropEnum, true); err != nil { return err } return nil } -func (o *AlertsItems0RuleParamsDefinitionsItems0Bool) validateDefault(formats strfmt.Registry) error { - - if swag.IsZero(o.Default) { // not required +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) validateUnit(formats strfmt.Registry) error { + if swag.IsZero(o.Unit) { // not required return nil } // value enum - if err := o.validateDefaultEnum("bool"+"."+"default", "body", *o.Default); err != nil { + if err := o.validateUnitEnum("unit", "body", *o.Unit); err != nil { return err } return nil } -// MarshalBinary interface implementation -func (o *AlertsItems0RuleParamsDefinitionsItems0Bool) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} +// ContextValidate validate this list alerts OK body alerts items0 rule params definitions items0 based on the context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error -// UnmarshalBinary interface implementation -func (o *AlertsItems0RuleParamsDefinitionsItems0Bool) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleParamsDefinitionsItems0Bool - if err := swag.ReadJSON(b, &res); err != nil { - return err + if err := o.contextValidateBool(ctx, formats); err != nil { + res = append(res, err) } - *o = res - return nil -} - -/*AlertsItems0RuleParamsDefinitionsItems0Float FloatParamDefinition represents float parameter's default value and valid range. -swagger:model AlertsItems0RuleParamsDefinitionsItems0Float -*/ -type AlertsItems0RuleParamsDefinitionsItems0Float struct { - - // True if default value is set. - HasDefault bool `json:"has_default,omitempty"` - // Default value if has_default is true. - Default float64 `json:"default,omitempty"` + if err := o.contextValidateFloat(ctx, formats); err != nil { + res = append(res, err) + } - // True if minimal valid value is set. - HasMin bool `json:"has_min,omitempty"` + if err := o.contextValidateString(ctx, formats); err != nil { + res = append(res, err) + } - // Minimal valid value (inclusive) if has_min is true. - Min float64 `json:"min,omitempty"` + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} - // True if maximal valid value is set. - HasMax bool `json:"has_max,omitempty"` +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) contextValidateBool(ctx context.Context, formats strfmt.Registry) error { - // Maximal valid value (inclusive) if has_max is true. - Max float64 `json:"max,omitempty"` -} + if o.Bool != nil { + if err := o.Bool.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bool") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bool") + } + return err + } + } -// Validate validates this alerts items0 rule params definitions items0 float -func (o *AlertsItems0RuleParamsDefinitionsItems0Float) Validate(formats strfmt.Registry) error { return nil } -// MarshalBinary interface implementation -func (o *AlertsItems0RuleParamsDefinitionsItems0Float) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) contextValidateFloat(ctx context.Context, formats strfmt.Registry) error { -// UnmarshalBinary interface implementation -func (o *AlertsItems0RuleParamsDefinitionsItems0Float) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleParamsDefinitionsItems0Float - if err := swag.ReadJSON(b, &res); err != nil { - return err + if o.Float != nil { + if err := o.Float.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("float") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("float") + } + return err + } } - *o = res + return nil } -/*AlertsItems0RuleParamsDefinitionsItems0String StringParamDefinition represents string parameter's default value. -swagger:model AlertsItems0RuleParamsDefinitionsItems0String -*/ -type AlertsItems0RuleParamsDefinitionsItems0String struct { - - // True if default value is set. - HasDefault bool `json:"has_default,omitempty"` +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) contextValidateString(ctx context.Context, formats strfmt.Registry) error { - // Default value if has_default is true. - Default string `json:"default,omitempty"` -} + if o.String != nil { + if err := o.String.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("string") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("string") + } + return err + } + } -// Validate validates this alerts items0 rule params definitions items0 string -func (o *AlertsItems0RuleParamsDefinitionsItems0String) Validate(formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *AlertsItems0RuleParamsDefinitionsItems0String) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1732,8 +2355,8 @@ func (o *AlertsItems0RuleParamsDefinitionsItems0String) MarshalBinary() ([]byte, } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleParamsDefinitionsItems0String) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleParamsDefinitionsItems0String +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1741,33 +2364,26 @@ func (o *AlertsItems0RuleParamsDefinitionsItems0String) UnmarshalBinary(b []byte return nil } -/*AlertsItems0RuleParamsValuesItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. -swagger:model AlertsItems0RuleParamsValuesItems0 +/*ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool BoolParamDefinition represents boolean parameter's default value. +swagger:model ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool */ -type AlertsItems0RuleParamsValuesItems0 struct { - - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` - - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - - // Bool value. - Bool bool `json:"bool,omitempty"` - - // Float value. - Float float64 `json:"float,omitempty"` +type ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool struct { - // String value. - String string `json:"string,omitempty"` + // BooleanFlag represent a command to set some boolean property to true, + // to false, or avoid changing that property. + // + // - DO_NOT_CHANGE: Do not change boolean property. Default value. + // - TRUE: True. + // - FALSE: False. + // Enum: [DO_NOT_CHANGE TRUE FALSE] + Default *string `json:"default,omitempty"` } -// Validate validates this alerts items0 rule params values items0 -func (o *AlertsItems0RuleParamsValuesItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule params definitions items0 bool +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateType(formats); err != nil { + if err := o.validateDefault(formats); err != nil { res = append(res, err) } @@ -1777,57 +2393,58 @@ func (o *AlertsItems0RuleParamsValuesItems0) Validate(formats strfmt.Registry) e return nil } -var alertsItems0RuleParamsValuesItems0TypeTypePropEnum []interface{} +var listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["DO_NOT_CHANGE","TRUE","FALSE"]`), &res); err != nil { panic(err) } for _, v := range res { - alertsItems0RuleParamsValuesItems0TypeTypePropEnum = append(alertsItems0RuleParamsValuesItems0TypeTypePropEnum, v) + listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum = append(listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum, v) } } const ( - // AlertsItems0RuleParamsValuesItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - AlertsItems0RuleParamsValuesItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" + // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultDONOTCHANGE captures enum value "DO_NOT_CHANGE" + ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultDONOTCHANGE string = "DO_NOT_CHANGE" - // AlertsItems0RuleParamsValuesItems0TypeBOOL captures enum value "BOOL" - AlertsItems0RuleParamsValuesItems0TypeBOOL string = "BOOL" + // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultTRUE captures enum value "TRUE" + ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultTRUE string = "TRUE" - // AlertsItems0RuleParamsValuesItems0TypeFLOAT captures enum value "FLOAT" - AlertsItems0RuleParamsValuesItems0TypeFLOAT string = "FLOAT" - - // AlertsItems0RuleParamsValuesItems0TypeSTRING captures enum value "STRING" - AlertsItems0RuleParamsValuesItems0TypeSTRING string = "STRING" + // ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultFALSE captures enum value "FALSE" + ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0BoolDefaultFALSE string = "FALSE" ) // prop value enum -func (o *AlertsItems0RuleParamsValuesItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, alertsItems0RuleParamsValuesItems0TypeTypePropEnum, true); err != nil { +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) validateDefaultEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleParamsDefinitionsItems0BoolTypeDefaultPropEnum, true); err != nil { return err } return nil } -func (o *AlertsItems0RuleParamsValuesItems0) validateType(formats strfmt.Registry) error { - - if swag.IsZero(o.Type) { // not required +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) validateDefault(formats strfmt.Registry) error { + if swag.IsZero(o.Default) { // not required return nil } // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { + if err := o.validateDefaultEnum("bool"+"."+"default", "body", *o.Default); err != nil { return err } return nil } +// ContextValidate validates this list alerts OK body alerts items0 rule params definitions items0 bool based on context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *AlertsItems0RuleParamsValuesItems0) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1835,8 +2452,8 @@ func (o *AlertsItems0RuleParamsValuesItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *AlertsItems0RuleParamsValuesItems0) UnmarshalBinary(b []byte) error { - var res AlertsItems0RuleParamsValuesItems0 +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Bool if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1844,26 +2461,42 @@ func (o *AlertsItems0RuleParamsValuesItems0) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float FloatParamDefinition represents float parameter's default value and valid range. +swagger:model ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float */ -type DetailsItems0 struct { +type ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float struct { - // type url - TypeURL string `json:"type_url,omitempty"` + // True if default value is set. + HasDefault bool `json:"has_default,omitempty"` - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` + // Default value if has_default is true. + Default float64 `json:"default,omitempty"` + + // True if minimal valid value is set. + HasMin bool `json:"has_min,omitempty"` + + // Minimal valid value (inclusive) if has_min is true. + Min float64 `json:"min,omitempty"` + + // True if maximal valid value is set. + HasMax bool `json:"has_max,omitempty"` + + // Maximal valid value (inclusive) if has_max is true. + Max float64 `json:"max,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule params definitions items0 float +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alerts OK body alerts items0 rule params definitions items0 float based on context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1871,8 +2504,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0Float if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1880,49 +2513,30 @@ func (o *DetailsItems0) UnmarshalBinary(b []byte) error { return nil } -/*ListAlertsBody list alerts body -swagger:model ListAlertsBody +/*ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String StringParamDefinition represents string parameter's default value. +swagger:model ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String */ -type ListAlertsBody struct { - - // page params - PageParams *ListAlertsParamsBodyPageParams `json:"page_params,omitempty"` -} +type ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String struct { -// Validate validates this list alerts body -func (o *ListAlertsBody) Validate(formats strfmt.Registry) error { - var res []error + // True if default value is set. + HasDefault bool `json:"has_default,omitempty"` - if err := o.validatePageParams(formats); err != nil { - res = append(res, err) - } + // Default value if has_default is true. + Default string `json:"default,omitempty"` +} - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } +// Validate validates this list alerts OK body alerts items0 rule params definitions items0 string +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String) Validate(formats strfmt.Registry) error { return nil } -func (o *ListAlertsBody) validatePageParams(formats strfmt.Registry) error { - - if swag.IsZero(o.PageParams) { // not required - return nil - } - - if o.PageParams != nil { - if err := o.PageParams.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "page_params") - } - return err - } - } - +// ContextValidate validates this list alerts OK body alerts items0 rule params definitions items0 string based on context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ListAlertsBody) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1930,8 +2544,8 @@ func (o *ListAlertsBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListAlertsBody) UnmarshalBinary(b []byte) error { - var res ListAlertsBody +func (o *ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleParamsDefinitionsItems0String if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1939,29 +2553,33 @@ func (o *ListAlertsBody) UnmarshalBinary(b []byte) error { return nil } -/*ListAlertsDefaultBody list alerts default body -swagger:model ListAlertsDefaultBody +/*ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. +swagger:model ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0 */ -type ListAlertsDefaultBody struct { +type ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0 struct { - // error - Error string `json:"error,omitempty"` + // Machine-readable name (ID) that is used in expression. + Name string `json:"name,omitempty"` - // code - Code int32 `json:"code,omitempty"` + // Bool value. + Bool bool `json:"bool,omitempty"` - // message - Message string `json:"message,omitempty"` + // Float value. + Float float64 `json:"float,omitempty"` - // details - Details []*DetailsItems0 `json:"details"` + // String value. + String string `json:"string,omitempty"` + + // ParamType represents template parameter type. + // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] + Type *string `json:"type,omitempty"` } -// Validate validates this list alerts default body -func (o *ListAlertsDefaultBody) Validate(formats strfmt.Registry) error { +// Validate validates this list alerts OK body alerts items0 rule params values items0 +func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateDetails(formats); err != nil { + if err := o.validateType(formats); err != nil { res = append(res, err) } @@ -1971,124 +2589,61 @@ func (o *ListAlertsDefaultBody) Validate(formats strfmt.Registry) error { return nil } -func (o *ListAlertsDefaultBody) validateDetails(formats strfmt.Registry) error { - - if swag.IsZero(o.Details) { // not required - return nil - } - - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ListAlerts default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} +var listAlertsOkBodyAlertsItems0RuleParamsValuesItems0TypeTypePropEnum []interface{} -// MarshalBinary interface implementation -func (o *ListAlertsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { + panic(err) } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListAlertsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListAlertsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err + for _, v := range res { + listAlertsOkBodyAlertsItems0RuleParamsValuesItems0TypeTypePropEnum = append(listAlertsOkBodyAlertsItems0RuleParamsValuesItems0TypeTypePropEnum, v) } - *o = res - return nil } -/*ListAlertsOKBody list alerts OK body -swagger:model ListAlertsOKBody -*/ -type ListAlertsOKBody struct { - - // alerts - Alerts []*AlertsItems0 `json:"alerts"` +const ( - // totals - Totals *ListAlertsOKBodyTotals `json:"totals,omitempty"` -} + // ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" + ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" -// Validate validates this list alerts OK body -func (o *ListAlertsOKBody) Validate(formats strfmt.Registry) error { - var res []error + // ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeBOOL captures enum value "BOOL" + ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeBOOL string = "BOOL" - if err := o.validateAlerts(formats); err != nil { - res = append(res, err) - } + // ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeFLOAT captures enum value "FLOAT" + ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeFLOAT string = "FLOAT" - if err := o.validateTotals(formats); err != nil { - res = append(res, err) - } + // ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeSTRING captures enum value "STRING" + ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0TypeSTRING string = "STRING" +) - if len(res) > 0 { - return errors.CompositeValidationError(res...) +// prop value enum +func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertsOkBodyAlertsItems0RuleParamsValuesItems0TypeTypePropEnum, true); err != nil { + return err } return nil } -func (o *ListAlertsOKBody) validateAlerts(formats strfmt.Registry) error { - - if swag.IsZero(o.Alerts) { // not required +func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) validateType(formats strfmt.Registry) error { + if swag.IsZero(o.Type) { // not required return nil } - for i := 0; i < len(o.Alerts); i++ { - if swag.IsZero(o.Alerts[i]) { // not required - continue - } - - if o.Alerts[i] != nil { - if err := o.Alerts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAlertsOk" + "." + "alerts" + "." + strconv.Itoa(i)) - } - return err - } - } - + // value enum + if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { + return err } return nil } -func (o *ListAlertsOKBody) validateTotals(formats strfmt.Registry) error { - - if swag.IsZero(o.Totals) { // not required - return nil - } - - if o.Totals != nil { - if err := o.Totals.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listAlertsOk" + "." + "totals") - } - return err - } - } - +// ContextValidate validates this list alerts OK body alerts items0 rule params values items0 based on context it is used +func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ListAlertsOKBody) MarshalBinary() ([]byte, error) { +func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -2096,8 +2651,8 @@ func (o *ListAlertsOKBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListAlertsOKBody) UnmarshalBinary(b []byte) error { - var res ListAlertsOKBody +func (o *ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0) UnmarshalBinary(b []byte) error { + var res ListAlertsOKBodyAlertsItems0RuleParamsValuesItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -2122,6 +2677,11 @@ func (o *ListAlertsOKBodyTotals) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list alerts OK body totals based on context it is used +func (o *ListAlertsOKBodyTotals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ListAlertsOKBodyTotals) MarshalBinary() ([]byte, error) { if o == nil { @@ -2157,6 +2717,11 @@ func (o *ListAlertsParamsBodyPageParams) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this list alerts params body page params based on context it is used +func (o *ListAlertsParamsBodyPageParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ListAlertsParamsBodyPageParams) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/ia/json/client/alerts/toggle_alerts_parameters.go b/api/managementpb/ia/json/client/alerts/toggle_alerts_parameters.go index dcb216f391..ae9c9bf0dd 100644 --- a/api/managementpb/ia/json/client/alerts/toggle_alerts_parameters.go +++ b/api/managementpb/ia/json/client/alerts/toggle_alerts_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewToggleAlertsParams creates a new ToggleAlertsParams object -// with the default values initialized. +// NewToggleAlertsParams creates a new ToggleAlertsParams 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 NewToggleAlertsParams() *ToggleAlertsParams { - var () return &ToggleAlertsParams{ - timeout: cr.DefaultTimeout, } } // NewToggleAlertsParamsWithTimeout creates a new ToggleAlertsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewToggleAlertsParamsWithTimeout(timeout time.Duration) *ToggleAlertsParams { - var () return &ToggleAlertsParams{ - timeout: timeout, } } // NewToggleAlertsParamsWithContext creates a new ToggleAlertsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewToggleAlertsParamsWithContext(ctx context.Context) *ToggleAlertsParams { - var () return &ToggleAlertsParams{ - Context: ctx, } } // NewToggleAlertsParamsWithHTTPClient creates a new ToggleAlertsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewToggleAlertsParamsWithHTTPClient(client *http.Client) *ToggleAlertsParams { - var () return &ToggleAlertsParams{ HTTPClient: client, } } -/*ToggleAlertsParams contains all the parameters to send to the API endpoint -for the toggle alerts operation typically these are written to a http.Request +/* ToggleAlertsParams contains all the parameters to send to the API endpoint + for the toggle alerts operation. + + Typically these are written to a http.Request. */ type ToggleAlertsParams struct { - /*Body*/ + // Body. Body ToggleAlertsBody timeout time.Duration @@ -68,6 +67,21 @@ type ToggleAlertsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the toggle alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleAlertsParams) WithDefaults() *ToggleAlertsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the toggle alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleAlertsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the toggle alerts params func (o *ToggleAlertsParams) WithTimeout(timeout time.Duration) *ToggleAlertsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ToggleAlertsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/alerts/toggle_alerts_responses.go b/api/managementpb/ia/json/client/alerts/toggle_alerts_responses.go index f9f69d6ac3..241aaeb38b 100644 --- a/api/managementpb/ia/json/client/alerts/toggle_alerts_responses.go +++ b/api/managementpb/ia/json/client/alerts/toggle_alerts_responses.go @@ -6,6 +6,7 @@ package alerts // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewToggleAlertsOK() *ToggleAlertsOK { return &ToggleAlertsOK{} } -/*ToggleAlertsOK handles this case with default header values. +/* ToggleAlertsOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ToggleAlertsOK struct { func (o *ToggleAlertsOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Alerts/Toggle][%d] toggleAlertsOk %+v", 200, o.Payload) } - func (o *ToggleAlertsOK) GetPayload() interface{} { return o.Payload } @@ -82,7 +82,7 @@ func NewToggleAlertsDefault(code int) *ToggleAlertsDefault { } } -/*ToggleAlertsDefault handles this case with default header values. +/* ToggleAlertsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *ToggleAlertsDefault) Code() int { func (o *ToggleAlertsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Alerts/Toggle][%d] ToggleAlerts default %+v", o._statusCode, o.Payload) } - func (o *ToggleAlertsDefault) GetPayload() *ToggleAlertsDefaultBody { return o.Payload } @@ -183,7 +182,6 @@ func (o *ToggleAlertsBody) validateSilencedEnum(path, location string, value str } func (o *ToggleAlertsBody) validateSilenced(formats strfmt.Registry) error { - if swag.IsZero(o.Silenced) { // not required return nil } @@ -196,6 +194,11 @@ func (o *ToggleAlertsBody) validateSilenced(formats strfmt.Registry) error { return nil } +// ContextValidate validates this toggle alerts body based on context it is used +func (o *ToggleAlertsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ToggleAlertsBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -229,7 +232,7 @@ type ToggleAlertsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ToggleAlertsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this toggle alerts default body @@ -247,7 +250,6 @@ func (o *ToggleAlertsDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ToggleAlertsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -261,6 +263,42 @@ func (o *ToggleAlertsDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ToggleAlerts default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ToggleAlerts default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this toggle alerts default body based on the context it is used +func (o *ToggleAlertsDefaultBody) 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 *ToggleAlertsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ToggleAlerts default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ToggleAlerts default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -288,3 +326,44 @@ func (o *ToggleAlertsDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*ToggleAlertsDefaultBodyDetailsItems0 toggle alerts default body details items0 +swagger:model ToggleAlertsDefaultBodyDetailsItems0 +*/ +type ToggleAlertsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this toggle alerts default body details items0 +func (o *ToggleAlertsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this toggle alerts default body details items0 based on context it is used +func (o *ToggleAlertsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ToggleAlertsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ToggleAlertsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ToggleAlertsDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/ia/json/client/channels/add_channel_parameters.go b/api/managementpb/ia/json/client/channels/add_channel_parameters.go index 596880f6c5..3c499aadd0 100644 --- a/api/managementpb/ia/json/client/channels/add_channel_parameters.go +++ b/api/managementpb/ia/json/client/channels/add_channel_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddChannelParams creates a new AddChannelParams object -// with the default values initialized. +// NewAddChannelParams creates a new AddChannelParams 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 NewAddChannelParams() *AddChannelParams { - var () return &AddChannelParams{ - timeout: cr.DefaultTimeout, } } // NewAddChannelParamsWithTimeout creates a new AddChannelParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddChannelParamsWithTimeout(timeout time.Duration) *AddChannelParams { - var () return &AddChannelParams{ - timeout: timeout, } } // NewAddChannelParamsWithContext creates a new AddChannelParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddChannelParamsWithContext(ctx context.Context) *AddChannelParams { - var () return &AddChannelParams{ - Context: ctx, } } // NewAddChannelParamsWithHTTPClient creates a new AddChannelParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddChannelParamsWithHTTPClient(client *http.Client) *AddChannelParams { - var () return &AddChannelParams{ HTTPClient: client, } } -/*AddChannelParams contains all the parameters to send to the API endpoint -for the add channel operation typically these are written to a http.Request +/* AddChannelParams contains all the parameters to send to the API endpoint + for the add channel operation. + + Typically these are written to a http.Request. */ type AddChannelParams struct { - /*Body*/ + // Body. Body AddChannelBody timeout time.Duration @@ -68,6 +67,21 @@ type AddChannelParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add channel params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddChannelParams) WithDefaults() *AddChannelParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add channel params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddChannelParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add channel params func (o *AddChannelParams) WithTimeout(timeout time.Duration) *AddChannelParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddChannelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/channels/add_channel_responses.go b/api/managementpb/ia/json/client/channels/add_channel_responses.go index 37302bc5ec..a998da4cf1 100644 --- a/api/managementpb/ia/json/client/channels/add_channel_responses.go +++ b/api/managementpb/ia/json/client/channels/add_channel_responses.go @@ -6,6 +6,7 @@ package channels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddChannelOK() *AddChannelOK { return &AddChannelOK{} } -/*AddChannelOK handles this case with default header values. +/* AddChannelOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddChannelOK struct { func (o *AddChannelOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Channels/Add][%d] addChannelOk %+v", 200, o.Payload) } - func (o *AddChannelOK) GetPayload() *AddChannelOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewAddChannelDefault(code int) *AddChannelDefault { } } -/*AddChannelDefault handles this case with default header values. +/* AddChannelDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *AddChannelDefault) Code() int { func (o *AddChannelDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Channels/Add][%d] AddChannel default %+v", o._statusCode, o.Payload) } - func (o *AddChannelDefault) GetPayload() *AddChannelDefaultBody { return o.Payload } @@ -168,7 +167,6 @@ func (o *AddChannelBody) Validate(formats strfmt.Registry) error { } func (o *AddChannelBody) validateEmailConfig(formats strfmt.Registry) error { - if swag.IsZero(o.EmailConfig) { // not required return nil } @@ -177,6 +175,8 @@ func (o *AddChannelBody) validateEmailConfig(formats strfmt.Registry) error { if err := o.EmailConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "email_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "email_config") } return err } @@ -186,7 +186,6 @@ func (o *AddChannelBody) validateEmailConfig(formats strfmt.Registry) error { } func (o *AddChannelBody) validatePagerdutyConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PagerdutyConfig) { // not required return nil } @@ -195,6 +194,8 @@ func (o *AddChannelBody) validatePagerdutyConfig(formats strfmt.Registry) error if err := o.PagerdutyConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "pagerduty_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pagerduty_config") } return err } @@ -204,7 +205,6 @@ func (o *AddChannelBody) validatePagerdutyConfig(formats strfmt.Registry) error } func (o *AddChannelBody) validateSlackConfig(formats strfmt.Registry) error { - if swag.IsZero(o.SlackConfig) { // not required return nil } @@ -213,6 +213,8 @@ func (o *AddChannelBody) validateSlackConfig(formats strfmt.Registry) error { if err := o.SlackConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "slack_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "slack_config") } return err } @@ -222,7 +224,6 @@ func (o *AddChannelBody) validateSlackConfig(formats strfmt.Registry) error { } func (o *AddChannelBody) validateWebhookConfig(formats strfmt.Registry) error { - if swag.IsZero(o.WebhookConfig) { // not required return nil } @@ -231,6 +232,98 @@ func (o *AddChannelBody) validateWebhookConfig(formats strfmt.Registry) error { if err := o.WebhookConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "webhook_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add channel body based on the context it is used +func (o *AddChannelBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateEmailConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePagerdutyConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSlackConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateWebhookConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddChannelBody) contextValidateEmailConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.EmailConfig != nil { + if err := o.EmailConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "email_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "email_config") + } + return err + } + } + + return nil +} + +func (o *AddChannelBody) contextValidatePagerdutyConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PagerdutyConfig != nil { + if err := o.PagerdutyConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "pagerduty_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pagerduty_config") + } + return err + } + } + + return nil +} + +func (o *AddChannelBody) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.SlackConfig != nil { + if err := o.SlackConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "slack_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "slack_config") + } + return err + } + } + + return nil +} + +func (o *AddChannelBody) contextValidateWebhookConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.WebhookConfig != nil { + if err := o.WebhookConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "webhook_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config") } return err } @@ -272,7 +365,7 @@ type AddChannelDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddChannelDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add channel default body @@ -290,7 +383,6 @@ func (o *AddChannelDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddChannelDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -304,6 +396,42 @@ func (o *AddChannelDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddChannel default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddChannel default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add channel default body based on the context it is used +func (o *AddChannelDefaultBody) 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 *AddChannelDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddChannel default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddChannel default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -332,6 +460,47 @@ func (o *AddChannelDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddChannelDefaultBodyDetailsItems0 add channel default body details items0 +swagger:model AddChannelDefaultBodyDetailsItems0 +*/ +type AddChannelDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add channel default body details items0 +func (o *AddChannelDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add channel default body details items0 based on context it is used +func (o *AddChannelDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddChannelDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddChannelDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddChannelDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddChannelOKBody add channel OK body swagger:model AddChannelOKBody */ @@ -346,6 +515,11 @@ func (o *AddChannelOKBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add channel OK body based on context it is used +func (o *AddChannelOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddChannelOKBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -381,6 +555,11 @@ func (o *AddChannelParamsBodyEmailConfig) Validate(formats strfmt.Registry) erro return nil } +// ContextValidate validates this add channel params body email config based on context it is used +func (o *AddChannelParamsBodyEmailConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddChannelParamsBodyEmailConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -419,6 +598,11 @@ func (o *AddChannelParamsBodyPagerdutyConfig) Validate(formats strfmt.Registry) return nil } +// ContextValidate validates this add channel params body pagerduty config based on context it is used +func (o *AddChannelParamsBodyPagerdutyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddChannelParamsBodyPagerdutyConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -454,6 +638,11 @@ func (o *AddChannelParamsBodySlackConfig) Validate(formats strfmt.Registry) erro return nil } +// ContextValidate validates this add channel params body slack config based on context it is used +func (o *AddChannelParamsBodySlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddChannelParamsBodySlackConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -505,7 +694,6 @@ func (o *AddChannelParamsBodyWebhookConfig) Validate(formats strfmt.Registry) er } func (o *AddChannelParamsBodyWebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { - if swag.IsZero(o.HTTPConfig) { // not required return nil } @@ -514,6 +702,38 @@ func (o *AddChannelParamsBodyWebhookConfig) validateHTTPConfig(formats strfmt.Re if err := o.HTTPConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add channel params body webhook config based on the context it is used +func (o *AddChannelParamsBodyWebhookConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHTTPConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddChannelParamsBodyWebhookConfig) contextValidateHTTPConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.HTTPConfig != nil { + if err := o.HTTPConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config") } return err } @@ -580,7 +800,6 @@ func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) Validate(formats strfmt.Re } func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { - if swag.IsZero(o.BasicAuth) { // not required return nil } @@ -589,6 +808,8 @@ func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) validateBasicAuth(formats if err := o.BasicAuth.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") } return err } @@ -598,7 +819,6 @@ func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) validateBasicAuth(formats } func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { - if swag.IsZero(o.TLSConfig) { // not required return nil } @@ -607,6 +827,58 @@ func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) validateTLSConfig(formats if err := o.TLSConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add channel params body webhook config HTTP config based on the context it is used +func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateBasicAuth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateTLSConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { + + if o.BasicAuth != nil { + if err := o.BasicAuth.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") + } + return err + } + } + + return nil +} + +func (o *AddChannelParamsBodyWebhookConfigHTTPConfig) contextValidateTLSConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.TLSConfig != nil { + if err := o.TLSConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") } return err } @@ -653,6 +925,11 @@ func (o *AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) Validate(formats return nil } +// ContextValidate validates this add channel params body webhook config HTTP config basic auth based on context it is used +func (o *AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { if o == nil { @@ -713,44 +990,13 @@ func (o *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) Validate(formats return nil } -// MarshalBinary interface implementation -func (o *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { - var res AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add channel params body webhook config HTTP config TLS config based on context it is used +func (o *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -758,8 +1004,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { + var res AddChannelParamsBodyWebhookConfigHTTPConfigTLSConfig if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/ia/json/client/channels/change_channel_parameters.go b/api/managementpb/ia/json/client/channels/change_channel_parameters.go index d84b1f73f7..52ff44b17b 100644 --- a/api/managementpb/ia/json/client/channels/change_channel_parameters.go +++ b/api/managementpb/ia/json/client/channels/change_channel_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeChannelParams creates a new ChangeChannelParams object -// with the default values initialized. +// NewChangeChannelParams creates a new ChangeChannelParams 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 NewChangeChannelParams() *ChangeChannelParams { - var () return &ChangeChannelParams{ - timeout: cr.DefaultTimeout, } } // NewChangeChannelParamsWithTimeout creates a new ChangeChannelParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeChannelParamsWithTimeout(timeout time.Duration) *ChangeChannelParams { - var () return &ChangeChannelParams{ - timeout: timeout, } } // NewChangeChannelParamsWithContext creates a new ChangeChannelParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeChannelParamsWithContext(ctx context.Context) *ChangeChannelParams { - var () return &ChangeChannelParams{ - Context: ctx, } } // NewChangeChannelParamsWithHTTPClient creates a new ChangeChannelParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeChannelParamsWithHTTPClient(client *http.Client) *ChangeChannelParams { - var () return &ChangeChannelParams{ HTTPClient: client, } } -/*ChangeChannelParams contains all the parameters to send to the API endpoint -for the change channel operation typically these are written to a http.Request +/* ChangeChannelParams contains all the parameters to send to the API endpoint + for the change channel operation. + + Typically these are written to a http.Request. */ type ChangeChannelParams struct { - /*Body*/ + // Body. Body ChangeChannelBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeChannelParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change channel params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeChannelParams) WithDefaults() *ChangeChannelParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change channel params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeChannelParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change channel params func (o *ChangeChannelParams) WithTimeout(timeout time.Duration) *ChangeChannelParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeChannelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/channels/change_channel_responses.go b/api/managementpb/ia/json/client/channels/change_channel_responses.go index 8708b7f9f3..eab7128d34 100644 --- a/api/managementpb/ia/json/client/channels/change_channel_responses.go +++ b/api/managementpb/ia/json/client/channels/change_channel_responses.go @@ -6,6 +6,7 @@ package channels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewChangeChannelOK() *ChangeChannelOK { return &ChangeChannelOK{} } -/*ChangeChannelOK handles this case with default header values. +/* ChangeChannelOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ChangeChannelOK struct { func (o *ChangeChannelOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Channels/Change][%d] changeChannelOk %+v", 200, o.Payload) } - func (o *ChangeChannelOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewChangeChannelDefault(code int) *ChangeChannelDefault { } } -/*ChangeChannelDefault handles this case with default header values. +/* ChangeChannelDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *ChangeChannelDefault) Code() int { func (o *ChangeChannelDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Channels/Change][%d] ChangeChannel default %+v", o._statusCode, o.Payload) } - func (o *ChangeChannelDefault) GetPayload() *ChangeChannelDefaultBody { return o.Payload } @@ -169,7 +168,6 @@ func (o *ChangeChannelBody) Validate(formats strfmt.Registry) error { } func (o *ChangeChannelBody) validateEmailConfig(formats strfmt.Registry) error { - if swag.IsZero(o.EmailConfig) { // not required return nil } @@ -178,6 +176,8 @@ func (o *ChangeChannelBody) validateEmailConfig(formats strfmt.Registry) error { if err := o.EmailConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "email_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "email_config") } return err } @@ -187,7 +187,6 @@ func (o *ChangeChannelBody) validateEmailConfig(formats strfmt.Registry) error { } func (o *ChangeChannelBody) validatePagerdutyConfig(formats strfmt.Registry) error { - if swag.IsZero(o.PagerdutyConfig) { // not required return nil } @@ -196,6 +195,8 @@ func (o *ChangeChannelBody) validatePagerdutyConfig(formats strfmt.Registry) err if err := o.PagerdutyConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "pagerduty_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pagerduty_config") } return err } @@ -205,7 +206,6 @@ func (o *ChangeChannelBody) validatePagerdutyConfig(formats strfmt.Registry) err } func (o *ChangeChannelBody) validateSlackConfig(formats strfmt.Registry) error { - if swag.IsZero(o.SlackConfig) { // not required return nil } @@ -214,6 +214,8 @@ func (o *ChangeChannelBody) validateSlackConfig(formats strfmt.Registry) error { if err := o.SlackConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "slack_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "slack_config") } return err } @@ -223,7 +225,6 @@ func (o *ChangeChannelBody) validateSlackConfig(formats strfmt.Registry) error { } func (o *ChangeChannelBody) validateWebhookConfig(formats strfmt.Registry) error { - if swag.IsZero(o.WebhookConfig) { // not required return nil } @@ -232,6 +233,98 @@ func (o *ChangeChannelBody) validateWebhookConfig(formats strfmt.Registry) error if err := o.WebhookConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "webhook_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change channel body based on the context it is used +func (o *ChangeChannelBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateEmailConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePagerdutyConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSlackConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateWebhookConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeChannelBody) contextValidateEmailConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.EmailConfig != nil { + if err := o.EmailConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "email_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "email_config") + } + return err + } + } + + return nil +} + +func (o *ChangeChannelBody) contextValidatePagerdutyConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PagerdutyConfig != nil { + if err := o.PagerdutyConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "pagerduty_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "pagerduty_config") + } + return err + } + } + + return nil +} + +func (o *ChangeChannelBody) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.SlackConfig != nil { + if err := o.SlackConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "slack_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "slack_config") + } + return err + } + } + + return nil +} + +func (o *ChangeChannelBody) contextValidateWebhookConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.WebhookConfig != nil { + if err := o.WebhookConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "webhook_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config") } return err } @@ -273,7 +366,7 @@ type ChangeChannelDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeChannelDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change channel default body @@ -291,7 +384,6 @@ func (o *ChangeChannelDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ChangeChannelDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -305,6 +397,42 @@ func (o *ChangeChannelDefaultBody) validateDetails(formats strfmt.Registry) erro if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeChannel default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeChannel default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change channel default body based on the context it is used +func (o *ChangeChannelDefaultBody) 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 *ChangeChannelDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeChannel default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeChannel default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -333,6 +461,47 @@ func (o *ChangeChannelDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangeChannelDefaultBodyDetailsItems0 change channel default body details items0 +swagger:model ChangeChannelDefaultBodyDetailsItems0 +*/ +type ChangeChannelDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this change channel default body details items0 +func (o *ChangeChannelDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change channel default body details items0 based on context it is used +func (o *ChangeChannelDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeChannelDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeChannelDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeChannelDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ChangeChannelParamsBodyEmailConfig EmailConfig represents email configuration. swagger:model ChangeChannelParamsBodyEmailConfig */ @@ -350,6 +519,11 @@ func (o *ChangeChannelParamsBodyEmailConfig) Validate(formats strfmt.Registry) e return nil } +// ContextValidate validates this change channel params body email config based on context it is used +func (o *ChangeChannelParamsBodyEmailConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeChannelParamsBodyEmailConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -388,6 +562,11 @@ func (o *ChangeChannelParamsBodyPagerdutyConfig) Validate(formats strfmt.Registr return nil } +// ContextValidate validates this change channel params body pagerduty config based on context it is used +func (o *ChangeChannelParamsBodyPagerdutyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeChannelParamsBodyPagerdutyConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -423,6 +602,11 @@ func (o *ChangeChannelParamsBodySlackConfig) Validate(formats strfmt.Registry) e return nil } +// ContextValidate validates this change channel params body slack config based on context it is used +func (o *ChangeChannelParamsBodySlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeChannelParamsBodySlackConfig) MarshalBinary() ([]byte, error) { if o == nil { @@ -474,7 +658,6 @@ func (o *ChangeChannelParamsBodyWebhookConfig) Validate(formats strfmt.Registry) } func (o *ChangeChannelParamsBodyWebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { - if swag.IsZero(o.HTTPConfig) { // not required return nil } @@ -483,6 +666,38 @@ func (o *ChangeChannelParamsBodyWebhookConfig) validateHTTPConfig(formats strfmt if err := o.HTTPConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change channel params body webhook config based on the context it is used +func (o *ChangeChannelParamsBodyWebhookConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHTTPConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeChannelParamsBodyWebhookConfig) contextValidateHTTPConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.HTTPConfig != nil { + if err := o.HTTPConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config") } return err } @@ -549,7 +764,6 @@ func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) Validate(formats strfmt } func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { - if swag.IsZero(o.BasicAuth) { // not required return nil } @@ -558,6 +772,8 @@ func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) validateBasicAuth(forma if err := o.BasicAuth.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") } return err } @@ -567,7 +783,6 @@ func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) validateBasicAuth(forma } func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { - if swag.IsZero(o.TLSConfig) { // not required return nil } @@ -576,6 +791,58 @@ func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) validateTLSConfig(forma if err := o.TLSConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this change channel params body webhook config HTTP config based on the context it is used +func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateBasicAuth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateTLSConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { + + if o.BasicAuth != nil { + if err := o.BasicAuth.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "basic_auth") + } + return err + } + } + + return nil +} + +func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfig) contextValidateTLSConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.TLSConfig != nil { + if err := o.TLSConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "webhook_config" + "." + "http_config" + "." + "tls_config") } return err } @@ -622,6 +889,11 @@ func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) Validate(forma return nil } +// ContextValidate validates this change channel params body webhook config HTTP config basic auth based on context it is used +func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { if o == nil { @@ -682,6 +954,11 @@ func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) Validate(forma return nil } +// ContextValidate validates this change channel params body webhook config HTTP config TLS config based on context it is used +func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeChannelParamsBodyWebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/ia/json/client/channels/channels_client.go b/api/managementpb/ia/json/client/channels/channels_client.go index a00b398558..3a7a378ee6 100644 --- a/api/managementpb/ia/json/client/channels/channels_client.go +++ b/api/managementpb/ia/json/client/channels/channels_client.go @@ -23,15 +23,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddChannel(params *AddChannelParams) (*AddChannelOK, error) + AddChannel(params *AddChannelParams, opts ...ClientOption) (*AddChannelOK, error) - ChangeChannel(params *ChangeChannelParams) (*ChangeChannelOK, error) + ChangeChannel(params *ChangeChannelParams, opts ...ClientOption) (*ChangeChannelOK, error) - ListChannels(params *ListChannelsParams) (*ListChannelsOK, error) + ListChannels(params *ListChannelsParams, opts ...ClientOption) (*ListChannelsOK, error) - RemoveChannel(params *RemoveChannelParams) (*RemoveChannelOK, error) + RemoveChannel(params *RemoveChannelParams, opts ...ClientOption) (*RemoveChannelOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { /* AddChannel adds channel adds notification channel */ -func (a *Client) AddChannel(params *AddChannelParams) (*AddChannelOK, error) { +func (a *Client) AddChannel(params *AddChannelParams, opts ...ClientOption) (*AddChannelOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddChannelParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddChannel", Method: "POST", PathPattern: "/v1/management/ia/Channels/Add", @@ -56,7 +58,12 @@ func (a *Client) AddChannel(params *AddChannelParams) (*AddChannelOK, error) { Reader: &AddChannelReader{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 } @@ -72,13 +79,12 @@ func (a *Client) AddChannel(params *AddChannelParams) (*AddChannelOK, error) { /* ChangeChannel changes channel changes notification channel */ -func (a *Client) ChangeChannel(params *ChangeChannelParams) (*ChangeChannelOK, error) { +func (a *Client) ChangeChannel(params *ChangeChannelParams, opts ...ClientOption) (*ChangeChannelOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeChannelParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeChannel", Method: "POST", PathPattern: "/v1/management/ia/Channels/Change", @@ -89,7 +95,12 @@ func (a *Client) ChangeChannel(params *ChangeChannelParams) (*ChangeChannelOK, e Reader: &ChangeChannelReader{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 } @@ -105,13 +116,12 @@ func (a *Client) ChangeChannel(params *ChangeChannelParams) (*ChangeChannelOK, e /* ListChannels lists channels returns a list of all notifation channels */ -func (a *Client) ListChannels(params *ListChannelsParams) (*ListChannelsOK, error) { +func (a *Client) ListChannels(params *ListChannelsParams, opts ...ClientOption) (*ListChannelsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListChannelsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListChannels", Method: "POST", PathPattern: "/v1/management/ia/Channels/List", @@ -122,7 +132,12 @@ func (a *Client) ListChannels(params *ListChannelsParams) (*ListChannelsOK, erro Reader: &ListChannelsReader{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 } @@ -138,13 +153,12 @@ func (a *Client) ListChannels(params *ListChannelsParams) (*ListChannelsOK, erro /* RemoveChannel removes channel removes notification channel */ -func (a *Client) RemoveChannel(params *RemoveChannelParams) (*RemoveChannelOK, error) { +func (a *Client) RemoveChannel(params *RemoveChannelParams, opts ...ClientOption) (*RemoveChannelOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRemoveChannelParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RemoveChannel", Method: "POST", PathPattern: "/v1/management/ia/Channels/Remove", @@ -155,7 +169,12 @@ func (a *Client) RemoveChannel(params *RemoveChannelParams) (*RemoveChannelOK, e Reader: &RemoveChannelReader{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 } diff --git a/api/managementpb/ia/json/client/channels/list_channels_parameters.go b/api/managementpb/ia/json/client/channels/list_channels_parameters.go index fdedf66fdc..7fc75f703d 100644 --- a/api/managementpb/ia/json/client/channels/list_channels_parameters.go +++ b/api/managementpb/ia/json/client/channels/list_channels_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListChannelsParams creates a new ListChannelsParams object -// with the default values initialized. +// NewListChannelsParams creates a new ListChannelsParams 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 NewListChannelsParams() *ListChannelsParams { - var () return &ListChannelsParams{ - timeout: cr.DefaultTimeout, } } // NewListChannelsParamsWithTimeout creates a new ListChannelsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListChannelsParamsWithTimeout(timeout time.Duration) *ListChannelsParams { - var () return &ListChannelsParams{ - timeout: timeout, } } // NewListChannelsParamsWithContext creates a new ListChannelsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListChannelsParamsWithContext(ctx context.Context) *ListChannelsParams { - var () return &ListChannelsParams{ - Context: ctx, } } // NewListChannelsParamsWithHTTPClient creates a new ListChannelsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListChannelsParamsWithHTTPClient(client *http.Client) *ListChannelsParams { - var () return &ListChannelsParams{ HTTPClient: client, } } -/*ListChannelsParams contains all the parameters to send to the API endpoint -for the list channels operation typically these are written to a http.Request +/* ListChannelsParams contains all the parameters to send to the API endpoint + for the list channels operation. + + Typically these are written to a http.Request. */ type ListChannelsParams struct { - /*Body*/ + // Body. Body ListChannelsBody timeout time.Duration @@ -68,6 +67,21 @@ type ListChannelsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list channels params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChannelsParams) WithDefaults() *ListChannelsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list channels params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChannelsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list channels params func (o *ListChannelsParams) WithTimeout(timeout time.Duration) *ListChannelsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ListChannelsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/channels/list_channels_responses.go b/api/managementpb/ia/json/client/channels/list_channels_responses.go index f69e71d8a0..a75db0c010 100644 --- a/api/managementpb/ia/json/client/channels/list_channels_responses.go +++ b/api/managementpb/ia/json/client/channels/list_channels_responses.go @@ -6,6 +6,7 @@ package channels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewListChannelsOK() *ListChannelsOK { return &ListChannelsOK{} } -/*ListChannelsOK handles this case with default header values. +/* ListChannelsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ListChannelsOK struct { func (o *ListChannelsOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Channels/List][%d] listChannelsOk %+v", 200, o.Payload) } - func (o *ListChannelsOK) GetPayload() *ListChannelsOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewListChannelsDefault(code int) *ListChannelsDefault { } } -/*ListChannelsDefault handles this case with default header values. +/* ListChannelsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *ListChannelsDefault) Code() int { func (o *ListChannelsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Channels/List][%d] ListChannels default %+v", o._statusCode, o.Payload) } - func (o *ListChannelsDefault) GetPayload() *ListChannelsDefaultBody { return o.Payload } @@ -117,50 +116,20 @@ func (o *ListChannelsDefault) readResponse(response runtime.ClientResponse, cons return nil } -/*ChannelsItems0 Channel represents a single Notification Channel. -swagger:model ChannelsItems0 +/*ListChannelsBody list channels body +swagger:model ListChannelsBody */ -type ChannelsItems0 struct { - - // Machine-readable ID. - ChannelID string `json:"channel_id,omitempty"` - - // Short human-readable summary. - Summary string `json:"summary,omitempty"` - - // True if that channel is disabled. - Disabled bool `json:"disabled,omitempty"` - - // email config - EmailConfig *ChannelsItems0EmailConfig `json:"email_config,omitempty"` - - // pagerduty config - PagerdutyConfig *ChannelsItems0PagerdutyConfig `json:"pagerduty_config,omitempty"` - - // slack config - SlackConfig *ChannelsItems0SlackConfig `json:"slack_config,omitempty"` +type ListChannelsBody struct { - // webhook config - WebhookConfig *ChannelsItems0WebhookConfig `json:"webhook_config,omitempty"` + // page params + PageParams *ListChannelsParamsBodyPageParams `json:"page_params,omitempty"` } -// Validate validates this channels items0 -func (o *ChannelsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list channels body +func (o *ListChannelsBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateEmailConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePagerdutyConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSlackConfig(formats); err != nil { - res = append(res, err) - } - - if err := o.validateWebhookConfig(formats); err != nil { + if err := o.validatePageParams(formats); err != nil { res = append(res, err) } @@ -170,34 +139,17 @@ func (o *ChannelsItems0) Validate(formats strfmt.Registry) error { return nil } -func (o *ChannelsItems0) validateEmailConfig(formats strfmt.Registry) error { - - if swag.IsZero(o.EmailConfig) { // not required - return nil - } - - if o.EmailConfig != nil { - if err := o.EmailConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("email_config") - } - return err - } - } - - return nil -} - -func (o *ChannelsItems0) validatePagerdutyConfig(formats strfmt.Registry) error { - - if swag.IsZero(o.PagerdutyConfig) { // not required +func (o *ListChannelsBody) validatePageParams(formats strfmt.Registry) error { + if swag.IsZero(o.PageParams) { // not required return nil } - if o.PagerdutyConfig != nil { - if err := o.PagerdutyConfig.Validate(formats); err != nil { + if o.PageParams != nil { + if err := o.PageParams.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagerduty_config") + return ve.ValidateName("body" + "." + "page_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "page_params") } return err } @@ -206,34 +158,28 @@ func (o *ChannelsItems0) validatePagerdutyConfig(formats strfmt.Registry) error return nil } -func (o *ChannelsItems0) validateSlackConfig(formats strfmt.Registry) error { +// ContextValidate validate this list channels body based on the context it is used +func (o *ListChannelsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.SlackConfig) { // not required - return nil + if err := o.contextValidatePageParams(ctx, formats); err != nil { + res = append(res, err) } - if o.SlackConfig != nil { - if err := o.SlackConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("slack_config") - } - return err - } + if len(res) > 0 { + return errors.CompositeValidationError(res...) } - return nil } -func (o *ChannelsItems0) validateWebhookConfig(formats strfmt.Registry) error { +func (o *ListChannelsBody) contextValidatePageParams(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(o.WebhookConfig) { // not required - return nil - } - - if o.WebhookConfig != nil { - if err := o.WebhookConfig.Validate(formats); err != nil { + if o.PageParams != nil { + if err := o.PageParams.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config") + return ve.ValidateName("body" + "." + "page_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "page_params") } return err } @@ -243,7 +189,7 @@ func (o *ChannelsItems0) validateWebhookConfig(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (o *ChannelsItems0) MarshalBinary() ([]byte, error) { +func (o *ListChannelsBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -251,8 +197,8 @@ func (o *ChannelsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ChannelsItems0) UnmarshalBinary(b []byte) error { - var res ChannelsItems0 +func (o *ListChannelsBody) UnmarshalBinary(b []byte) error { + var res ListChannelsBody if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -260,98 +206,100 @@ func (o *ChannelsItems0) UnmarshalBinary(b []byte) error { return nil } -/*ChannelsItems0EmailConfig EmailConfig represents email configuration. -swagger:model ChannelsItems0EmailConfig +/*ListChannelsDefaultBody list channels default body +swagger:model ListChannelsDefaultBody */ -type ChannelsItems0EmailConfig struct { +type ListChannelsDefaultBody struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` + // error + Error string `json:"error,omitempty"` - // to - To []string `json:"to"` -} + // code + Code int32 `json:"code,omitempty"` -// Validate validates this channels items0 email config -func (o *ChannelsItems0EmailConfig) Validate(formats strfmt.Registry) error { - return nil + // message + Message string `json:"message,omitempty"` + + // details + Details []*ListChannelsDefaultBodyDetailsItems0 `json:"details"` } -// MarshalBinary interface implementation -func (o *ChannelsItems0EmailConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil +// Validate validates this list channels default body +func (o *ListChannelsDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) } - return swag.WriteJSON(o) -} -// UnmarshalBinary interface implementation -func (o *ChannelsItems0EmailConfig) UnmarshalBinary(b []byte) error { - var res ChannelsItems0EmailConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err + if len(res) > 0 { + return errors.CompositeValidationError(res...) } - *o = res return nil } -/*ChannelsItems0PagerdutyConfig PagerDutyConfig represents PagerDuty configuration. -swagger:model ChannelsItems0PagerdutyConfig -*/ -type ChannelsItems0PagerdutyConfig struct { +func (o *ListChannelsDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil + } - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } - // The PagerDuty key for "Events API v2" integration type. Exactly one key should be set. - RoutingKey string `json:"routing_key,omitempty"` + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListChannels default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListChannels default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } - // The PagerDuty key for "Prometheus" integration type. Exactly one key should be set. - ServiceKey string `json:"service_key,omitempty"` -} + } -// Validate validates this channels items0 pagerduty config -func (o *ChannelsItems0PagerdutyConfig) Validate(formats strfmt.Registry) error { return nil } -// MarshalBinary interface implementation -func (o *ChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil +// ContextValidate validate this list channels default body based on the context it is used +func (o *ListChannelsDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateDetails(ctx, formats); err != nil { + res = append(res, err) } - return swag.WriteJSON(o) -} -// UnmarshalBinary interface implementation -func (o *ChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte) error { - var res ChannelsItems0PagerdutyConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err + if len(res) > 0 { + return errors.CompositeValidationError(res...) } - *o = res return nil } -/*ChannelsItems0SlackConfig SlackConfig represents Slack configuration. -swagger:model ChannelsItems0SlackConfig -*/ -type ChannelsItems0SlackConfig struct { +func (o *ListChannelsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` + for i := 0; i < len(o.Details); i++ { - // channel - Channel string `json:"channel,omitempty"` -} + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListChannels default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListChannels default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } -// Validate validates this channels items0 slack config -func (o *ChannelsItems0SlackConfig) Validate(formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { +func (o *ListChannelsDefaultBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -359,8 +307,8 @@ func (o *ChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { - var res ChannelsItems0SlackConfig +func (o *ListChannelsDefaultBody) UnmarshalBinary(b []byte) error { + var res ListChannelsDefaultBody if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -368,58 +316,31 @@ func (o *ChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { return nil } -/*ChannelsItems0WebhookConfig WebhookConfig represents webhook configuration. -swagger:model ChannelsItems0WebhookConfig +/*ListChannelsDefaultBodyDetailsItems0 list channels default body details items0 +swagger:model ListChannelsDefaultBodyDetailsItems0 */ -type ChannelsItems0WebhookConfig struct { +type ListChannelsDefaultBodyDetailsItems0 struct { - // send resolved - SendResolved bool `json:"send_resolved,omitempty"` - - // url - URL string `json:"url,omitempty"` - - // max alerts - MaxAlerts int32 `json:"max_alerts,omitempty"` + // type url + TypeURL string `json:"type_url,omitempty"` - // http config - HTTPConfig *ChannelsItems0WebhookConfigHTTPConfig `json:"http_config,omitempty"` + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this channels items0 webhook config -func (o *ChannelsItems0WebhookConfig) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateHTTPConfig(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } +// Validate validates this list channels default body details items0 +func (o *ListChannelsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { return nil } -func (o *ChannelsItems0WebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { - - if swag.IsZero(o.HTTPConfig) { // not required - return nil - } - - if o.HTTPConfig != nil { - if err := o.HTTPConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config") - } - return err - } - } - +// ContextValidate validates this list channels default body details items0 based on context it is used +func (o *ListChannelsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) { +func (o *ListChannelsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -427,8 +348,8 @@ func (o *ChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error { - var res ChannelsItems0WebhookConfig +func (o *ListChannelsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ListChannelsDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -436,36 +357,27 @@ func (o *ChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error { return nil } -/*ChannelsItems0WebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. -swagger:model ChannelsItems0WebhookConfigHTTPConfig +/*ListChannelsOKBody list channels OK body +swagger:model ListChannelsOKBody */ -type ChannelsItems0WebhookConfigHTTPConfig struct { - - // bearer token - BearerToken string `json:"bearer_token,omitempty"` - - // bearer token file - BearerTokenFile string `json:"bearer_token_file,omitempty"` - - // proxy url - ProxyURL string `json:"proxy_url,omitempty"` +type ListChannelsOKBody struct { - // basic auth - BasicAuth *ChannelsItems0WebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` + // channels + Channels []*ListChannelsOKBodyChannelsItems0 `json:"channels"` - // tls config - TLSConfig *ChannelsItems0WebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` + // totals + Totals *ListChannelsOKBodyTotals `json:"totals,omitempty"` } -// Validate validates this channels items0 webhook config HTTP config -func (o *ChannelsItems0WebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list channels OK body +func (o *ListChannelsOKBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateBasicAuth(formats); err != nil { + if err := o.validateChannels(formats); err != nil { res = append(res, err) } - if err := o.validateTLSConfig(formats); err != nil { + if err := o.validateTotals(formats); err != nil { res = append(res, err) } @@ -475,34 +387,97 @@ func (o *ChannelsItems0WebhookConfigHTTPConfig) Validate(formats strfmt.Registry return nil } -func (o *ChannelsItems0WebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { - - if swag.IsZero(o.BasicAuth) { // not required +func (o *ListChannelsOKBody) validateChannels(formats strfmt.Registry) error { + if swag.IsZero(o.Channels) { // not required return nil } - if o.BasicAuth != nil { - if err := o.BasicAuth.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") - } - return err + for i := 0; i < len(o.Channels); i++ { + if swag.IsZero(o.Channels[i]) { // not required + continue } - } - - return nil -} -func (o *ChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { + if o.Channels[i] != nil { + if err := o.Channels[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listChannelsOk" + "." + "channels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listChannelsOk" + "." + "channels" + "." + strconv.Itoa(i)) + } + return err + } + } - if swag.IsZero(o.TLSConfig) { // not required + } + + return nil +} + +func (o *ListChannelsOKBody) validateTotals(formats strfmt.Registry) error { + if swag.IsZero(o.Totals) { // not required return nil } - if o.TLSConfig != nil { - if err := o.TLSConfig.Validate(formats); err != nil { + if o.Totals != nil { + if err := o.Totals.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + return ve.ValidateName("listChannelsOk" + "." + "totals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listChannelsOk" + "." + "totals") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list channels OK body based on the context it is used +func (o *ListChannelsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateChannels(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateTotals(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListChannelsOKBody) contextValidateChannels(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Channels); i++ { + + if o.Channels[i] != nil { + if err := o.Channels[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listChannelsOk" + "." + "channels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listChannelsOk" + "." + "channels" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *ListChannelsOKBody) contextValidateTotals(ctx context.Context, formats strfmt.Registry) error { + + if o.Totals != nil { + if err := o.Totals.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listChannelsOk" + "." + "totals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listChannelsOk" + "." + "totals") } return err } @@ -512,7 +487,7 @@ func (o *ChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(formats strfmt } // MarshalBinary interface implementation -func (o *ChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { +func (o *ListChannelsOKBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -520,8 +495,8 @@ func (o *ChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) } // UnmarshalBinary interface implementation -func (o *ChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { - var res ChannelsItems0WebhookConfigHTTPConfig +func (o *ListChannelsOKBody) UnmarshalBinary(b []byte) error { + var res ListChannelsOKBody if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -529,28 +504,227 @@ func (o *ChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error return nil } -/*ChannelsItems0WebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. -swagger:model ChannelsItems0WebhookConfigHTTPConfigBasicAuth +/*ListChannelsOKBodyChannelsItems0 Channel represents a single Notification Channel. +swagger:model ListChannelsOKBodyChannelsItems0 */ -type ChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { +type ListChannelsOKBodyChannelsItems0 struct { - // username - Username string `json:"username,omitempty"` + // Machine-readable ID. + ChannelID string `json:"channel_id,omitempty"` - // password - Password string `json:"password,omitempty"` + // Short human-readable summary. + Summary string `json:"summary,omitempty"` - // password file - PasswordFile string `json:"password_file,omitempty"` + // True if that channel is disabled. + Disabled bool `json:"disabled,omitempty"` + + // email config + EmailConfig *ListChannelsOKBodyChannelsItems0EmailConfig `json:"email_config,omitempty"` + + // pagerduty config + PagerdutyConfig *ListChannelsOKBodyChannelsItems0PagerdutyConfig `json:"pagerduty_config,omitempty"` + + // slack config + SlackConfig *ListChannelsOKBodyChannelsItems0SlackConfig `json:"slack_config,omitempty"` + + // webhook config + WebhookConfig *ListChannelsOKBodyChannelsItems0WebhookConfig `json:"webhook_config,omitempty"` +} + +// Validate validates this list channels OK body channels items0 +func (o *ListChannelsOKBodyChannelsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateEmailConfig(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePagerdutyConfig(formats); err != nil { + res = append(res, err) + } + + if err := o.validateSlackConfig(formats); err != nil { + res = append(res, err) + } + + if err := o.validateWebhookConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListChannelsOKBodyChannelsItems0) validateEmailConfig(formats strfmt.Registry) error { + if swag.IsZero(o.EmailConfig) { // not required + return nil + } + + if o.EmailConfig != nil { + if err := o.EmailConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("email_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("email_config") + } + return err + } + } + + return nil } -// Validate validates this channels items0 webhook config HTTP config basic auth -func (o *ChannelsItems0WebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { +func (o *ListChannelsOKBodyChannelsItems0) validatePagerdutyConfig(formats strfmt.Registry) error { + if swag.IsZero(o.PagerdutyConfig) { // not required + return nil + } + + if o.PagerdutyConfig != nil { + if err := o.PagerdutyConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagerduty_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pagerduty_config") + } + return err + } + } + + return nil +} + +func (o *ListChannelsOKBodyChannelsItems0) validateSlackConfig(formats strfmt.Registry) error { + if swag.IsZero(o.SlackConfig) { // not required + return nil + } + + if o.SlackConfig != nil { + if err := o.SlackConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("slack_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slack_config") + } + return err + } + } + + return nil +} + +func (o *ListChannelsOKBodyChannelsItems0) validateWebhookConfig(formats strfmt.Registry) error { + if swag.IsZero(o.WebhookConfig) { // not required + return nil + } + + if o.WebhookConfig != nil { + if err := o.WebhookConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list channels OK body channels items0 based on the context it is used +func (o *ListChannelsOKBodyChannelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateEmailConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePagerdutyConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSlackConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateWebhookConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListChannelsOKBodyChannelsItems0) contextValidateEmailConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.EmailConfig != nil { + if err := o.EmailConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("email_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("email_config") + } + return err + } + } + + return nil +} + +func (o *ListChannelsOKBodyChannelsItems0) contextValidatePagerdutyConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PagerdutyConfig != nil { + if err := o.PagerdutyConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagerduty_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pagerduty_config") + } + return err + } + } + + return nil +} + +func (o *ListChannelsOKBodyChannelsItems0) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.SlackConfig != nil { + if err := o.SlackConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("slack_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slack_config") + } + return err + } + } + + return nil +} + +func (o *ListChannelsOKBodyChannelsItems0) contextValidateWebhookConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.WebhookConfig != nil { + if err := o.WebhookConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config") + } + return err + } + } + return nil } // MarshalBinary interface implementation -func (o *ChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { +func (o *ListChannelsOKBodyChannelsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -558,8 +732,8 @@ func (o *ChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte } // UnmarshalBinary interface implementation -func (o *ChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { - var res ChannelsItems0WebhookConfigHTTPConfigBasicAuth +func (o *ListChannelsOKBodyChannelsItems0) UnmarshalBinary(b []byte) error { + var res ListChannelsOKBodyChannelsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -567,50 +741,113 @@ func (o *ChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byt return nil } -/*ChannelsItems0WebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager -// https://prometheus.io/docs/alerting/latest/configuration/#tls_config -swagger:model ChannelsItems0WebhookConfigHTTPConfigTLSConfig +/*ListChannelsOKBodyChannelsItems0EmailConfig EmailConfig represents email configuration. +swagger:model ListChannelsOKBodyChannelsItems0EmailConfig */ -type ChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { +type ListChannelsOKBodyChannelsItems0EmailConfig struct { - // A path to the CA certificate file to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFile string `json:"ca_file,omitempty"` + // send resolved + SendResolved bool `json:"send_resolved,omitempty"` - // A path to the certificate file for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFile string `json:"cert_file,omitempty"` + // to + To []string `json:"to"` +} - // A path to the key file for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFile string `json:"key_file,omitempty"` +// Validate validates this list channels OK body channels items0 email config +func (o *ListChannelsOKBodyChannelsItems0EmailConfig) Validate(formats strfmt.Registry) error { + return nil +} - // Name of the server. - ServerName string `json:"server_name,omitempty"` +// ContextValidate validates this list channels OK body channels items0 email config based on context it is used +func (o *ListChannelsOKBodyChannelsItems0EmailConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} - // Disable validation of the server certificate. - InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"` +// MarshalBinary interface implementation +func (o *ListChannelsOKBodyChannelsItems0EmailConfig) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} - // CA certificate to validate the server certificate with. - // ca_file and ca_file_content should not be set at the same time. - CaFileContent string `json:"ca_file_content,omitempty"` +// UnmarshalBinary interface implementation +func (o *ListChannelsOKBodyChannelsItems0EmailConfig) UnmarshalBinary(b []byte) error { + var res ListChannelsOKBodyChannelsItems0EmailConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} - // A certificate for client cert authentication to the server. - // cert_file and cert_file_content should not be set at the same time. - CertFileContent string `json:"cert_file_content,omitempty"` +/*ListChannelsOKBodyChannelsItems0PagerdutyConfig PagerDutyConfig represents PagerDuty configuration. +swagger:model ListChannelsOKBodyChannelsItems0PagerdutyConfig +*/ +type ListChannelsOKBodyChannelsItems0PagerdutyConfig struct { - // A key for client cert authentication to the server. - // key_file and key_file_content should not be set at the same time. - KeyFileContent string `json:"key_file_content,omitempty"` + // send resolved + SendResolved bool `json:"send_resolved,omitempty"` + + // The PagerDuty key for "Events API v2" integration type. Exactly one key should be set. + RoutingKey string `json:"routing_key,omitempty"` + + // The PagerDuty key for "Prometheus" integration type. Exactly one key should be set. + ServiceKey string `json:"service_key,omitempty"` +} + +// Validate validates this list channels OK body channels items0 pagerduty config +func (o *ListChannelsOKBodyChannelsItems0PagerdutyConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list channels OK body channels items0 pagerduty config based on context it is used +func (o *ListChannelsOKBodyChannelsItems0PagerdutyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListChannelsOKBodyChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListChannelsOKBodyChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte) error { + var res ListChannelsOKBodyChannelsItems0PagerdutyConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListChannelsOKBodyChannelsItems0SlackConfig SlackConfig represents Slack configuration. +swagger:model ListChannelsOKBodyChannelsItems0SlackConfig +*/ +type ListChannelsOKBodyChannelsItems0SlackConfig struct { + + // send resolved + SendResolved bool `json:"send_resolved,omitempty"` + + // channel + Channel string `json:"channel,omitempty"` +} + +// Validate validates this list channels OK body channels items0 slack config +func (o *ListChannelsOKBodyChannelsItems0SlackConfig) Validate(formats strfmt.Registry) error { + return nil } -// Validate validates this channels items0 webhook config HTTP config TLS config -func (o *ChannelsItems0WebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { +// ContextValidate validates this list channels OK body channels items0 slack config based on context it is used +func (o *ListChannelsOKBodyChannelsItems0SlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { +func (o *ListChannelsOKBodyChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -618,8 +855,8 @@ func (o *ChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte } // UnmarshalBinary interface implementation -func (o *ChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { - var res ChannelsItems0WebhookConfigHTTPConfigTLSConfig +func (o *ListChannelsOKBodyChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { + var res ListChannelsOKBodyChannelsItems0SlackConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -627,20 +864,29 @@ func (o *ChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byt return nil } -/*ListChannelsBody list channels body -swagger:model ListChannelsBody +/*ListChannelsOKBodyChannelsItems0WebhookConfig WebhookConfig represents webhook configuration. +swagger:model ListChannelsOKBodyChannelsItems0WebhookConfig */ -type ListChannelsBody struct { +type ListChannelsOKBodyChannelsItems0WebhookConfig struct { - // page params - PageParams *ListChannelsParamsBodyPageParams `json:"page_params,omitempty"` + // send resolved + SendResolved bool `json:"send_resolved,omitempty"` + + // url + URL string `json:"url,omitempty"` + + // max alerts + MaxAlerts int32 `json:"max_alerts,omitempty"` + + // http config + HTTPConfig *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig `json:"http_config,omitempty"` } -// Validate validates this list channels body -func (o *ListChannelsBody) Validate(formats strfmt.Registry) error { +// Validate validates this list channels OK body channels items0 webhook config +func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) Validate(formats strfmt.Registry) error { var res []error - if err := o.validatePageParams(formats); err != nil { + if err := o.validateHTTPConfig(formats); err != nil { res = append(res, err) } @@ -650,16 +896,47 @@ func (o *ListChannelsBody) Validate(formats strfmt.Registry) error { return nil } -func (o *ListChannelsBody) validatePageParams(formats strfmt.Registry) error { - - if swag.IsZero(o.PageParams) { // not required +func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { + if swag.IsZero(o.HTTPConfig) { // not required return nil } - if o.PageParams != nil { - if err := o.PageParams.Validate(formats); err != nil { + if o.HTTPConfig != nil { + if err := o.HTTPConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "page_params") + return ve.ValidateName("webhook_config" + "." + "http_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list channels OK body channels items0 webhook config based on the context it is used +func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHTTPConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) contextValidateHTTPConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.HTTPConfig != nil { + if err := o.HTTPConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config") } return err } @@ -669,7 +946,7 @@ func (o *ListChannelsBody) validatePageParams(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (o *ListChannelsBody) MarshalBinary() ([]byte, error) { +func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -677,8 +954,8 @@ func (o *ListChannelsBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListChannelsBody) UnmarshalBinary(b []byte) error { - var res ListChannelsBody +func (o *ListChannelsOKBodyChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error { + var res ListChannelsOKBodyChannelsItems0WebhookConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -686,29 +963,36 @@ func (o *ListChannelsBody) UnmarshalBinary(b []byte) error { return nil } -/*ListChannelsDefaultBody list channels default body -swagger:model ListChannelsDefaultBody +/*ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. +swagger:model ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig */ -type ListChannelsDefaultBody struct { +type ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig struct { - // error - Error string `json:"error,omitempty"` + // bearer token + BearerToken string `json:"bearer_token,omitempty"` - // code - Code int32 `json:"code,omitempty"` + // bearer token file + BearerTokenFile string `json:"bearer_token_file,omitempty"` - // message - Message string `json:"message,omitempty"` + // proxy url + ProxyURL string `json:"proxy_url,omitempty"` - // details - Details []*DetailsItems0 `json:"details"` + // basic auth + BasicAuth *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` + + // tls config + TLSConfig *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` } -// Validate validates this list channels default body -func (o *ListChannelsDefaultBody) Validate(formats strfmt.Registry) error { +// Validate validates this list channels OK body channels items0 webhook config HTTP config +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateDetails(formats); err != nil { + if err := o.validateBasicAuth(formats); err != nil { + res = append(res, err) + } + + if err := o.validateTLSConfig(formats); err != nil { res = append(res, err) } @@ -718,33 +1002,96 @@ func (o *ListChannelsDefaultBody) Validate(formats strfmt.Registry) error { return nil } -func (o *ListChannelsDefaultBody) validateDetails(formats strfmt.Registry) error { +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { + if swag.IsZero(o.BasicAuth) { // not required + return nil + } - if swag.IsZero(o.Details) { // not required + if o.BasicAuth != nil { + if err := o.BasicAuth.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") + } + return err + } + } + + return nil +} + +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { + if swag.IsZero(o.TLSConfig) { // not required return nil } - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue + if o.TLSConfig != nil { + if err := o.TLSConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + } + return err } + } - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ListChannels default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err + return nil +} + +// ContextValidate validate this list channels OK body channels items0 webhook config HTTP config based on the context it is used +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateBasicAuth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateTLSConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { + + if o.BasicAuth != nil { + if err := o.BasicAuth.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") } + return err } + } + + return nil +} +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) contextValidateTLSConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.TLSConfig != nil { + if err := o.TLSConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + } + return err + } } return nil } // MarshalBinary interface implementation -func (o *ListChannelsDefaultBody) MarshalBinary() ([]byte, error) { +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -752,8 +1099,8 @@ func (o *ListChannelsDefaultBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListChannelsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListChannelsDefaultBody +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { + var res ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -761,81 +1108,98 @@ func (o *ListChannelsDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*ListChannelsOKBody list channels OK body -swagger:model ListChannelsOKBody +/*ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. +swagger:model ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth */ -type ListChannelsOKBody struct { +type ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { - // channels - Channels []*ChannelsItems0 `json:"channels"` + // username + Username string `json:"username,omitempty"` - // totals - Totals *ListChannelsOKBodyTotals `json:"totals,omitempty"` + // password + Password string `json:"password,omitempty"` + + // password file + PasswordFile string `json:"password_file,omitempty"` } -// Validate validates this list channels OK body -func (o *ListChannelsOKBody) Validate(formats strfmt.Registry) error { - var res []error +// Validate validates this list channels OK body channels items0 webhook config HTTP config basic auth +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { + return nil +} - if err := o.validateChannels(formats); err != nil { - res = append(res, err) - } +// ContextValidate validates this list channels OK body channels items0 webhook config HTTP config basic auth based on context it is used +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} - if err := o.validateTotals(formats); err != nil { - res = append(res, err) +// MarshalBinary interface implementation +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil } + return swag.WriteJSON(o) +} - if len(res) > 0 { - return errors.CompositeValidationError(res...) +// UnmarshalBinary interface implementation +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { + var res ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigBasicAuth + if err := swag.ReadJSON(b, &res); err != nil { + return err } + *o = res return nil } -func (o *ListChannelsOKBody) validateChannels(formats strfmt.Registry) error { +/*ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager +// https://prometheus.io/docs/alerting/latest/configuration/#tls_config +swagger:model ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig +*/ +type ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { - if swag.IsZero(o.Channels) { // not required - return nil - } + // A path to the CA certificate file to validate the server certificate with. + // ca_file and ca_file_content should not be set at the same time. + CaFile string `json:"ca_file,omitempty"` - for i := 0; i < len(o.Channels); i++ { - if swag.IsZero(o.Channels[i]) { // not required - continue - } + // A path to the certificate file for client cert authentication to the server. + // cert_file and cert_file_content should not be set at the same time. + CertFile string `json:"cert_file,omitempty"` - if o.Channels[i] != nil { - if err := o.Channels[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listChannelsOk" + "." + "channels" + "." + strconv.Itoa(i)) - } - return err - } - } + // A path to the key file for client cert authentication to the server. + // key_file and key_file_content should not be set at the same time. + KeyFile string `json:"key_file,omitempty"` - } + // Name of the server. + ServerName string `json:"server_name,omitempty"` - return nil -} + // Disable validation of the server certificate. + InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"` -func (o *ListChannelsOKBody) validateTotals(formats strfmt.Registry) error { + // CA certificate to validate the server certificate with. + // ca_file and ca_file_content should not be set at the same time. + CaFileContent string `json:"ca_file_content,omitempty"` - if swag.IsZero(o.Totals) { // not required - return nil - } + // A certificate for client cert authentication to the server. + // cert_file and cert_file_content should not be set at the same time. + CertFileContent string `json:"cert_file_content,omitempty"` - if o.Totals != nil { - if err := o.Totals.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listChannelsOk" + "." + "totals") - } - return err - } - } + // A key for client cert authentication to the server. + // key_file and key_file_content should not be set at the same time. + KeyFileContent string `json:"key_file_content,omitempty"` +} +// Validate validates this list channels OK body channels items0 webhook config HTTP config TLS config +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list channels OK body channels items0 webhook config HTTP config TLS config based on context it is used +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ListChannelsOKBody) MarshalBinary() ([]byte, error) { +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -843,8 +1207,8 @@ func (o *ListChannelsOKBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListChannelsOKBody) UnmarshalBinary(b []byte) error { - var res ListChannelsOKBody +func (o *ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { + var res ListChannelsOKBodyChannelsItems0WebhookConfigHTTPConfigTLSConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -869,6 +1233,11 @@ func (o *ListChannelsOKBodyTotals) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list channels OK body totals based on context it is used +func (o *ListChannelsOKBodyTotals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ListChannelsOKBodyTotals) MarshalBinary() ([]byte, error) { if o == nil { @@ -904,6 +1273,11 @@ func (o *ListChannelsParamsBodyPageParams) Validate(formats strfmt.Registry) err return nil } +// ContextValidate validates this list channels params body page params based on context it is used +func (o *ListChannelsParamsBodyPageParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ListChannelsParamsBodyPageParams) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/ia/json/client/channels/remove_channel_parameters.go b/api/managementpb/ia/json/client/channels/remove_channel_parameters.go index f0661b7f5f..f2124026c3 100644 --- a/api/managementpb/ia/json/client/channels/remove_channel_parameters.go +++ b/api/managementpb/ia/json/client/channels/remove_channel_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRemoveChannelParams creates a new RemoveChannelParams object -// with the default values initialized. +// NewRemoveChannelParams creates a new RemoveChannelParams 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 NewRemoveChannelParams() *RemoveChannelParams { - var () return &RemoveChannelParams{ - timeout: cr.DefaultTimeout, } } // NewRemoveChannelParamsWithTimeout creates a new RemoveChannelParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRemoveChannelParamsWithTimeout(timeout time.Duration) *RemoveChannelParams { - var () return &RemoveChannelParams{ - timeout: timeout, } } // NewRemoveChannelParamsWithContext creates a new RemoveChannelParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRemoveChannelParamsWithContext(ctx context.Context) *RemoveChannelParams { - var () return &RemoveChannelParams{ - Context: ctx, } } // NewRemoveChannelParamsWithHTTPClient creates a new RemoveChannelParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRemoveChannelParamsWithHTTPClient(client *http.Client) *RemoveChannelParams { - var () return &RemoveChannelParams{ HTTPClient: client, } } -/*RemoveChannelParams contains all the parameters to send to the API endpoint -for the remove channel operation typically these are written to a http.Request +/* RemoveChannelParams contains all the parameters to send to the API endpoint + for the remove channel operation. + + Typically these are written to a http.Request. */ type RemoveChannelParams struct { - /*Body*/ + // Body. Body RemoveChannelBody timeout time.Duration @@ -68,6 +67,21 @@ type RemoveChannelParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the remove channel params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RemoveChannelParams) WithDefaults() *RemoveChannelParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the remove channel params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RemoveChannelParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the remove channel params func (o *RemoveChannelParams) WithTimeout(timeout time.Duration) *RemoveChannelParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *RemoveChannelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/channels/remove_channel_responses.go b/api/managementpb/ia/json/client/channels/remove_channel_responses.go index da7b9441a5..ac4fa6a935 100644 --- a/api/managementpb/ia/json/client/channels/remove_channel_responses.go +++ b/api/managementpb/ia/json/client/channels/remove_channel_responses.go @@ -6,6 +6,7 @@ package channels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewRemoveChannelOK() *RemoveChannelOK { return &RemoveChannelOK{} } -/*RemoveChannelOK handles this case with default header values. +/* RemoveChannelOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type RemoveChannelOK struct { func (o *RemoveChannelOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Channels/Remove][%d] removeChannelOk %+v", 200, o.Payload) } - func (o *RemoveChannelOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewRemoveChannelDefault(code int) *RemoveChannelDefault { } } -/*RemoveChannelDefault handles this case with default header values. +/* RemoveChannelDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *RemoveChannelDefault) Code() int { func (o *RemoveChannelDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Channels/Remove][%d] RemoveChannel default %+v", o._statusCode, o.Payload) } - func (o *RemoveChannelDefault) GetPayload() *RemoveChannelDefaultBody { return o.Payload } @@ -129,6 +128,11 @@ func (o *RemoveChannelBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this remove channel body based on context it is used +func (o *RemoveChannelBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *RemoveChannelBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -162,7 +166,7 @@ type RemoveChannelDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RemoveChannelDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this remove channel default body @@ -180,7 +184,6 @@ func (o *RemoveChannelDefaultBody) Validate(formats strfmt.Registry) error { } func (o *RemoveChannelDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -194,6 +197,42 @@ func (o *RemoveChannelDefaultBody) validateDetails(formats strfmt.Registry) erro if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RemoveChannel default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RemoveChannel default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this remove channel default body based on the context it is used +func (o *RemoveChannelDefaultBody) 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 *RemoveChannelDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RemoveChannel default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RemoveChannel default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -221,3 +260,44 @@ func (o *RemoveChannelDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*RemoveChannelDefaultBodyDetailsItems0 remove channel default body details items0 +swagger:model RemoveChannelDefaultBodyDetailsItems0 +*/ +type RemoveChannelDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this remove channel default body details items0 +func (o *RemoveChannelDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this remove channel default body details items0 based on context it is used +func (o *RemoveChannelDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *RemoveChannelDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoveChannelDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res RemoveChannelDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/ia/json/client/pmm_integrated_alerting_client.go b/api/managementpb/ia/json/client/pmm_integrated_alerting_api_client.go similarity index 86% rename from api/managementpb/ia/json/client/pmm_integrated_alerting_client.go rename to api/managementpb/ia/json/client/pmm_integrated_alerting_api_client.go index ed4b8fc0af..b22fcba5c4 100644 --- a/api/managementpb/ia/json/client/pmm_integrated_alerting_client.go +++ b/api/managementpb/ia/json/client/pmm_integrated_alerting_api_client.go @@ -16,7 +16,7 @@ import ( "github.com/percona/pmm/api/managementpb/ia/json/client/templates" ) -// Default PMM integrated alerting HTTP client. +// Default PMM integrated alerting API HTTP client. var Default = NewHTTPClient(nil) const ( @@ -31,14 +31,14 @@ const ( // DefaultSchemes are the default schemes found in Meta (info) section of spec file var DefaultSchemes = []string{"http", "https"} -// NewHTTPClient creates a new PMM integrated alerting HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMIntegratedAlerting { +// NewHTTPClient creates a new PMM integrated alerting API HTTP client. +func NewHTTPClient(formats strfmt.Registry) *PMMIntegratedAlertingAPI { return NewHTTPClientWithConfig(formats, nil) } -// NewHTTPClientWithConfig creates a new PMM integrated alerting HTTP client, +// NewHTTPClientWithConfig creates a new PMM integrated alerting API HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMIntegratedAlerting { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMIntegratedAlertingAPI { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -49,14 +49,14 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMM return New(transport, formats) } -// New creates a new PMM integrated alerting client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMIntegratedAlerting { +// New creates a new PMM integrated alerting API client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMIntegratedAlertingAPI { // ensure nullable parameters have default if formats == nil { formats = strfmt.Default } - cli := new(PMMIntegratedAlerting) + cli := new(PMMIntegratedAlertingAPI) cli.Transport = transport cli.Alerts = alerts.New(transport, formats) cli.Channels = channels.New(transport, formats) @@ -104,8 +104,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// PMMIntegratedAlerting is a client for PMM integrated alerting -type PMMIntegratedAlerting struct { +// PMMIntegratedAlertingAPI is a client for PMM integrated alerting API +type PMMIntegratedAlertingAPI struct { Alerts alerts.ClientService Channels channels.ClientService @@ -118,7 +118,7 @@ type PMMIntegratedAlerting struct { } // SetTransport changes the transport on the client and all its subresources -func (c *PMMIntegratedAlerting) SetTransport(transport runtime.ClientTransport) { +func (c *PMMIntegratedAlertingAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Alerts.SetTransport(transport) c.Channels.SetTransport(transport) diff --git a/api/managementpb/ia/json/client/rules/create_alert_rule_parameters.go b/api/managementpb/ia/json/client/rules/create_alert_rule_parameters.go index d800d3aa11..c98fe9a3c4 100644 --- a/api/managementpb/ia/json/client/rules/create_alert_rule_parameters.go +++ b/api/managementpb/ia/json/client/rules/create_alert_rule_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCreateAlertRuleParams creates a new CreateAlertRuleParams object -// with the default values initialized. +// NewCreateAlertRuleParams creates a new CreateAlertRuleParams 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 NewCreateAlertRuleParams() *CreateAlertRuleParams { - var () return &CreateAlertRuleParams{ - timeout: cr.DefaultTimeout, } } // NewCreateAlertRuleParamsWithTimeout creates a new CreateAlertRuleParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateAlertRuleParamsWithTimeout(timeout time.Duration) *CreateAlertRuleParams { - var () return &CreateAlertRuleParams{ - timeout: timeout, } } // NewCreateAlertRuleParamsWithContext creates a new CreateAlertRuleParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateAlertRuleParamsWithContext(ctx context.Context) *CreateAlertRuleParams { - var () return &CreateAlertRuleParams{ - Context: ctx, } } // NewCreateAlertRuleParamsWithHTTPClient creates a new CreateAlertRuleParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateAlertRuleParamsWithHTTPClient(client *http.Client) *CreateAlertRuleParams { - var () return &CreateAlertRuleParams{ HTTPClient: client, } } -/*CreateAlertRuleParams contains all the parameters to send to the API endpoint -for the create alert rule operation typically these are written to a http.Request +/* CreateAlertRuleParams contains all the parameters to send to the API endpoint + for the create alert rule operation. + + Typically these are written to a http.Request. */ type CreateAlertRuleParams struct { - /*Body*/ + // Body. Body CreateAlertRuleBody timeout time.Duration @@ -68,6 +67,21 @@ type CreateAlertRuleParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create alert rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAlertRuleParams) WithDefaults() *CreateAlertRuleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create alert rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAlertRuleParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create alert rule params func (o *CreateAlertRuleParams) WithTimeout(timeout time.Duration) *CreateAlertRuleParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *CreateAlertRuleParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/rules/create_alert_rule_responses.go b/api/managementpb/ia/json/client/rules/create_alert_rule_responses.go index ec7bbf1650..db7a680643 100644 --- a/api/managementpb/ia/json/client/rules/create_alert_rule_responses.go +++ b/api/managementpb/ia/json/client/rules/create_alert_rule_responses.go @@ -6,6 +6,7 @@ package rules // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewCreateAlertRuleOK() *CreateAlertRuleOK { return &CreateAlertRuleOK{} } -/*CreateAlertRuleOK handles this case with default header values. +/* CreateAlertRuleOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type CreateAlertRuleOK struct { func (o *CreateAlertRuleOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Rules/Create][%d] createAlertRuleOk %+v", 200, o.Payload) } - func (o *CreateAlertRuleOK) GetPayload() *CreateAlertRuleOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewCreateAlertRuleDefault(code int) *CreateAlertRuleDefault { } } -/*CreateAlertRuleDefault handles this case with default header values. +/* CreateAlertRuleDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *CreateAlertRuleDefault) Code() int { func (o *CreateAlertRuleDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Rules/Create][%d] CreateAlertRule default %+v", o._statusCode, o.Payload) } - func (o *CreateAlertRuleDefault) GetPayload() *CreateAlertRuleDefaultBody { return o.Payload } @@ -137,23 +136,23 @@ type CreateAlertRuleBody struct { Disabled bool `json:"disabled,omitempty"` // Rule parameters. All template parameters should be set. - Params []*ParamsItems0 `json:"params"` + Params []*CreateAlertRuleParamsBodyParamsItems0 `json:"params"` // Rule duration. Should be set. For string `json:"for,omitempty"` - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID 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. Should be set. - Filters []*FiltersItems0 `json:"filters"` + Filters []*CreateAlertRuleParamsBodyFiltersItems0 `json:"filters"` // Channels. Should be set. ChannelIds []string `json:"channel_ids"` + + // Severity represents severity level of the check result or alert. + // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] + Severity *string `json:"severity,omitempty"` } // Validate validates this create alert rule body @@ -164,11 +163,11 @@ func (o *CreateAlertRuleBody) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateSeverity(formats); err != nil { + if err := o.validateFilters(formats); err != nil { res = append(res, err) } - if err := o.validateFilters(formats); err != nil { + if err := o.validateSeverity(formats); err != nil { res = append(res, err) } @@ -179,7 +178,6 @@ func (o *CreateAlertRuleBody) Validate(formats strfmt.Registry) error { } func (o *CreateAlertRuleBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required return nil } @@ -193,6 +191,34 @@ func (o *CreateAlertRuleBody) validateParams(formats strfmt.Registry) error { if err := o.Params[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *CreateAlertRuleBody) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) } return err } @@ -254,7 +280,6 @@ func (o *CreateAlertRuleBody) validateSeverityEnum(path, location string, value } func (o *CreateAlertRuleBody) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required return nil } @@ -267,21 +292,54 @@ func (o *CreateAlertRuleBody) validateSeverity(formats strfmt.Registry) error { return nil } -func (o *CreateAlertRuleBody) validateFilters(formats strfmt.Registry) error { +// ContextValidate validate this create alert rule body based on the context it is used +func (o *CreateAlertRuleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.Filters) { // not required - return nil + if err := o.contextValidateParams(ctx, formats); err != nil { + res = append(res, err) } - for i := 0; i < len(o.Filters); i++ { - if swag.IsZero(o.Filters[i]) { // not required - continue + if err := o.contextValidateFilters(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CreateAlertRuleBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Params); i++ { + + if o.Params[i] != nil { + if err := o.Params[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } + return err + } } + } + + return nil +} + +func (o *CreateAlertRuleBody) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Filters); i++ { + if o.Filters[i] != nil { - if err := o.Filters[i].Validate(formats); err != nil { + if err := o.Filters[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) } return err } @@ -325,7 +383,7 @@ type CreateAlertRuleDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*CreateAlertRuleDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this create alert rule default body @@ -343,7 +401,6 @@ func (o *CreateAlertRuleDefaultBody) Validate(formats strfmt.Registry) error { } func (o *CreateAlertRuleDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -357,6 +414,42 @@ func (o *CreateAlertRuleDefaultBody) validateDetails(formats strfmt.Registry) er if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("CreateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CreateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create alert rule default body based on the context it is used +func (o *CreateAlertRuleDefaultBody) 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 *CreateAlertRuleDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CreateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CreateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -385,22 +478,31 @@ func (o *CreateAlertRuleDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*CreateAlertRuleOKBody create alert rule OK body -swagger:model CreateAlertRuleOKBody +/*CreateAlertRuleDefaultBodyDetailsItems0 create alert rule default body details items0 +swagger:model CreateAlertRuleDefaultBodyDetailsItems0 */ -type CreateAlertRuleOKBody struct { +type CreateAlertRuleDefaultBodyDetailsItems0 struct { - // Rule ID. - RuleID string `json:"rule_id,omitempty"` + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this create alert rule OK body -func (o *CreateAlertRuleOKBody) Validate(formats strfmt.Registry) error { +// Validate validates this create alert rule default body details items0 +func (o *CreateAlertRuleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create alert rule default body details items0 based on context it is used +func (o *CreateAlertRuleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *CreateAlertRuleOKBody) MarshalBinary() ([]byte, error) { +func (o *CreateAlertRuleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -408,8 +510,8 @@ func (o *CreateAlertRuleOKBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *CreateAlertRuleOKBody) UnmarshalBinary(b []byte) error { - var res CreateAlertRuleOKBody +func (o *CreateAlertRuleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res CreateAlertRuleDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -417,26 +519,27 @@ func (o *CreateAlertRuleOKBody) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*CreateAlertRuleOKBody create alert rule OK body +swagger:model CreateAlertRuleOKBody */ -type DetailsItems0 struct { +type CreateAlertRuleOKBody struct { - // type url - TypeURL string `json:"type_url,omitempty"` + // Rule ID. + RuleID string `json:"rule_id,omitempty"` +} - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` +// Validate validates this create alert rule OK body +func (o *CreateAlertRuleOKBody) Validate(formats strfmt.Registry) error { + return nil } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this create alert rule OK body based on context it is used +func (o *CreateAlertRuleOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *CreateAlertRuleOKBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -444,8 +547,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *CreateAlertRuleOKBody) UnmarshalBinary(b []byte) error { + var res CreateAlertRuleOKBody if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -453,10 +556,16 @@ func (o *DetailsItems0) UnmarshalBinary(b []byte) error { return nil } -/*FiltersItems0 Filter repsents a single filter condition. -swagger:model FiltersItems0 +/*CreateAlertRuleParamsBodyFiltersItems0 Filter repsents a single filter condition. +swagger:model CreateAlertRuleParamsBodyFiltersItems0 */ -type FiltersItems0 struct { +type CreateAlertRuleParamsBodyFiltersItems0 struct { + + // key + Key string `json:"key,omitempty"` + + // value + Value string `json:"value,omitempty"` // FilterType represents filter matching type. // @@ -464,16 +573,10 @@ type FiltersItems0 struct { // - REGEX: =~ // Enum: [FILTER_TYPE_INVALID EQUAL REGEX] Type *string `json:"type,omitempty"` - - // key - Key string `json:"key,omitempty"` - - // value - Value string `json:"value,omitempty"` } -// Validate validates this filters items0 -func (o *FiltersItems0) Validate(formats strfmt.Registry) error { +// Validate validates this create alert rule params body filters items0 +func (o *CreateAlertRuleParamsBodyFiltersItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateType(formats); err != nil { @@ -486,7 +589,7 @@ func (o *FiltersItems0) Validate(formats strfmt.Registry) error { return nil } -var filtersItems0TypeTypePropEnum []interface{} +var createAlertRuleParamsBodyFiltersItems0TypeTypePropEnum []interface{} func init() { var res []string @@ -494,32 +597,31 @@ func init() { panic(err) } for _, v := range res { - filtersItems0TypeTypePropEnum = append(filtersItems0TypeTypePropEnum, v) + createAlertRuleParamsBodyFiltersItems0TypeTypePropEnum = append(createAlertRuleParamsBodyFiltersItems0TypeTypePropEnum, v) } } const ( - // FiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" - FiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" + // CreateAlertRuleParamsBodyFiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" + CreateAlertRuleParamsBodyFiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" - // FiltersItems0TypeEQUAL captures enum value "EQUAL" - FiltersItems0TypeEQUAL string = "EQUAL" + // CreateAlertRuleParamsBodyFiltersItems0TypeEQUAL captures enum value "EQUAL" + CreateAlertRuleParamsBodyFiltersItems0TypeEQUAL string = "EQUAL" - // FiltersItems0TypeREGEX captures enum value "REGEX" - FiltersItems0TypeREGEX string = "REGEX" + // CreateAlertRuleParamsBodyFiltersItems0TypeREGEX captures enum value "REGEX" + CreateAlertRuleParamsBodyFiltersItems0TypeREGEX string = "REGEX" ) // prop value enum -func (o *FiltersItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, filtersItems0TypeTypePropEnum, true); err != nil { +func (o *CreateAlertRuleParamsBodyFiltersItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createAlertRuleParamsBodyFiltersItems0TypeTypePropEnum, true); err != nil { return err } return nil } -func (o *FiltersItems0) validateType(formats strfmt.Registry) error { - +func (o *CreateAlertRuleParamsBodyFiltersItems0) validateType(formats strfmt.Registry) error { if swag.IsZero(o.Type) { // not required return nil } @@ -532,8 +634,13 @@ func (o *FiltersItems0) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this create alert rule params body filters items0 based on context it is used +func (o *CreateAlertRuleParamsBodyFiltersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *FiltersItems0) MarshalBinary() ([]byte, error) { +func (o *CreateAlertRuleParamsBodyFiltersItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -541,8 +648,8 @@ func (o *FiltersItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *FiltersItems0) UnmarshalBinary(b []byte) error { - var res FiltersItems0 +func (o *CreateAlertRuleParamsBodyFiltersItems0) UnmarshalBinary(b []byte) error { + var res CreateAlertRuleParamsBodyFiltersItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -550,18 +657,14 @@ func (o *FiltersItems0) UnmarshalBinary(b []byte) error { return nil } -/*ParamsItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. -swagger:model ParamsItems0 +/*CreateAlertRuleParamsBodyParamsItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. +swagger:model CreateAlertRuleParamsBodyParamsItems0 */ -type ParamsItems0 struct { +type CreateAlertRuleParamsBodyParamsItems0 struct { // Machine-readable name (ID) that is used in expression. Name string `json:"name,omitempty"` - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - // Bool value. Bool bool `json:"bool,omitempty"` @@ -570,10 +673,14 @@ type ParamsItems0 struct { // String value. String string `json:"string,omitempty"` + + // ParamType represents template parameter type. + // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] + Type *string `json:"type,omitempty"` } -// Validate validates this params items0 -func (o *ParamsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this create alert rule params body params items0 +func (o *CreateAlertRuleParamsBodyParamsItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateType(formats); err != nil { @@ -586,7 +693,7 @@ func (o *ParamsItems0) Validate(formats strfmt.Registry) error { return nil } -var paramsItems0TypeTypePropEnum []interface{} +var createAlertRuleParamsBodyParamsItems0TypeTypePropEnum []interface{} func init() { var res []string @@ -594,35 +701,34 @@ func init() { panic(err) } for _, v := range res { - paramsItems0TypeTypePropEnum = append(paramsItems0TypeTypePropEnum, v) + createAlertRuleParamsBodyParamsItems0TypeTypePropEnum = append(createAlertRuleParamsBodyParamsItems0TypeTypePropEnum, v) } } const ( - // ParamsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - ParamsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" + // CreateAlertRuleParamsBodyParamsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" + CreateAlertRuleParamsBodyParamsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - // ParamsItems0TypeBOOL captures enum value "BOOL" - ParamsItems0TypeBOOL string = "BOOL" + // CreateAlertRuleParamsBodyParamsItems0TypeBOOL captures enum value "BOOL" + CreateAlertRuleParamsBodyParamsItems0TypeBOOL string = "BOOL" - // ParamsItems0TypeFLOAT captures enum value "FLOAT" - ParamsItems0TypeFLOAT string = "FLOAT" + // CreateAlertRuleParamsBodyParamsItems0TypeFLOAT captures enum value "FLOAT" + CreateAlertRuleParamsBodyParamsItems0TypeFLOAT string = "FLOAT" - // ParamsItems0TypeSTRING captures enum value "STRING" - ParamsItems0TypeSTRING string = "STRING" + // CreateAlertRuleParamsBodyParamsItems0TypeSTRING captures enum value "STRING" + CreateAlertRuleParamsBodyParamsItems0TypeSTRING string = "STRING" ) // prop value enum -func (o *ParamsItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, paramsItems0TypeTypePropEnum, true); err != nil { +func (o *CreateAlertRuleParamsBodyParamsItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createAlertRuleParamsBodyParamsItems0TypeTypePropEnum, true); err != nil { return err } return nil } -func (o *ParamsItems0) validateType(formats strfmt.Registry) error { - +func (o *CreateAlertRuleParamsBodyParamsItems0) validateType(formats strfmt.Registry) error { if swag.IsZero(o.Type) { // not required return nil } @@ -635,8 +741,13 @@ func (o *ParamsItems0) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this create alert rule params body params items0 based on context it is used +func (o *CreateAlertRuleParamsBodyParamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *ParamsItems0) MarshalBinary() ([]byte, error) { +func (o *CreateAlertRuleParamsBodyParamsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -644,8 +755,8 @@ func (o *ParamsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ParamsItems0) UnmarshalBinary(b []byte) error { - var res ParamsItems0 +func (o *CreateAlertRuleParamsBodyParamsItems0) UnmarshalBinary(b []byte) error { + var res CreateAlertRuleParamsBodyParamsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/ia/json/client/rules/delete_alert_rule_parameters.go b/api/managementpb/ia/json/client/rules/delete_alert_rule_parameters.go index 7d24200154..4f718e9e75 100644 --- a/api/managementpb/ia/json/client/rules/delete_alert_rule_parameters.go +++ b/api/managementpb/ia/json/client/rules/delete_alert_rule_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteAlertRuleParams creates a new DeleteAlertRuleParams object -// with the default values initialized. +// NewDeleteAlertRuleParams creates a new DeleteAlertRuleParams 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 NewDeleteAlertRuleParams() *DeleteAlertRuleParams { - var () return &DeleteAlertRuleParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteAlertRuleParamsWithTimeout creates a new DeleteAlertRuleParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteAlertRuleParamsWithTimeout(timeout time.Duration) *DeleteAlertRuleParams { - var () return &DeleteAlertRuleParams{ - timeout: timeout, } } // NewDeleteAlertRuleParamsWithContext creates a new DeleteAlertRuleParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteAlertRuleParamsWithContext(ctx context.Context) *DeleteAlertRuleParams { - var () return &DeleteAlertRuleParams{ - Context: ctx, } } // NewDeleteAlertRuleParamsWithHTTPClient creates a new DeleteAlertRuleParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteAlertRuleParamsWithHTTPClient(client *http.Client) *DeleteAlertRuleParams { - var () return &DeleteAlertRuleParams{ HTTPClient: client, } } -/*DeleteAlertRuleParams contains all the parameters to send to the API endpoint -for the delete alert rule operation typically these are written to a http.Request +/* DeleteAlertRuleParams contains all the parameters to send to the API endpoint + for the delete alert rule operation. + + Typically these are written to a http.Request. */ type DeleteAlertRuleParams struct { - /*Body*/ + // Body. Body DeleteAlertRuleBody timeout time.Duration @@ -68,6 +67,21 @@ type DeleteAlertRuleParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete alert rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAlertRuleParams) WithDefaults() *DeleteAlertRuleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete alert rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteAlertRuleParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete alert rule params func (o *DeleteAlertRuleParams) WithTimeout(timeout time.Duration) *DeleteAlertRuleParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *DeleteAlertRuleParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/rules/delete_alert_rule_responses.go b/api/managementpb/ia/json/client/rules/delete_alert_rule_responses.go index 266c1dbe41..a9fb9e6cba 100644 --- a/api/managementpb/ia/json/client/rules/delete_alert_rule_responses.go +++ b/api/managementpb/ia/json/client/rules/delete_alert_rule_responses.go @@ -6,6 +6,7 @@ package rules // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewDeleteAlertRuleOK() *DeleteAlertRuleOK { return &DeleteAlertRuleOK{} } -/*DeleteAlertRuleOK handles this case with default header values. +/* DeleteAlertRuleOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type DeleteAlertRuleOK struct { func (o *DeleteAlertRuleOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Rules/Delete][%d] deleteAlertRuleOk %+v", 200, o.Payload) } - func (o *DeleteAlertRuleOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewDeleteAlertRuleDefault(code int) *DeleteAlertRuleDefault { } } -/*DeleteAlertRuleDefault handles this case with default header values. +/* DeleteAlertRuleDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *DeleteAlertRuleDefault) Code() int { func (o *DeleteAlertRuleDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Rules/Delete][%d] DeleteAlertRule default %+v", o._statusCode, o.Payload) } - func (o *DeleteAlertRuleDefault) GetPayload() *DeleteAlertRuleDefaultBody { return o.Payload } @@ -129,6 +128,11 @@ func (o *DeleteAlertRuleBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this delete alert rule body based on context it is used +func (o *DeleteAlertRuleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *DeleteAlertRuleBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -162,7 +166,7 @@ type DeleteAlertRuleDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*DeleteAlertRuleDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this delete alert rule default body @@ -180,7 +184,6 @@ func (o *DeleteAlertRuleDefaultBody) Validate(formats strfmt.Registry) error { } func (o *DeleteAlertRuleDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -194,6 +197,42 @@ func (o *DeleteAlertRuleDefaultBody) validateDetails(formats strfmt.Registry) er if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("DeleteAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("DeleteAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this delete alert rule default body based on the context it is used +func (o *DeleteAlertRuleDefaultBody) 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 *DeleteAlertRuleDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DeleteAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("DeleteAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -221,3 +260,44 @@ func (o *DeleteAlertRuleDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*DeleteAlertRuleDefaultBodyDetailsItems0 delete alert rule default body details items0 +swagger:model DeleteAlertRuleDefaultBodyDetailsItems0 +*/ +type DeleteAlertRuleDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this delete alert rule default body details items0 +func (o *DeleteAlertRuleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this delete alert rule default body details items0 based on context it is used +func (o *DeleteAlertRuleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *DeleteAlertRuleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DeleteAlertRuleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res DeleteAlertRuleDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/ia/json/client/rules/list_alert_rules_parameters.go b/api/managementpb/ia/json/client/rules/list_alert_rules_parameters.go index 5cdb19119c..82bb22a8e5 100644 --- a/api/managementpb/ia/json/client/rules/list_alert_rules_parameters.go +++ b/api/managementpb/ia/json/client/rules/list_alert_rules_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListAlertRulesParams creates a new ListAlertRulesParams object -// with the default values initialized. +// NewListAlertRulesParams creates a new ListAlertRulesParams 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 NewListAlertRulesParams() *ListAlertRulesParams { - var () return &ListAlertRulesParams{ - timeout: cr.DefaultTimeout, } } // NewListAlertRulesParamsWithTimeout creates a new ListAlertRulesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListAlertRulesParamsWithTimeout(timeout time.Duration) *ListAlertRulesParams { - var () return &ListAlertRulesParams{ - timeout: timeout, } } // NewListAlertRulesParamsWithContext creates a new ListAlertRulesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListAlertRulesParamsWithContext(ctx context.Context) *ListAlertRulesParams { - var () return &ListAlertRulesParams{ - Context: ctx, } } // NewListAlertRulesParamsWithHTTPClient creates a new ListAlertRulesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListAlertRulesParamsWithHTTPClient(client *http.Client) *ListAlertRulesParams { - var () return &ListAlertRulesParams{ HTTPClient: client, } } -/*ListAlertRulesParams contains all the parameters to send to the API endpoint -for the list alert rules operation typically these are written to a http.Request +/* ListAlertRulesParams contains all the parameters to send to the API endpoint + for the list alert rules operation. + + Typically these are written to a http.Request. */ type ListAlertRulesParams struct { - /*Body*/ + // Body. Body ListAlertRulesBody timeout time.Duration @@ -68,6 +67,21 @@ type ListAlertRulesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list alert rules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAlertRulesParams) WithDefaults() *ListAlertRulesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list alert rules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAlertRulesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list alert rules params func (o *ListAlertRulesParams) WithTimeout(timeout time.Duration) *ListAlertRulesParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ListAlertRulesParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/rules/list_alert_rules_responses.go b/api/managementpb/ia/json/client/rules/list_alert_rules_responses.go index b568c50eec..5c938b14aa 100644 --- a/api/managementpb/ia/json/client/rules/list_alert_rules_responses.go +++ b/api/managementpb/ia/json/client/rules/list_alert_rules_responses.go @@ -6,6 +6,7 @@ package rules // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListAlertRulesOK() *ListAlertRulesOK { return &ListAlertRulesOK{} } -/*ListAlertRulesOK handles this case with default header values. +/* ListAlertRulesOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListAlertRulesOK struct { func (o *ListAlertRulesOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Rules/List][%d] listAlertRulesOk %+v", 200, o.Payload) } - func (o *ListAlertRulesOK) GetPayload() *ListAlertRulesOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListAlertRulesDefault(code int) *ListAlertRulesDefault { } } -/*ListAlertRulesDefault handles this case with default header values. +/* ListAlertRulesDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListAlertRulesDefault) Code() int { func (o *ListAlertRulesDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Rules/List][%d] ListAlertRules default %+v", o._statusCode, o.Payload) } - func (o *ListAlertRulesDefault) GetPayload() *ListAlertRulesDefaultBody { return o.Payload } @@ -143,7 +142,6 @@ func (o *ListAlertRulesBody) Validate(formats strfmt.Registry) error { } func (o *ListAlertRulesBody) validatePageParams(formats strfmt.Registry) error { - if swag.IsZero(o.PageParams) { // not required return nil } @@ -152,6 +150,38 @@ func (o *ListAlertRulesBody) validatePageParams(formats strfmt.Registry) error { if err := o.PageParams.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "page_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "page_params") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list alert rules body based on the context it is used +func (o *ListAlertRulesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePageParams(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertRulesBody) contextValidatePageParams(ctx context.Context, formats strfmt.Registry) error { + + if o.PageParams != nil { + if err := o.PageParams.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "page_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "page_params") } return err } @@ -193,7 +223,7 @@ type ListAlertRulesDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ListAlertRulesDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this list alert rules default body @@ -211,7 +241,6 @@ func (o *ListAlertRulesDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ListAlertRulesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -225,6 +254,42 @@ func (o *ListAlertRulesDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListAlertRules default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListAlertRules default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list alert rules default body based on the context it is used +func (o *ListAlertRulesDefaultBody) 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 *ListAlertRulesDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListAlertRules default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListAlertRules default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -253,13 +318,54 @@ func (o *ListAlertRulesDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ListAlertRulesDefaultBodyDetailsItems0 list alert rules default body details items0 +swagger:model ListAlertRulesDefaultBodyDetailsItems0 +*/ +type ListAlertRulesDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this list alert rules default body details items0 +func (o *ListAlertRulesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alert rules default body details items0 based on context it is used +func (o *ListAlertRulesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListAlertRulesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListAlertRulesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ListAlertRulesDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*ListAlertRulesOKBody list alert rules OK body swagger:model ListAlertRulesOKBody */ type ListAlertRulesOKBody struct { // rules - Rules []*RulesItems0 `json:"rules"` + Rules []*ListAlertRulesOKBodyRulesItems0 `json:"rules"` // totals Totals *ListAlertRulesOKBodyTotals `json:"totals,omitempty"` @@ -284,7 +390,6 @@ func (o *ListAlertRulesOKBody) Validate(formats strfmt.Registry) error { } func (o *ListAlertRulesOKBody) validateRules(formats strfmt.Registry) error { - if swag.IsZero(o.Rules) { // not required return nil } @@ -298,6 +403,8 @@ func (o *ListAlertRulesOKBody) validateRules(formats strfmt.Registry) error { if err := o.Rules[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAlertRulesOk" + "." + "rules" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAlertRulesOk" + "." + "rules" + "." + strconv.Itoa(i)) } return err } @@ -309,7 +416,6 @@ func (o *ListAlertRulesOKBody) validateRules(formats strfmt.Registry) error { } func (o *ListAlertRulesOKBody) validateTotals(formats strfmt.Registry) error { - if swag.IsZero(o.Totals) { // not required return nil } @@ -318,6 +424,8 @@ func (o *ListAlertRulesOKBody) validateTotals(formats strfmt.Registry) error { if err := o.Totals.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listAlertRulesOk" + "." + "totals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAlertRulesOk" + "." + "totals") } return err } @@ -326,78 +434,62 @@ func (o *ListAlertRulesOKBody) validateTotals(formats strfmt.Registry) error { return nil } -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil +// ContextValidate validate this list alert rules OK body based on the context it is used +func (o *ListAlertRulesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateRules(ctx, formats); err != nil { + res = append(res, err) } - return swag.WriteJSON(o) -} -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBody) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err + if err := o.contextValidateTotals(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) } - *o = res return nil } -/*ListAlertRulesOKBodyTotals PageTotals represents total values for pagination. -swagger:model ListAlertRulesOKBodyTotals -*/ -type ListAlertRulesOKBodyTotals struct { +func (o *ListAlertRulesOKBody) contextValidateRules(ctx context.Context, formats strfmt.Registry) error { - // Total number of results. - TotalItems int32 `json:"total_items,omitempty"` - - // Total number of pages. - TotalPages int32 `json:"total_pages,omitempty"` -} + for i := 0; i < len(o.Rules); i++ { -// Validate validates this list alert rules OK body totals -func (o *ListAlertRulesOKBodyTotals) Validate(formats strfmt.Registry) error { - return nil -} + if o.Rules[i] != nil { + if err := o.Rules[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAlertRulesOk" + "." + "rules" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAlertRulesOk" + "." + "rules" + "." + strconv.Itoa(i)) + } + return err + } + } -// MarshalBinary interface implementation -func (o *ListAlertRulesOKBodyTotals) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil } - return swag.WriteJSON(o) -} -// UnmarshalBinary interface implementation -func (o *ListAlertRulesOKBodyTotals) UnmarshalBinary(b []byte) error { - var res ListAlertRulesOKBodyTotals - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res return nil } -/*ListAlertRulesParamsBodyPageParams PageParams represents page request parameters for pagination. -swagger:model ListAlertRulesParamsBodyPageParams -*/ -type ListAlertRulesParamsBodyPageParams struct { +func (o *ListAlertRulesOKBody) contextValidateTotals(ctx context.Context, formats strfmt.Registry) error { - // Maximum number of results per page. - PageSize int32 `json:"page_size,omitempty"` - - // Index of the requested page, starts from 0. - Index int32 `json:"index,omitempty"` -} + if o.Totals != nil { + if err := o.Totals.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listAlertRulesOk" + "." + "totals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listAlertRulesOk" + "." + "totals") + } + return err + } + } -// Validate validates this list alert rules params body page params -func (o *ListAlertRulesParamsBodyPageParams) Validate(formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ListAlertRulesParamsBodyPageParams) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -405,8 +497,8 @@ func (o *ListAlertRulesParamsBodyPageParams) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListAlertRulesParamsBodyPageParams) UnmarshalBinary(b []byte) error { - var res ListAlertRulesParamsBodyPageParams +func (o *ListAlertRulesOKBody) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBody if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -414,10 +506,10 @@ func (o *ListAlertRulesParamsBodyPageParams) UnmarshalBinary(b []byte) error { return nil } -/*RulesItems0 Rule represents Alert Rule. -swagger:model RulesItems0 +/*ListAlertRulesOKBodyRulesItems0 Rule represents Alert Rule. +swagger:model ListAlertRulesOKBodyRulesItems0 */ -type RulesItems0 struct { +type ListAlertRulesOKBodyRulesItems0 struct { // Rule ID. RuleID string `json:"rule_id,omitempty"` @@ -441,10 +533,10 @@ type RulesItems0 struct { Expr string `json:"expr,omitempty"` // Expression parameters definitions. - ParamsDefinitions []*RulesItems0ParamsDefinitionsItems0 `json:"params_definitions"` + ParamsDefinitions []*ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0 `json:"params_definitions"` // Expression parameters values. - ParamsValues []*RulesItems0ParamsValuesItems0 `json:"params_values"` + ParamsValues []*ListAlertRulesOKBodyRulesItems0ParamsValuesItems0 `json:"params_values"` // Default for duration. DefaultFor string `json:"default_for,omitempty"` @@ -452,14 +544,6 @@ type RulesItems0 struct { // For duration. For string `json:"for,omitempty"` - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - DefaultSeverity *string `json:"default_severity,omitempty"` - - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] - Severity *string `json:"severity,omitempty"` - // Custom labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` @@ -470,18 +554,26 @@ type RulesItems0 struct { Annotations map[string]string `json:"annotations,omitempty"` // Filters. - Filters []*RulesItems0FiltersItems0 `json:"filters"` + Filters []*ListAlertRulesOKBodyRulesItems0FiltersItems0 `json:"filters"` // Channels. - Channels []*RulesItems0ChannelsItems0 `json:"channels"` + Channels []*ListAlertRulesOKBodyRulesItems0ChannelsItems0 `json:"channels"` // Rule creation time. // Format: date-time CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Severity represents severity level of the check result or alert. + // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] + DefaultSeverity *string `json:"default_severity,omitempty"` + + // Severity represents severity level of the check result or alert. + // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] + Severity *string `json:"severity,omitempty"` } -// Validate validates this rules items0 -func (o *RulesItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 +func (o *ListAlertRulesOKBodyRulesItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateParamsDefinitions(formats); err != nil { @@ -492,23 +584,23 @@ func (o *RulesItems0) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateDefaultSeverity(formats); err != nil { + if err := o.validateFilters(formats); err != nil { res = append(res, err) } - if err := o.validateSeverity(formats); err != nil { + if err := o.validateChannels(formats); err != nil { res = append(res, err) } - if err := o.validateFilters(formats); err != nil { + if err := o.validateCreatedAt(formats); err != nil { res = append(res, err) } - if err := o.validateChannels(formats); err != nil { + if err := o.validateDefaultSeverity(formats); err != nil { res = append(res, err) } - if err := o.validateCreatedAt(formats); err != nil { + if err := o.validateSeverity(formats); err != nil { res = append(res, err) } @@ -518,8 +610,7 @@ func (o *RulesItems0) Validate(formats strfmt.Registry) error { return nil } -func (o *RulesItems0) validateParamsDefinitions(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0) validateParamsDefinitions(formats strfmt.Registry) error { if swag.IsZero(o.ParamsDefinitions) { // not required return nil } @@ -533,6 +624,8 @@ func (o *RulesItems0) validateParamsDefinitions(formats strfmt.Registry) error { if err := o.ParamsDefinitions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params_definitions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params_definitions" + "." + strconv.Itoa(i)) } return err } @@ -543,8 +636,7 @@ func (o *RulesItems0) validateParamsDefinitions(formats strfmt.Registry) error { return nil } -func (o *RulesItems0) validateParamsValues(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0) validateParamsValues(formats strfmt.Registry) error { if swag.IsZero(o.ParamsValues) { // not required return nil } @@ -558,6 +650,8 @@ func (o *RulesItems0) validateParamsValues(formats strfmt.Registry) error { if err := o.ParamsValues[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params_values" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params_values" + "." + strconv.Itoa(i)) } return err } @@ -568,7 +662,71 @@ func (o *RulesItems0) validateParamsValues(formats strfmt.Registry) error { return nil } -var rulesItems0TypeDefaultSeverityPropEnum []interface{} +func (o *ListAlertRulesOKBodyRulesItems0) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("filters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("filters" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0) validateChannels(formats strfmt.Registry) error { + if swag.IsZero(o.Channels) { // not required + return nil + } + + for i := 0; i < len(o.Channels); i++ { + if swag.IsZero(o.Channels[i]) { // not required + continue + } + + if o.Channels[i] != nil { + if err := o.Channels[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("channels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("channels" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0) 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 listAlertRulesOkBodyRulesItems0TypeDefaultSeverityPropEnum []interface{} func init() { var res []string @@ -576,50 +734,49 @@ func init() { panic(err) } for _, v := range res { - rulesItems0TypeDefaultSeverityPropEnum = append(rulesItems0TypeDefaultSeverityPropEnum, v) + listAlertRulesOkBodyRulesItems0TypeDefaultSeverityPropEnum = append(listAlertRulesOkBodyRulesItems0TypeDefaultSeverityPropEnum, v) } } const ( - // RulesItems0DefaultSeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - RulesItems0DefaultSeveritySEVERITYINVALID string = "SEVERITY_INVALID" + // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" + ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYINVALID string = "SEVERITY_INVALID" - // RulesItems0DefaultSeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - RulesItems0DefaultSeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" + // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" + ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - // RulesItems0DefaultSeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - RulesItems0DefaultSeveritySEVERITYALERT string = "SEVERITY_ALERT" + // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" + ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYALERT string = "SEVERITY_ALERT" - // RulesItems0DefaultSeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - RulesItems0DefaultSeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" + // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" + ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - // RulesItems0DefaultSeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - RulesItems0DefaultSeveritySEVERITYERROR string = "SEVERITY_ERROR" + // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" + ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYERROR string = "SEVERITY_ERROR" - // RulesItems0DefaultSeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - RulesItems0DefaultSeveritySEVERITYWARNING string = "SEVERITY_WARNING" + // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" + ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYWARNING string = "SEVERITY_WARNING" - // RulesItems0DefaultSeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - RulesItems0DefaultSeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" + // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" + ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - // RulesItems0DefaultSeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - RulesItems0DefaultSeveritySEVERITYINFO string = "SEVERITY_INFO" + // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYINFO captures enum value "SEVERITY_INFO" + ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYINFO string = "SEVERITY_INFO" - // RulesItems0DefaultSeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - RulesItems0DefaultSeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" + // ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" + ListAlertRulesOKBodyRulesItems0DefaultSeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" ) // prop value enum -func (o *RulesItems0) validateDefaultSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, rulesItems0TypeDefaultSeverityPropEnum, true); err != nil { +func (o *ListAlertRulesOKBodyRulesItems0) validateDefaultSeverityEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0TypeDefaultSeverityPropEnum, true); err != nil { return err } return nil } -func (o *RulesItems0) validateDefaultSeverity(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0) validateDefaultSeverity(formats strfmt.Registry) error { if swag.IsZero(o.DefaultSeverity) { // not required return nil } @@ -632,7 +789,7 @@ func (o *RulesItems0) validateDefaultSeverity(formats strfmt.Registry) error { return nil } -var rulesItems0TypeSeverityPropEnum []interface{} +var listAlertRulesOkBodyRulesItems0TypeSeverityPropEnum []interface{} func init() { var res []string @@ -640,50 +797,49 @@ func init() { panic(err) } for _, v := range res { - rulesItems0TypeSeverityPropEnum = append(rulesItems0TypeSeverityPropEnum, v) + listAlertRulesOkBodyRulesItems0TypeSeverityPropEnum = append(listAlertRulesOkBodyRulesItems0TypeSeverityPropEnum, v) } } const ( - // RulesItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - RulesItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" + // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" + ListAlertRulesOKBodyRulesItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" - // RulesItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - RulesItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" + // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" + ListAlertRulesOKBodyRulesItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - // RulesItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - RulesItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" + // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" + ListAlertRulesOKBodyRulesItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" - // RulesItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - RulesItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" + // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" + ListAlertRulesOKBodyRulesItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - // RulesItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - RulesItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" + // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" + ListAlertRulesOKBodyRulesItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" - // RulesItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - RulesItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" + // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" + ListAlertRulesOKBodyRulesItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" - // RulesItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - RulesItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" + // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" + ListAlertRulesOKBodyRulesItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - // RulesItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - RulesItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" + // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" + ListAlertRulesOKBodyRulesItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" - // RulesItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - RulesItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" + // ListAlertRulesOKBodyRulesItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" + ListAlertRulesOKBodyRulesItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" ) // prop value enum -func (o *RulesItems0) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, rulesItems0TypeSeverityPropEnum, true); err != nil { +func (o *ListAlertRulesOKBodyRulesItems0) validateSeverityEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0TypeSeverityPropEnum, true); err != nil { return err } return nil } -func (o *RulesItems0) validateSeverity(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0) validateSeverity(formats strfmt.Registry) error { if swag.IsZero(o.Severity) { // not required return nil } @@ -696,21 +852,42 @@ func (o *RulesItems0) validateSeverity(formats strfmt.Registry) error { return nil } -func (o *RulesItems0) validateFilters(formats strfmt.Registry) error { +// ContextValidate validate this list alert rules OK body rules items0 based on the context it is used +func (o *ListAlertRulesOKBodyRulesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.Filters) { // not required - return nil + if err := o.contextValidateParamsDefinitions(ctx, formats); err != nil { + res = append(res, err) } - for i := 0; i < len(o.Filters); i++ { - if swag.IsZero(o.Filters[i]) { // not required - continue - } + if err := o.contextValidateParamsValues(ctx, formats); err != nil { + res = append(res, err) + } - if o.Filters[i] != nil { - if err := o.Filters[i].Validate(formats); err != nil { + if err := o.contextValidateFilters(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateChannels(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0) contextValidateParamsDefinitions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.ParamsDefinitions); i++ { + + if o.ParamsDefinitions[i] != nil { + if err := o.ParamsDefinitions[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("filters" + "." + strconv.Itoa(i)) + return ve.ValidateName("params_definitions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params_definitions" + "." + strconv.Itoa(i)) } return err } @@ -721,21 +898,36 @@ func (o *RulesItems0) validateFilters(formats strfmt.Registry) error { return nil } -func (o *RulesItems0) validateChannels(formats strfmt.Registry) error { +func (o *ListAlertRulesOKBodyRulesItems0) contextValidateParamsValues(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(o.Channels) { // not required - return nil - } + for i := 0; i < len(o.ParamsValues); i++ { - for i := 0; i < len(o.Channels); i++ { - if swag.IsZero(o.Channels[i]) { // not required - continue + if o.ParamsValues[i] != nil { + if err := o.ParamsValues[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params_values" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params_values" + "." + strconv.Itoa(i)) + } + return err + } } - if o.Channels[i] != nil { - if err := o.Channels[i].Validate(formats); err != nil { + } + + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Filters); i++ { + + if o.Filters[i] != nil { + if err := o.Filters[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("channels" + "." + strconv.Itoa(i)) + return ve.ValidateName("filters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("filters" + "." + strconv.Itoa(i)) } return err } @@ -746,21 +938,28 @@ func (o *RulesItems0) validateChannels(formats strfmt.Registry) error { return nil } -func (o *RulesItems0) validateCreatedAt(formats strfmt.Registry) error { +func (o *ListAlertRulesOKBodyRulesItems0) contextValidateChannels(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(o.CreatedAt) { // not required - return nil - } + for i := 0; i < len(o.Channels); i++ { + + if o.Channels[i] != nil { + if err := o.Channels[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("channels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("channels" + "." + strconv.Itoa(i)) + } + return err + } + } - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return err } return nil } // MarshalBinary interface implementation -func (o *RulesItems0) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -768,8 +967,8 @@ func (o *RulesItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RulesItems0) UnmarshalBinary(b []byte) error { - var res RulesItems0 +func (o *ListAlertRulesOKBodyRulesItems0) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -777,10 +976,10 @@ func (o *RulesItems0) UnmarshalBinary(b []byte) error { return nil } -/*RulesItems0ChannelsItems0 Channel represents a single Notification Channel. -swagger:model RulesItems0ChannelsItems0 +/*ListAlertRulesOKBodyRulesItems0ChannelsItems0 Channel represents a single Notification Channel. +swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0 */ -type RulesItems0ChannelsItems0 struct { +type ListAlertRulesOKBodyRulesItems0ChannelsItems0 struct { // Machine-readable ID. ChannelID string `json:"channel_id,omitempty"` @@ -792,20 +991,20 @@ type RulesItems0ChannelsItems0 struct { Disabled bool `json:"disabled,omitempty"` // email config - EmailConfig *RulesItems0ChannelsItems0EmailConfig `json:"email_config,omitempty"` + EmailConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig `json:"email_config,omitempty"` // pagerduty config - PagerdutyConfig *RulesItems0ChannelsItems0PagerdutyConfig `json:"pagerduty_config,omitempty"` + PagerdutyConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig `json:"pagerduty_config,omitempty"` // slack config - SlackConfig *RulesItems0ChannelsItems0SlackConfig `json:"slack_config,omitempty"` + SlackConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig `json:"slack_config,omitempty"` // webhook config - WebhookConfig *RulesItems0ChannelsItems0WebhookConfig `json:"webhook_config,omitempty"` + WebhookConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig `json:"webhook_config,omitempty"` } -// Validate validates this rules items0 channels items0 -func (o *RulesItems0ChannelsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 channels items0 +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateEmailConfig(formats); err != nil { @@ -830,8 +1029,7 @@ func (o *RulesItems0ChannelsItems0) Validate(formats strfmt.Registry) error { return nil } -func (o *RulesItems0ChannelsItems0) validateEmailConfig(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) validateEmailConfig(formats strfmt.Registry) error { if swag.IsZero(o.EmailConfig) { // not required return nil } @@ -840,6 +1038,8 @@ func (o *RulesItems0ChannelsItems0) validateEmailConfig(formats strfmt.Registry) if err := o.EmailConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("email_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("email_config") } return err } @@ -848,8 +1048,7 @@ func (o *RulesItems0ChannelsItems0) validateEmailConfig(formats strfmt.Registry) return nil } -func (o *RulesItems0ChannelsItems0) validatePagerdutyConfig(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) validatePagerdutyConfig(formats strfmt.Registry) error { if swag.IsZero(o.PagerdutyConfig) { // not required return nil } @@ -858,6 +1057,8 @@ func (o *RulesItems0ChannelsItems0) validatePagerdutyConfig(formats strfmt.Regis if err := o.PagerdutyConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pagerduty_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pagerduty_config") } return err } @@ -866,8 +1067,7 @@ func (o *RulesItems0ChannelsItems0) validatePagerdutyConfig(formats strfmt.Regis return nil } -func (o *RulesItems0ChannelsItems0) validateSlackConfig(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) validateSlackConfig(formats strfmt.Registry) error { if swag.IsZero(o.SlackConfig) { // not required return nil } @@ -876,6 +1076,8 @@ func (o *RulesItems0ChannelsItems0) validateSlackConfig(formats strfmt.Registry) if err := o.SlackConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("slack_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slack_config") } return err } @@ -884,8 +1086,7 @@ func (o *RulesItems0ChannelsItems0) validateSlackConfig(formats strfmt.Registry) return nil } -func (o *RulesItems0ChannelsItems0) validateWebhookConfig(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) validateWebhookConfig(formats strfmt.Registry) error { if swag.IsZero(o.WebhookConfig) { // not required return nil } @@ -894,6 +1095,98 @@ func (o *RulesItems0ChannelsItems0) validateWebhookConfig(formats strfmt.Registr if err := o.WebhookConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("webhook_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list alert rules OK body rules items0 channels items0 based on the context it is used +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateEmailConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidatePagerdutyConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSlackConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateWebhookConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) contextValidateEmailConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.EmailConfig != nil { + if err := o.EmailConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("email_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("email_config") + } + return err + } + } + + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) contextValidatePagerdutyConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.PagerdutyConfig != nil { + if err := o.PagerdutyConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pagerduty_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pagerduty_config") + } + return err + } + } + + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) contextValidateSlackConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.SlackConfig != nil { + if err := o.SlackConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("slack_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("slack_config") + } + return err + } + } + + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) contextValidateWebhookConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.WebhookConfig != nil { + if err := o.WebhookConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config") } return err } @@ -903,7 +1196,7 @@ func (o *RulesItems0ChannelsItems0) validateWebhookConfig(formats strfmt.Registr } // MarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -911,8 +1204,8 @@ func (o *RulesItems0ChannelsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0) UnmarshalBinary(b []byte) error { - var res RulesItems0ChannelsItems0 +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ChannelsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -920,10 +1213,10 @@ func (o *RulesItems0ChannelsItems0) UnmarshalBinary(b []byte) error { return nil } -/*RulesItems0ChannelsItems0EmailConfig EmailConfig represents email configuration. -swagger:model RulesItems0ChannelsItems0EmailConfig +/*ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig EmailConfig represents email configuration. +swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig */ -type RulesItems0ChannelsItems0EmailConfig struct { +type ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig struct { // send resolved SendResolved bool `json:"send_resolved,omitempty"` @@ -932,13 +1225,18 @@ type RulesItems0ChannelsItems0EmailConfig struct { To []string `json:"to"` } -// Validate validates this rules items0 channels items0 email config -func (o *RulesItems0ChannelsItems0EmailConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 channels items0 email config +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alert rules OK body rules items0 channels items0 email config based on context it is used +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0EmailConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -946,8 +1244,8 @@ func (o *RulesItems0ChannelsItems0EmailConfig) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0EmailConfig) UnmarshalBinary(b []byte) error { - var res RulesItems0ChannelsItems0EmailConfig +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ChannelsItems0EmailConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -955,10 +1253,10 @@ func (o *RulesItems0ChannelsItems0EmailConfig) UnmarshalBinary(b []byte) error { return nil } -/*RulesItems0ChannelsItems0PagerdutyConfig PagerDutyConfig represents PagerDuty configuration. -swagger:model RulesItems0ChannelsItems0PagerdutyConfig +/*ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig PagerDutyConfig represents PagerDuty configuration. +swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig */ -type RulesItems0ChannelsItems0PagerdutyConfig struct { +type ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig struct { // send resolved SendResolved bool `json:"send_resolved,omitempty"` @@ -970,13 +1268,18 @@ type RulesItems0ChannelsItems0PagerdutyConfig struct { ServiceKey string `json:"service_key,omitempty"` } -// Validate validates this rules items0 channels items0 pagerduty config -func (o *RulesItems0ChannelsItems0PagerdutyConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 channels items0 pagerduty config +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alert rules OK body rules items0 channels items0 pagerduty config based on context it is used +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -984,8 +1287,8 @@ func (o *RulesItems0ChannelsItems0PagerdutyConfig) MarshalBinary() ([]byte, erro } // UnmarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte) error { - var res RulesItems0ChannelsItems0PagerdutyConfig +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ChannelsItems0PagerdutyConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -993,10 +1296,10 @@ func (o *RulesItems0ChannelsItems0PagerdutyConfig) UnmarshalBinary(b []byte) err return nil } -/*RulesItems0ChannelsItems0SlackConfig SlackConfig represents Slack configuration. -swagger:model RulesItems0ChannelsItems0SlackConfig +/*ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig SlackConfig represents Slack configuration. +swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig */ -type RulesItems0ChannelsItems0SlackConfig struct { +type ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig struct { // send resolved SendResolved bool `json:"send_resolved,omitempty"` @@ -1005,13 +1308,18 @@ type RulesItems0ChannelsItems0SlackConfig struct { Channel string `json:"channel,omitempty"` } -// Validate validates this rules items0 channels items0 slack config -func (o *RulesItems0ChannelsItems0SlackConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 channels items0 slack config +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alert rules OK body rules items0 channels items0 slack config based on context it is used +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1019,8 +1327,8 @@ func (o *RulesItems0ChannelsItems0SlackConfig) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { - var res RulesItems0ChannelsItems0SlackConfig +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ChannelsItems0SlackConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1028,10 +1336,10 @@ func (o *RulesItems0ChannelsItems0SlackConfig) UnmarshalBinary(b []byte) error { return nil } -/*RulesItems0ChannelsItems0WebhookConfig WebhookConfig represents webhook configuration. -swagger:model RulesItems0ChannelsItems0WebhookConfig +/*ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig WebhookConfig represents webhook configuration. +swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig */ -type RulesItems0ChannelsItems0WebhookConfig struct { +type ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig struct { // send resolved SendResolved bool `json:"send_resolved,omitempty"` @@ -1043,11 +1351,11 @@ type RulesItems0ChannelsItems0WebhookConfig struct { MaxAlerts int32 `json:"max_alerts,omitempty"` // http config - HTTPConfig *RulesItems0ChannelsItems0WebhookConfigHTTPConfig `json:"http_config,omitempty"` + HTTPConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig `json:"http_config,omitempty"` } -// Validate validates this rules items0 channels items0 webhook config -func (o *RulesItems0ChannelsItems0WebhookConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 channels items0 webhook config +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) Validate(formats strfmt.Registry) error { var res []error if err := o.validateHTTPConfig(formats); err != nil { @@ -1060,8 +1368,7 @@ func (o *RulesItems0ChannelsItems0WebhookConfig) Validate(formats strfmt.Registr return nil } -func (o *RulesItems0ChannelsItems0WebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) validateHTTPConfig(formats strfmt.Registry) error { if swag.IsZero(o.HTTPConfig) { // not required return nil } @@ -1070,6 +1377,38 @@ func (o *RulesItems0ChannelsItems0WebhookConfig) validateHTTPConfig(formats strf if err := o.HTTPConfig.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("webhook_config" + "." + "http_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list alert rules OK body rules items0 channels items0 webhook config based on the context it is used +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateHTTPConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) contextValidateHTTPConfig(ctx context.Context, formats strfmt.Registry) error { + + if o.HTTPConfig != nil { + if err := o.HTTPConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config") } return err } @@ -1079,7 +1418,7 @@ func (o *RulesItems0ChannelsItems0WebhookConfig) validateHTTPConfig(formats strf } // MarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1087,8 +1426,8 @@ func (o *RulesItems0ChannelsItems0WebhookConfig) MarshalBinary() ([]byte, error) } // UnmarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error { - var res RulesItems0ChannelsItems0WebhookConfig +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1096,10 +1435,10 @@ func (o *RulesItems0ChannelsItems0WebhookConfig) UnmarshalBinary(b []byte) error return nil } -/*RulesItems0ChannelsItems0WebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. -swagger:model RulesItems0ChannelsItems0WebhookConfigHTTPConfig +/*ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig HTTPConfig represents HTTP client configuration. +swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig */ -type RulesItems0ChannelsItems0WebhookConfigHTTPConfig struct { +type ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig struct { // bearer token BearerToken string `json:"bearer_token,omitempty"` @@ -1111,21 +1450,77 @@ type RulesItems0ChannelsItems0WebhookConfigHTTPConfig struct { ProxyURL string `json:"proxy_url,omitempty"` // basic auth - BasicAuth *RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` + BasicAuth *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth `json:"basic_auth,omitempty"` + + // tls config + TLSConfig *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` +} + +// Validate validates this list alert rules OK body rules items0 channels items0 webhook config HTTP config +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateBasicAuth(formats); err != nil { + res = append(res, err) + } + + if err := o.validateTLSConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { + if swag.IsZero(o.BasicAuth) { // not required + return nil + } + + if o.BasicAuth != nil { + if err := o.BasicAuth.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") + } + return err + } + } + + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { + if swag.IsZero(o.TLSConfig) { // not required + return nil + } + + if o.TLSConfig != nil { + if err := o.TLSConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + } + return err + } + } - // tls config - TLSConfig *RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig `json:"tls_config,omitempty"` + return nil } -// Validate validates this rules items0 channels items0 webhook config HTTP config -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfig) Validate(formats strfmt.Registry) error { +// ContextValidate validate this list alert rules OK body rules items0 channels items0 webhook config HTTP config based on the context it is used +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := o.validateBasicAuth(formats); err != nil { + if err := o.contextValidateBasicAuth(ctx, formats); err != nil { res = append(res, err) } - if err := o.validateTLSConfig(formats); err != nil { + if err := o.contextValidateTLSConfig(ctx, formats); err != nil { res = append(res, err) } @@ -1135,16 +1530,14 @@ func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfig) Validate(formats strf return nil } -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfig) validateBasicAuth(formats strfmt.Registry) error { - - if swag.IsZero(o.BasicAuth) { // not required - return nil - } +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { if o.BasicAuth != nil { - if err := o.BasicAuth.Validate(formats); err != nil { + if err := o.BasicAuth.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "basic_auth") } return err } @@ -1153,16 +1546,14 @@ func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfig) validateBasicAuth(for return nil } -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(formats strfmt.Registry) error { - - if swag.IsZero(o.TLSConfig) { // not required - return nil - } +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) contextValidateTLSConfig(ctx context.Context, formats strfmt.Registry) error { if o.TLSConfig != nil { - if err := o.TLSConfig.Validate(formats); err != nil { + if err := o.TLSConfig.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("webhook_config" + "." + "http_config" + "." + "tls_config") } return err } @@ -1172,7 +1563,7 @@ func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfig) validateTLSConfig(for } // MarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1180,8 +1571,8 @@ func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfig) MarshalBinary() ([]by } // UnmarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { - var res RulesItems0ChannelsItems0WebhookConfigHTTPConfig +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1189,10 +1580,10 @@ func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfig) UnmarshalBinary(b []b return nil } -/*RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. -swagger:model RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth +/*ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth BasicAuth represents basic HTTP auth configuration. +swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth */ -type RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { +type ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { // username Username string `json:"username,omitempty"` @@ -1204,13 +1595,18 @@ type RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth struct { PasswordFile string `json:"password_file,omitempty"` } -// Validate validates this rules items0 channels items0 webhook config HTTP config basic auth -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 channels items0 webhook config HTTP config basic auth +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alert rules OK body rules items0 channels items0 webhook config HTTP config basic auth based on context it is used +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1218,8 +1614,8 @@ func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) MarshalBinar } // UnmarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { - var res RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1227,11 +1623,11 @@ func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfigBasicAuth) UnmarshalBin return nil } -/*RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager +/*ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig TLSConfig represents TLS configuration for alertmanager // https://prometheus.io/docs/alerting/latest/configuration/#tls_config -swagger:model RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig +swagger:model ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig */ -type RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { +type ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { // A path to the CA certificate file to validate the server certificate with. // ca_file and ca_file_content should not be set at the same time. @@ -1264,13 +1660,18 @@ type RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig struct { KeyFileContent string `json:"key_file_content,omitempty"` } -// Validate validates this rules items0 channels items0 webhook config HTTP config TLS config -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 channels items0 webhook config HTTP config TLS config +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alert rules OK body rules items0 channels items0 webhook config HTTP config TLS config based on context it is used +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1278,8 +1679,8 @@ func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) MarshalBinar } // UnmarshalBinary interface implementation -func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { - var res RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig +func (o *ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1287,10 +1688,16 @@ func (o *RulesItems0ChannelsItems0WebhookConfigHTTPConfigTLSConfig) UnmarshalBin return nil } -/*RulesItems0FiltersItems0 Filter repsents a single filter condition. -swagger:model RulesItems0FiltersItems0 +/*ListAlertRulesOKBodyRulesItems0FiltersItems0 Filter repsents a single filter condition. +swagger:model ListAlertRulesOKBodyRulesItems0FiltersItems0 */ -type RulesItems0FiltersItems0 struct { +type ListAlertRulesOKBodyRulesItems0FiltersItems0 struct { + + // key + Key string `json:"key,omitempty"` + + // value + Value string `json:"value,omitempty"` // FilterType represents filter matching type. // @@ -1298,16 +1705,10 @@ type RulesItems0FiltersItems0 struct { // - REGEX: =~ // Enum: [FILTER_TYPE_INVALID EQUAL REGEX] Type *string `json:"type,omitempty"` - - // key - Key string `json:"key,omitempty"` - - // value - Value string `json:"value,omitempty"` } -// Validate validates this rules items0 filters items0 -func (o *RulesItems0FiltersItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 filters items0 +func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateType(formats); err != nil { @@ -1320,7 +1721,7 @@ func (o *RulesItems0FiltersItems0) Validate(formats strfmt.Registry) error { return nil } -var rulesItems0FiltersItems0TypeTypePropEnum []interface{} +var listAlertRulesOkBodyRulesItems0FiltersItems0TypeTypePropEnum []interface{} func init() { var res []string @@ -1328,32 +1729,31 @@ func init() { panic(err) } for _, v := range res { - rulesItems0FiltersItems0TypeTypePropEnum = append(rulesItems0FiltersItems0TypeTypePropEnum, v) + listAlertRulesOkBodyRulesItems0FiltersItems0TypeTypePropEnum = append(listAlertRulesOkBodyRulesItems0FiltersItems0TypeTypePropEnum, v) } } const ( - // RulesItems0FiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" - RulesItems0FiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" + // ListAlertRulesOKBodyRulesItems0FiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" + ListAlertRulesOKBodyRulesItems0FiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" - // RulesItems0FiltersItems0TypeEQUAL captures enum value "EQUAL" - RulesItems0FiltersItems0TypeEQUAL string = "EQUAL" + // ListAlertRulesOKBodyRulesItems0FiltersItems0TypeEQUAL captures enum value "EQUAL" + ListAlertRulesOKBodyRulesItems0FiltersItems0TypeEQUAL string = "EQUAL" - // RulesItems0FiltersItems0TypeREGEX captures enum value "REGEX" - RulesItems0FiltersItems0TypeREGEX string = "REGEX" + // ListAlertRulesOKBodyRulesItems0FiltersItems0TypeREGEX captures enum value "REGEX" + ListAlertRulesOKBodyRulesItems0FiltersItems0TypeREGEX string = "REGEX" ) // prop value enum -func (o *RulesItems0FiltersItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, rulesItems0FiltersItems0TypeTypePropEnum, true); err != nil { +func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0FiltersItems0TypeTypePropEnum, true); err != nil { return err } return nil } -func (o *RulesItems0FiltersItems0) validateType(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) validateType(formats strfmt.Registry) error { if swag.IsZero(o.Type) { // not required return nil } @@ -1366,8 +1766,13 @@ func (o *RulesItems0FiltersItems0) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this list alert rules OK body rules items0 filters items0 based on context it is used +func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *RulesItems0FiltersItems0) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1375,8 +1780,8 @@ func (o *RulesItems0FiltersItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RulesItems0FiltersItems0) UnmarshalBinary(b []byte) error { - var res RulesItems0FiltersItems0 +func (o *ListAlertRulesOKBodyRulesItems0FiltersItems0) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0FiltersItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1384,10 +1789,10 @@ func (o *RulesItems0FiltersItems0) UnmarshalBinary(b []byte) error { return nil } -/*RulesItems0ParamsDefinitionsItems0 ParamDefinition represents a single query parameter. -swagger:model RulesItems0ParamsDefinitionsItems0 +/*ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0 ParamDefinition represents a single query parameter. +swagger:model ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0 */ -type RulesItems0ParamsDefinitionsItems0 struct { +type ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0 struct { // Machine-readable name (ID) that is used in expression. Name string `json:"name,omitempty"` @@ -1395,6 +1800,19 @@ type RulesItems0ParamsDefinitionsItems0 struct { // Short human-readable parameter summary. Summary string `json:"summary,omitempty"` + // bool + Bool *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool `json:"bool,omitempty"` + + // float + Float *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float `json:"float,omitempty"` + + // string + String *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String `json:"string,omitempty"` + + // ParamType represents template parameter type. + // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] + Type *string `json:"type,omitempty"` + // ParamUnit represents template parameter unit. // // - PARAM_UNIT_INVALID: Invalid, unknown or absent. @@ -1402,42 +1820,29 @@ type RulesItems0ParamsDefinitionsItems0 struct { // - SECONDS: s // Enum: [PARAM_UNIT_INVALID PERCENTAGE SECONDS] Unit *string `json:"unit,omitempty"` - - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - - // bool - Bool *RulesItems0ParamsDefinitionsItems0Bool `json:"bool,omitempty"` - - // float - Float *RulesItems0ParamsDefinitionsItems0Float `json:"float,omitempty"` - - // string - String *RulesItems0ParamsDefinitionsItems0String `json:"string,omitempty"` } -// Validate validates this rules items0 params definitions items0 -func (o *RulesItems0ParamsDefinitionsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 params definitions items0 +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateUnit(formats); err != nil { + if err := o.validateBool(formats); err != nil { res = append(res, err) } - if err := o.validateType(formats); err != nil { + if err := o.validateFloat(formats); err != nil { res = append(res, err) } - if err := o.validateBool(formats); err != nil { + if err := o.validateString(formats); err != nil { res = append(res, err) } - if err := o.validateFloat(formats); err != nil { + if err := o.validateType(formats); err != nil { res = append(res, err) } - if err := o.validateString(formats); err != nil { + if err := o.validateUnit(formats); err != nil { res = append(res, err) } @@ -1447,111 +1852,186 @@ func (o *RulesItems0ParamsDefinitionsItems0) Validate(formats strfmt.Registry) e return nil } -var rulesItems0ParamsDefinitionsItems0TypeUnitPropEnum []interface{} +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bool") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bool") + } + return err + } + } + + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("float") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("float") + } + return err + } + } + + return nil +} + +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("string") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("string") + } + return err + } + } + + return nil +} + +var listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["PARAM_UNIT_INVALID","PERCENTAGE","SECONDS"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { panic(err) } for _, v := range res { - rulesItems0ParamsDefinitionsItems0TypeUnitPropEnum = append(rulesItems0ParamsDefinitionsItems0TypeUnitPropEnum, v) + listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeTypePropEnum = append(listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeTypePropEnum, v) } } const ( - // RulesItems0ParamsDefinitionsItems0UnitPARAMUNITINVALID captures enum value "PARAM_UNIT_INVALID" - RulesItems0ParamsDefinitionsItems0UnitPARAMUNITINVALID string = "PARAM_UNIT_INVALID" + // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" + ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - // RulesItems0ParamsDefinitionsItems0UnitPERCENTAGE captures enum value "PERCENTAGE" - RulesItems0ParamsDefinitionsItems0UnitPERCENTAGE string = "PERCENTAGE" + // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeBOOL captures enum value "BOOL" + ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeBOOL string = "BOOL" - // RulesItems0ParamsDefinitionsItems0UnitSECONDS captures enum value "SECONDS" - RulesItems0ParamsDefinitionsItems0UnitSECONDS string = "SECONDS" + // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeFLOAT captures enum value "FLOAT" + ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeFLOAT string = "FLOAT" + + // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeSTRING captures enum value "STRING" + ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0TypeSTRING string = "STRING" ) // prop value enum -func (o *RulesItems0ParamsDefinitionsItems0) validateUnitEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, rulesItems0ParamsDefinitionsItems0TypeUnitPropEnum, true); err != nil { +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeTypePropEnum, true); err != nil { return err } return nil } -func (o *RulesItems0ParamsDefinitionsItems0) validateUnit(formats strfmt.Registry) error { - - if swag.IsZero(o.Unit) { // not required +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateType(formats strfmt.Registry) error { + if swag.IsZero(o.Type) { // not required return nil } // value enum - if err := o.validateUnitEnum("unit", "body", *o.Unit); err != nil { + if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { return err } return nil } -var rulesItems0ParamsDefinitionsItems0TypeTypePropEnum []interface{} +var listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeUnitPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["PARAM_UNIT_INVALID","PERCENTAGE","SECONDS"]`), &res); err != nil { panic(err) } for _, v := range res { - rulesItems0ParamsDefinitionsItems0TypeTypePropEnum = append(rulesItems0ParamsDefinitionsItems0TypeTypePropEnum, v) + listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeUnitPropEnum = append(listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeUnitPropEnum, v) } } const ( - // RulesItems0ParamsDefinitionsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - RulesItems0ParamsDefinitionsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" + // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitPARAMUNITINVALID captures enum value "PARAM_UNIT_INVALID" + ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitPARAMUNITINVALID string = "PARAM_UNIT_INVALID" - // RulesItems0ParamsDefinitionsItems0TypeBOOL captures enum value "BOOL" - RulesItems0ParamsDefinitionsItems0TypeBOOL string = "BOOL" + // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitPERCENTAGE captures enum value "PERCENTAGE" + ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitPERCENTAGE string = "PERCENTAGE" - // RulesItems0ParamsDefinitionsItems0TypeFLOAT captures enum value "FLOAT" - RulesItems0ParamsDefinitionsItems0TypeFLOAT string = "FLOAT" - - // RulesItems0ParamsDefinitionsItems0TypeSTRING captures enum value "STRING" - RulesItems0ParamsDefinitionsItems0TypeSTRING string = "STRING" + // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitSECONDS captures enum value "SECONDS" + ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0UnitSECONDS string = "SECONDS" ) // prop value enum -func (o *RulesItems0ParamsDefinitionsItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, rulesItems0ParamsDefinitionsItems0TypeTypePropEnum, true); err != nil { +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateUnitEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0TypeUnitPropEnum, true); err != nil { return err } return nil } -func (o *RulesItems0ParamsDefinitionsItems0) validateType(formats strfmt.Registry) error { - - if swag.IsZero(o.Type) { // not required +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) validateUnit(formats strfmt.Registry) error { + if swag.IsZero(o.Unit) { // not required return nil } // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { + if err := o.validateUnitEnum("unit", "body", *o.Unit); err != nil { return err } return nil } -func (o *RulesItems0ParamsDefinitionsItems0) validateBool(formats strfmt.Registry) error { +// ContextValidate validate this list alert rules OK body rules items0 params definitions items0 based on the context it is used +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.Bool) { // not required - return nil + 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 *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) contextValidateBool(ctx context.Context, formats strfmt.Registry) error { if o.Bool != nil { - if err := o.Bool.Validate(formats); err != nil { + if err := o.Bool.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("bool") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bool") } return err } @@ -1560,16 +2040,14 @@ func (o *RulesItems0ParamsDefinitionsItems0) validateBool(formats strfmt.Registr return nil } -func (o *RulesItems0ParamsDefinitionsItems0) validateFloat(formats strfmt.Registry) error { - - if swag.IsZero(o.Float) { // not required - return nil - } +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) contextValidateFloat(ctx context.Context, formats strfmt.Registry) error { if o.Float != nil { - if err := o.Float.Validate(formats); err != nil { + if err := o.Float.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("float") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("float") } return err } @@ -1578,16 +2056,14 @@ func (o *RulesItems0ParamsDefinitionsItems0) validateFloat(formats strfmt.Regist return nil } -func (o *RulesItems0ParamsDefinitionsItems0) validateString(formats strfmt.Registry) error { - - if swag.IsZero(o.String) { // not required - return nil - } +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) contextValidateString(ctx context.Context, formats strfmt.Registry) error { if o.String != nil { - if err := o.String.Validate(formats); err != nil { + if err := o.String.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("string") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("string") } return err } @@ -1597,7 +2073,7 @@ func (o *RulesItems0ParamsDefinitionsItems0) validateString(formats strfmt.Regis } // MarshalBinary interface implementation -func (o *RulesItems0ParamsDefinitionsItems0) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1605,8 +2081,8 @@ func (o *RulesItems0ParamsDefinitionsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RulesItems0ParamsDefinitionsItems0) UnmarshalBinary(b []byte) error { - var res RulesItems0ParamsDefinitionsItems0 +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1614,10 +2090,10 @@ func (o *RulesItems0ParamsDefinitionsItems0) UnmarshalBinary(b []byte) error { return nil } -/*RulesItems0ParamsDefinitionsItems0Bool BoolParamDefinition represents boolean parameter's default value. -swagger:model RulesItems0ParamsDefinitionsItems0Bool +/*ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool BoolParamDefinition represents boolean parameter's default value. +swagger:model ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool */ -type RulesItems0ParamsDefinitionsItems0Bool struct { +type ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool struct { // BooleanFlag represent a command to set some boolean property to true, // to false, or avoid changing that property. @@ -1629,8 +2105,8 @@ type RulesItems0ParamsDefinitionsItems0Bool struct { Default *string `json:"default,omitempty"` } -// Validate validates this rules items0 params definitions items0 bool -func (o *RulesItems0ParamsDefinitionsItems0Bool) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 params definitions items0 bool +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) Validate(formats strfmt.Registry) error { var res []error if err := o.validateDefault(formats); err != nil { @@ -1643,7 +2119,7 @@ func (o *RulesItems0ParamsDefinitionsItems0Bool) Validate(formats strfmt.Registr return nil } -var rulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum []interface{} +var listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum []interface{} func init() { var res []string @@ -1651,32 +2127,31 @@ func init() { panic(err) } for _, v := range res { - rulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum = append(rulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum, v) + listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum = append(listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum, v) } } const ( - // RulesItems0ParamsDefinitionsItems0BoolDefaultDONOTCHANGE captures enum value "DO_NOT_CHANGE" - RulesItems0ParamsDefinitionsItems0BoolDefaultDONOTCHANGE string = "DO_NOT_CHANGE" + // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultDONOTCHANGE captures enum value "DO_NOT_CHANGE" + ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultDONOTCHANGE string = "DO_NOT_CHANGE" - // RulesItems0ParamsDefinitionsItems0BoolDefaultTRUE captures enum value "TRUE" - RulesItems0ParamsDefinitionsItems0BoolDefaultTRUE string = "TRUE" + // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultTRUE captures enum value "TRUE" + ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultTRUE string = "TRUE" - // RulesItems0ParamsDefinitionsItems0BoolDefaultFALSE captures enum value "FALSE" - RulesItems0ParamsDefinitionsItems0BoolDefaultFALSE string = "FALSE" + // ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultFALSE captures enum value "FALSE" + ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0BoolDefaultFALSE string = "FALSE" ) // prop value enum -func (o *RulesItems0ParamsDefinitionsItems0Bool) validateDefaultEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, rulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum, true); err != nil { +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) validateDefaultEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0ParamsDefinitionsItems0BoolTypeDefaultPropEnum, true); err != nil { return err } return nil } -func (o *RulesItems0ParamsDefinitionsItems0Bool) validateDefault(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) validateDefault(formats strfmt.Registry) error { if swag.IsZero(o.Default) { // not required return nil } @@ -1689,8 +2164,13 @@ func (o *RulesItems0ParamsDefinitionsItems0Bool) validateDefault(formats strfmt. return nil } +// ContextValidate validates this list alert rules OK body rules items0 params definitions items0 bool based on context it is used +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *RulesItems0ParamsDefinitionsItems0Bool) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1698,8 +2178,8 @@ func (o *RulesItems0ParamsDefinitionsItems0Bool) MarshalBinary() ([]byte, error) } // UnmarshalBinary interface implementation -func (o *RulesItems0ParamsDefinitionsItems0Bool) UnmarshalBinary(b []byte) error { - var res RulesItems0ParamsDefinitionsItems0Bool +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Bool if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1707,10 +2187,10 @@ func (o *RulesItems0ParamsDefinitionsItems0Bool) UnmarshalBinary(b []byte) error return nil } -/*RulesItems0ParamsDefinitionsItems0Float FloatParamDefinition represents float parameter's default value and valid range. -swagger:model RulesItems0ParamsDefinitionsItems0Float +/*ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float FloatParamDefinition represents float parameter's default value and valid range. +swagger:model ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float */ -type RulesItems0ParamsDefinitionsItems0Float struct { +type ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float struct { // True if default value is set. HasDefault bool `json:"has_default,omitempty"` @@ -1731,13 +2211,18 @@ type RulesItems0ParamsDefinitionsItems0Float struct { Max float64 `json:"max,omitempty"` } -// Validate validates this rules items0 params definitions items0 float -func (o *RulesItems0ParamsDefinitionsItems0Float) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 params definitions items0 float +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alert rules OK body rules items0 params definitions items0 float based on context it is used +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *RulesItems0ParamsDefinitionsItems0Float) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1745,8 +2230,8 @@ func (o *RulesItems0ParamsDefinitionsItems0Float) MarshalBinary() ([]byte, error } // UnmarshalBinary interface implementation -func (o *RulesItems0ParamsDefinitionsItems0Float) UnmarshalBinary(b []byte) error { - var res RulesItems0ParamsDefinitionsItems0Float +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0Float if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1754,10 +2239,10 @@ func (o *RulesItems0ParamsDefinitionsItems0Float) UnmarshalBinary(b []byte) erro return nil } -/*RulesItems0ParamsDefinitionsItems0String StringParamDefinition represents string parameter's default value. -swagger:model RulesItems0ParamsDefinitionsItems0String +/*ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String StringParamDefinition represents string parameter's default value. +swagger:model ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String */ -type RulesItems0ParamsDefinitionsItems0String struct { +type ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String struct { // True if default value is set. HasDefault bool `json:"has_default,omitempty"` @@ -1766,13 +2251,18 @@ type RulesItems0ParamsDefinitionsItems0String struct { Default string `json:"default,omitempty"` } -// Validate validates this rules items0 params definitions items0 string -func (o *RulesItems0ParamsDefinitionsItems0String) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 params definitions items0 string +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alert rules OK body rules items0 params definitions items0 string based on context it is used +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *RulesItems0ParamsDefinitionsItems0String) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1780,8 +2270,8 @@ func (o *RulesItems0ParamsDefinitionsItems0String) MarshalBinary() ([]byte, erro } // UnmarshalBinary interface implementation -func (o *RulesItems0ParamsDefinitionsItems0String) UnmarshalBinary(b []byte) error { - var res RulesItems0ParamsDefinitionsItems0String +func (o *ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ParamsDefinitionsItems0String if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1789,18 +2279,14 @@ func (o *RulesItems0ParamsDefinitionsItems0String) UnmarshalBinary(b []byte) err return nil } -/*RulesItems0ParamsValuesItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. -swagger:model RulesItems0ParamsValuesItems0 +/*ListAlertRulesOKBodyRulesItems0ParamsValuesItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. +swagger:model ListAlertRulesOKBodyRulesItems0ParamsValuesItems0 */ -type RulesItems0ParamsValuesItems0 struct { +type ListAlertRulesOKBodyRulesItems0ParamsValuesItems0 struct { // Machine-readable name (ID) that is used in expression. Name string `json:"name,omitempty"` - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - // Bool value. Bool bool `json:"bool,omitempty"` @@ -1809,10 +2295,14 @@ type RulesItems0ParamsValuesItems0 struct { // String value. String string `json:"string,omitempty"` + + // ParamType represents template parameter type. + // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] + Type *string `json:"type,omitempty"` } -// Validate validates this rules items0 params values items0 -func (o *RulesItems0ParamsValuesItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list alert rules OK body rules items0 params values items0 +func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateType(formats); err != nil { @@ -1825,7 +2315,7 @@ func (o *RulesItems0ParamsValuesItems0) Validate(formats strfmt.Registry) error return nil } -var rulesItems0ParamsValuesItems0TypeTypePropEnum []interface{} +var listAlertRulesOkBodyRulesItems0ParamsValuesItems0TypeTypePropEnum []interface{} func init() { var res []string @@ -1833,35 +2323,34 @@ func init() { panic(err) } for _, v := range res { - rulesItems0ParamsValuesItems0TypeTypePropEnum = append(rulesItems0ParamsValuesItems0TypeTypePropEnum, v) + listAlertRulesOkBodyRulesItems0ParamsValuesItems0TypeTypePropEnum = append(listAlertRulesOkBodyRulesItems0ParamsValuesItems0TypeTypePropEnum, v) } } const ( - // RulesItems0ParamsValuesItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - RulesItems0ParamsValuesItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" + // ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" + ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - // RulesItems0ParamsValuesItems0TypeBOOL captures enum value "BOOL" - RulesItems0ParamsValuesItems0TypeBOOL string = "BOOL" + // ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeBOOL captures enum value "BOOL" + ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeBOOL string = "BOOL" - // RulesItems0ParamsValuesItems0TypeFLOAT captures enum value "FLOAT" - RulesItems0ParamsValuesItems0TypeFLOAT string = "FLOAT" + // ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeFLOAT captures enum value "FLOAT" + ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeFLOAT string = "FLOAT" - // RulesItems0ParamsValuesItems0TypeSTRING captures enum value "STRING" - RulesItems0ParamsValuesItems0TypeSTRING string = "STRING" + // ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeSTRING captures enum value "STRING" + ListAlertRulesOKBodyRulesItems0ParamsValuesItems0TypeSTRING string = "STRING" ) // prop value enum -func (o *RulesItems0ParamsValuesItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, rulesItems0ParamsValuesItems0TypeTypePropEnum, true); err != nil { +func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listAlertRulesOkBodyRulesItems0ParamsValuesItems0TypeTypePropEnum, true); err != nil { return err } return nil } -func (o *RulesItems0ParamsValuesItems0) validateType(formats strfmt.Registry) error { - +func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) validateType(formats strfmt.Registry) error { if swag.IsZero(o.Type) { // not required return nil } @@ -1874,8 +2363,93 @@ func (o *RulesItems0ParamsValuesItems0) validateType(formats strfmt.Registry) er return nil } +// ContextValidate validates this list alert rules OK body rules items0 params values items0 based on context it is used +func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListAlertRulesOKBodyRulesItems0ParamsValuesItems0) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyRulesItems0ParamsValuesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListAlertRulesOKBodyTotals PageTotals represents total values for pagination. +swagger:model ListAlertRulesOKBodyTotals +*/ +type ListAlertRulesOKBodyTotals struct { + + // Total number of results. + TotalItems int32 `json:"total_items,omitempty"` + + // Total number of pages. + TotalPages int32 `json:"total_pages,omitempty"` +} + +// Validate validates this list alert rules OK body totals +func (o *ListAlertRulesOKBodyTotals) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alert rules OK body totals based on context it is used +func (o *ListAlertRulesOKBodyTotals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListAlertRulesOKBodyTotals) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListAlertRulesOKBodyTotals) UnmarshalBinary(b []byte) error { + var res ListAlertRulesOKBodyTotals + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListAlertRulesParamsBodyPageParams PageParams represents page request parameters for pagination. +swagger:model ListAlertRulesParamsBodyPageParams +*/ +type ListAlertRulesParamsBodyPageParams struct { + + // Maximum number of results per page. + PageSize int32 `json:"page_size,omitempty"` + + // Index of the requested page, starts from 0. + Index int32 `json:"index,omitempty"` +} + +// Validate validates this list alert rules params body page params +func (o *ListAlertRulesParamsBodyPageParams) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list alert rules params body page params based on context it is used +func (o *ListAlertRulesParamsBodyPageParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *RulesItems0ParamsValuesItems0) MarshalBinary() ([]byte, error) { +func (o *ListAlertRulesParamsBodyPageParams) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1883,8 +2457,8 @@ func (o *RulesItems0ParamsValuesItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RulesItems0ParamsValuesItems0) UnmarshalBinary(b []byte) error { - var res RulesItems0ParamsValuesItems0 +func (o *ListAlertRulesParamsBodyPageParams) UnmarshalBinary(b []byte) error { + var res ListAlertRulesParamsBodyPageParams if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/ia/json/client/rules/rules_client.go b/api/managementpb/ia/json/client/rules/rules_client.go index 711311da84..4c46d0b150 100644 --- a/api/managementpb/ia/json/client/rules/rules_client.go +++ b/api/managementpb/ia/json/client/rules/rules_client.go @@ -23,17 +23,20 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateAlertRule(params *CreateAlertRuleParams) (*CreateAlertRuleOK, error) + CreateAlertRule(params *CreateAlertRuleParams, opts ...ClientOption) (*CreateAlertRuleOK, error) - DeleteAlertRule(params *DeleteAlertRuleParams) (*DeleteAlertRuleOK, error) + DeleteAlertRule(params *DeleteAlertRuleParams, opts ...ClientOption) (*DeleteAlertRuleOK, error) - ListAlertRules(params *ListAlertRulesParams) (*ListAlertRulesOK, error) + ListAlertRules(params *ListAlertRulesParams, opts ...ClientOption) (*ListAlertRulesOK, error) - ToggleAlertRule(params *ToggleAlertRuleParams) (*ToggleAlertRuleOK, error) + ToggleAlertRule(params *ToggleAlertRuleParams, opts ...ClientOption) (*ToggleAlertRuleOK, error) - UpdateAlertRule(params *UpdateAlertRuleParams) (*UpdateAlertRuleOK, error) + UpdateAlertRule(params *UpdateAlertRuleParams, opts ...ClientOption) (*UpdateAlertRuleOK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { /* CreateAlertRule creates alert rule creates alerting rule */ -func (a *Client) CreateAlertRule(params *CreateAlertRuleParams) (*CreateAlertRuleOK, error) { +func (a *Client) CreateAlertRule(params *CreateAlertRuleParams, opts ...ClientOption) (*CreateAlertRuleOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateAlertRuleParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "CreateAlertRule", Method: "POST", PathPattern: "/v1/management/ia/Rules/Create", @@ -58,7 +60,12 @@ func (a *Client) CreateAlertRule(params *CreateAlertRuleParams) (*CreateAlertRul Reader: &CreateAlertRuleReader{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 } @@ -74,13 +81,12 @@ func (a *Client) CreateAlertRule(params *CreateAlertRuleParams) (*CreateAlertRul /* DeleteAlertRule deletes alert rule deletes alerting rule */ -func (a *Client) DeleteAlertRule(params *DeleteAlertRuleParams) (*DeleteAlertRuleOK, error) { +func (a *Client) DeleteAlertRule(params *DeleteAlertRuleParams, opts ...ClientOption) (*DeleteAlertRuleOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteAlertRuleParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "DeleteAlertRule", Method: "POST", PathPattern: "/v1/management/ia/Rules/Delete", @@ -91,7 +97,12 @@ func (a *Client) DeleteAlertRule(params *DeleteAlertRuleParams) (*DeleteAlertRul Reader: &DeleteAlertRuleReader{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 } @@ -107,13 +118,12 @@ func (a *Client) DeleteAlertRule(params *DeleteAlertRuleParams) (*DeleteAlertRul /* ListAlertRules lists alert rules returns a list of all alerting rules */ -func (a *Client) ListAlertRules(params *ListAlertRulesParams) (*ListAlertRulesOK, error) { +func (a *Client) ListAlertRules(params *ListAlertRulesParams, opts ...ClientOption) (*ListAlertRulesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListAlertRulesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListAlertRules", Method: "POST", PathPattern: "/v1/management/ia/Rules/List", @@ -124,7 +134,12 @@ func (a *Client) ListAlertRules(params *ListAlertRulesParams) (*ListAlertRulesOK Reader: &ListAlertRulesReader{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 } @@ -140,13 +155,12 @@ func (a *Client) ListAlertRules(params *ListAlertRulesParams) (*ListAlertRulesOK /* ToggleAlertRule toggles alert rule allows to switch between disabled and enabled states of an alert rule */ -func (a *Client) ToggleAlertRule(params *ToggleAlertRuleParams) (*ToggleAlertRuleOK, error) { +func (a *Client) ToggleAlertRule(params *ToggleAlertRuleParams, opts ...ClientOption) (*ToggleAlertRuleOK, error) { // TODO: Validate the params before sending if params == nil { params = NewToggleAlertRuleParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ToggleAlertRule", Method: "POST", PathPattern: "/v1/management/ia/Rules/Toggle", @@ -157,7 +171,12 @@ func (a *Client) ToggleAlertRule(params *ToggleAlertRuleParams) (*ToggleAlertRul Reader: &ToggleAlertRuleReader{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 } @@ -173,13 +192,12 @@ func (a *Client) ToggleAlertRule(params *ToggleAlertRuleParams) (*ToggleAlertRul /* UpdateAlertRule updates alert rule updates alerting rule */ -func (a *Client) UpdateAlertRule(params *UpdateAlertRuleParams) (*UpdateAlertRuleOK, error) { +func (a *Client) UpdateAlertRule(params *UpdateAlertRuleParams, opts ...ClientOption) (*UpdateAlertRuleOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateAlertRuleParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "UpdateAlertRule", Method: "POST", PathPattern: "/v1/management/ia/Rules/Update", @@ -190,7 +208,12 @@ func (a *Client) UpdateAlertRule(params *UpdateAlertRuleParams) (*UpdateAlertRul Reader: &UpdateAlertRuleReader{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 } diff --git a/api/managementpb/ia/json/client/rules/toggle_alert_rule_parameters.go b/api/managementpb/ia/json/client/rules/toggle_alert_rule_parameters.go index b5783f65dc..296d2a14e6 100644 --- a/api/managementpb/ia/json/client/rules/toggle_alert_rule_parameters.go +++ b/api/managementpb/ia/json/client/rules/toggle_alert_rule_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewToggleAlertRuleParams creates a new ToggleAlertRuleParams object -// with the default values initialized. +// NewToggleAlertRuleParams creates a new ToggleAlertRuleParams 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 NewToggleAlertRuleParams() *ToggleAlertRuleParams { - var () return &ToggleAlertRuleParams{ - timeout: cr.DefaultTimeout, } } // NewToggleAlertRuleParamsWithTimeout creates a new ToggleAlertRuleParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewToggleAlertRuleParamsWithTimeout(timeout time.Duration) *ToggleAlertRuleParams { - var () return &ToggleAlertRuleParams{ - timeout: timeout, } } // NewToggleAlertRuleParamsWithContext creates a new ToggleAlertRuleParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewToggleAlertRuleParamsWithContext(ctx context.Context) *ToggleAlertRuleParams { - var () return &ToggleAlertRuleParams{ - Context: ctx, } } // NewToggleAlertRuleParamsWithHTTPClient creates a new ToggleAlertRuleParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewToggleAlertRuleParamsWithHTTPClient(client *http.Client) *ToggleAlertRuleParams { - var () return &ToggleAlertRuleParams{ HTTPClient: client, } } -/*ToggleAlertRuleParams contains all the parameters to send to the API endpoint -for the toggle alert rule operation typically these are written to a http.Request +/* ToggleAlertRuleParams contains all the parameters to send to the API endpoint + for the toggle alert rule operation. + + Typically these are written to a http.Request. */ type ToggleAlertRuleParams struct { - /*Body*/ + // Body. Body ToggleAlertRuleBody timeout time.Duration @@ -68,6 +67,21 @@ type ToggleAlertRuleParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the toggle alert rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleAlertRuleParams) WithDefaults() *ToggleAlertRuleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the toggle alert rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleAlertRuleParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the toggle alert rule params func (o *ToggleAlertRuleParams) WithTimeout(timeout time.Duration) *ToggleAlertRuleParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ToggleAlertRuleParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/rules/toggle_alert_rule_responses.go b/api/managementpb/ia/json/client/rules/toggle_alert_rule_responses.go index 2d738d319a..1e8c4c03fb 100644 --- a/api/managementpb/ia/json/client/rules/toggle_alert_rule_responses.go +++ b/api/managementpb/ia/json/client/rules/toggle_alert_rule_responses.go @@ -6,6 +6,7 @@ package rules // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewToggleAlertRuleOK() *ToggleAlertRuleOK { return &ToggleAlertRuleOK{} } -/*ToggleAlertRuleOK handles this case with default header values. +/* ToggleAlertRuleOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ToggleAlertRuleOK struct { func (o *ToggleAlertRuleOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Rules/Toggle][%d] toggleAlertRuleOk %+v", 200, o.Payload) } - func (o *ToggleAlertRuleOK) GetPayload() interface{} { return o.Payload } @@ -82,7 +82,7 @@ func NewToggleAlertRuleDefault(code int) *ToggleAlertRuleDefault { } } -/*ToggleAlertRuleDefault handles this case with default header values. +/* ToggleAlertRuleDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *ToggleAlertRuleDefault) Code() int { func (o *ToggleAlertRuleDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Rules/Toggle][%d] ToggleAlertRule default %+v", o._statusCode, o.Payload) } - func (o *ToggleAlertRuleDefault) GetPayload() *ToggleAlertRuleDefaultBody { return o.Payload } @@ -182,7 +181,6 @@ func (o *ToggleAlertRuleBody) validateDisabledEnum(path, location string, value } func (o *ToggleAlertRuleBody) validateDisabled(formats strfmt.Registry) error { - if swag.IsZero(o.Disabled) { // not required return nil } @@ -195,6 +193,11 @@ func (o *ToggleAlertRuleBody) validateDisabled(formats strfmt.Registry) error { return nil } +// ContextValidate validates this toggle alert rule body based on context it is used +func (o *ToggleAlertRuleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ToggleAlertRuleBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -228,7 +231,7 @@ type ToggleAlertRuleDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ToggleAlertRuleDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this toggle alert rule default body @@ -246,7 +249,6 @@ func (o *ToggleAlertRuleDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ToggleAlertRuleDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -260,6 +262,42 @@ func (o *ToggleAlertRuleDefaultBody) validateDetails(formats strfmt.Registry) er if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ToggleAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ToggleAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this toggle alert rule default body based on the context it is used +func (o *ToggleAlertRuleDefaultBody) 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 *ToggleAlertRuleDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ToggleAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ToggleAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -287,3 +325,44 @@ func (o *ToggleAlertRuleDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*ToggleAlertRuleDefaultBodyDetailsItems0 toggle alert rule default body details items0 +swagger:model ToggleAlertRuleDefaultBodyDetailsItems0 +*/ +type ToggleAlertRuleDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this toggle alert rule default body details items0 +func (o *ToggleAlertRuleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this toggle alert rule default body details items0 based on context it is used +func (o *ToggleAlertRuleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ToggleAlertRuleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ToggleAlertRuleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ToggleAlertRuleDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/ia/json/client/rules/update_alert_rule_parameters.go b/api/managementpb/ia/json/client/rules/update_alert_rule_parameters.go index cd060a1b87..3526de2cf0 100644 --- a/api/managementpb/ia/json/client/rules/update_alert_rule_parameters.go +++ b/api/managementpb/ia/json/client/rules/update_alert_rule_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUpdateAlertRuleParams creates a new UpdateAlertRuleParams object -// with the default values initialized. +// NewUpdateAlertRuleParams creates a new UpdateAlertRuleParams 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 NewUpdateAlertRuleParams() *UpdateAlertRuleParams { - var () return &UpdateAlertRuleParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateAlertRuleParamsWithTimeout creates a new UpdateAlertRuleParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateAlertRuleParamsWithTimeout(timeout time.Duration) *UpdateAlertRuleParams { - var () return &UpdateAlertRuleParams{ - timeout: timeout, } } // NewUpdateAlertRuleParamsWithContext creates a new UpdateAlertRuleParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateAlertRuleParamsWithContext(ctx context.Context) *UpdateAlertRuleParams { - var () return &UpdateAlertRuleParams{ - Context: ctx, } } // NewUpdateAlertRuleParamsWithHTTPClient creates a new UpdateAlertRuleParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateAlertRuleParamsWithHTTPClient(client *http.Client) *UpdateAlertRuleParams { - var () return &UpdateAlertRuleParams{ HTTPClient: client, } } -/*UpdateAlertRuleParams contains all the parameters to send to the API endpoint -for the update alert rule operation typically these are written to a http.Request +/* UpdateAlertRuleParams contains all the parameters to send to the API endpoint + for the update alert rule operation. + + Typically these are written to a http.Request. */ type UpdateAlertRuleParams struct { - /*Body*/ + // Body. Body UpdateAlertRuleBody timeout time.Duration @@ -68,6 +67,21 @@ type UpdateAlertRuleParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update alert rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAlertRuleParams) WithDefaults() *UpdateAlertRuleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update alert rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAlertRuleParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update alert rule params func (o *UpdateAlertRuleParams) WithTimeout(timeout time.Duration) *UpdateAlertRuleParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *UpdateAlertRuleParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/rules/update_alert_rule_responses.go b/api/managementpb/ia/json/client/rules/update_alert_rule_responses.go index 45586d97a6..1494e84e1e 100644 --- a/api/managementpb/ia/json/client/rules/update_alert_rule_responses.go +++ b/api/managementpb/ia/json/client/rules/update_alert_rule_responses.go @@ -6,6 +6,7 @@ package rules // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewUpdateAlertRuleOK() *UpdateAlertRuleOK { return &UpdateAlertRuleOK{} } -/*UpdateAlertRuleOK handles this case with default header values. +/* UpdateAlertRuleOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type UpdateAlertRuleOK struct { func (o *UpdateAlertRuleOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Rules/Update][%d] updateAlertRuleOk %+v", 200, o.Payload) } - func (o *UpdateAlertRuleOK) GetPayload() interface{} { return o.Payload } @@ -82,7 +82,7 @@ func NewUpdateAlertRuleDefault(code int) *UpdateAlertRuleDefault { } } -/*UpdateAlertRuleDefault handles this case with default header values. +/* UpdateAlertRuleDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *UpdateAlertRuleDefault) Code() int { func (o *UpdateAlertRuleDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Rules/Update][%d] UpdateAlertRule default %+v", o._statusCode, o.Payload) } - func (o *UpdateAlertRuleDefault) GetPayload() *UpdateAlertRuleDefaultBody { return o.Payload } @@ -132,23 +131,23 @@ type UpdateAlertRuleBody struct { Disabled bool `json:"disabled,omitempty"` // Rule parameters. All template parameters should be set. - Params []*ParamsItems0 `json:"params"` + Params []*UpdateAlertRuleParamsBodyParamsItems0 `json:"params"` // Rule duration. Should be set. For string `json:"for,omitempty"` - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID 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. Should be set. - Filters []*FiltersItems0 `json:"filters"` + Filters []*UpdateAlertRuleParamsBodyFiltersItems0 `json:"filters"` // Channels. Should be set. ChannelIds []string `json:"channel_ids"` + + // Severity represents severity level of the check result or alert. + // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] + Severity *string `json:"severity,omitempty"` } // Validate validates this update alert rule body @@ -159,11 +158,11 @@ func (o *UpdateAlertRuleBody) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := o.validateSeverity(formats); err != nil { + if err := o.validateFilters(formats); err != nil { res = append(res, err) } - if err := o.validateFilters(formats); err != nil { + if err := o.validateSeverity(formats); err != nil { res = append(res, err) } @@ -174,7 +173,6 @@ func (o *UpdateAlertRuleBody) Validate(formats strfmt.Registry) error { } func (o *UpdateAlertRuleBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required return nil } @@ -188,6 +186,34 @@ func (o *UpdateAlertRuleBody) validateParams(formats strfmt.Registry) error { if err := o.Params[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *UpdateAlertRuleBody) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) } return err } @@ -249,7 +275,6 @@ func (o *UpdateAlertRuleBody) validateSeverityEnum(path, location string, value } func (o *UpdateAlertRuleBody) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(o.Severity) { // not required return nil } @@ -262,21 +287,54 @@ func (o *UpdateAlertRuleBody) validateSeverity(formats strfmt.Registry) error { return nil } -func (o *UpdateAlertRuleBody) validateFilters(formats strfmt.Registry) error { +// ContextValidate validate this update alert rule body based on the context it is used +func (o *UpdateAlertRuleBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.Filters) { // not required - return nil + if err := o.contextValidateParams(ctx, formats); err != nil { + res = append(res, err) } - for i := 0; i < len(o.Filters); i++ { - if swag.IsZero(o.Filters[i]) { // not required - continue + if err := o.contextValidateFilters(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *UpdateAlertRuleBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Params); i++ { + + if o.Params[i] != nil { + if err := o.Params[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } + return err + } } + } + + return nil +} + +func (o *UpdateAlertRuleBody) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Filters); i++ { + if o.Filters[i] != nil { - if err := o.Filters[i].Validate(formats); err != nil { + if err := o.Filters[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "filters" + "." + strconv.Itoa(i)) } return err } @@ -320,7 +378,7 @@ type UpdateAlertRuleDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*UpdateAlertRuleDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this update alert rule default body @@ -338,7 +396,6 @@ func (o *UpdateAlertRuleDefaultBody) Validate(formats strfmt.Registry) error { } func (o *UpdateAlertRuleDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -352,6 +409,42 @@ func (o *UpdateAlertRuleDefaultBody) validateDetails(formats strfmt.Registry) er if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("UpdateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UpdateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update alert rule default body based on the context it is used +func (o *UpdateAlertRuleDefaultBody) 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 *UpdateAlertRuleDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UpdateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UpdateAlertRule default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -379,3 +472,252 @@ func (o *UpdateAlertRuleDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*UpdateAlertRuleDefaultBodyDetailsItems0 update alert rule default body details items0 +swagger:model UpdateAlertRuleDefaultBodyDetailsItems0 +*/ +type UpdateAlertRuleDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this update alert rule default body details items0 +func (o *UpdateAlertRuleDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update alert rule default body details items0 based on context it is used +func (o *UpdateAlertRuleDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UpdateAlertRuleDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UpdateAlertRuleDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res UpdateAlertRuleDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*UpdateAlertRuleParamsBodyFiltersItems0 Filter repsents a single filter condition. +swagger:model UpdateAlertRuleParamsBodyFiltersItems0 +*/ +type UpdateAlertRuleParamsBodyFiltersItems0 struct { + + // key + Key string `json:"key,omitempty"` + + // value + Value string `json:"value,omitempty"` + + // FilterType represents filter matching type. + // + // - EQUAL: = + // - REGEX: =~ + // Enum: [FILTER_TYPE_INVALID EQUAL REGEX] + Type *string `json:"type,omitempty"` +} + +// Validate validates this update alert rule params body filters items0 +func (o *UpdateAlertRuleParamsBodyFiltersItems0) 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 updateAlertRuleParamsBodyFiltersItems0TypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["FILTER_TYPE_INVALID","EQUAL","REGEX"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateAlertRuleParamsBodyFiltersItems0TypeTypePropEnum = append(updateAlertRuleParamsBodyFiltersItems0TypeTypePropEnum, v) + } +} + +const ( + + // UpdateAlertRuleParamsBodyFiltersItems0TypeFILTERTYPEINVALID captures enum value "FILTER_TYPE_INVALID" + UpdateAlertRuleParamsBodyFiltersItems0TypeFILTERTYPEINVALID string = "FILTER_TYPE_INVALID" + + // UpdateAlertRuleParamsBodyFiltersItems0TypeEQUAL captures enum value "EQUAL" + UpdateAlertRuleParamsBodyFiltersItems0TypeEQUAL string = "EQUAL" + + // UpdateAlertRuleParamsBodyFiltersItems0TypeREGEX captures enum value "REGEX" + UpdateAlertRuleParamsBodyFiltersItems0TypeREGEX string = "REGEX" +) + +// prop value enum +func (o *UpdateAlertRuleParamsBodyFiltersItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateAlertRuleParamsBodyFiltersItems0TypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *UpdateAlertRuleParamsBodyFiltersItems0) 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 update alert rule params body filters items0 based on context it is used +func (o *UpdateAlertRuleParamsBodyFiltersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UpdateAlertRuleParamsBodyFiltersItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UpdateAlertRuleParamsBodyFiltersItems0) UnmarshalBinary(b []byte) error { + var res UpdateAlertRuleParamsBodyFiltersItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*UpdateAlertRuleParamsBodyParamsItems0 ParamValue represents a single rule parameter value for List, Change and Update APIs. +swagger:model UpdateAlertRuleParamsBodyParamsItems0 +*/ +type UpdateAlertRuleParamsBodyParamsItems0 struct { + + // Machine-readable name (ID) that is used in expression. + Name string `json:"name,omitempty"` + + // Bool value. + Bool bool `json:"bool,omitempty"` + + // Float value. + Float float64 `json:"float,omitempty"` + + // String value. + String string `json:"string,omitempty"` + + // ParamType represents template parameter type. + // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] + Type *string `json:"type,omitempty"` +} + +// Validate validates this update alert rule params body params items0 +func (o *UpdateAlertRuleParamsBodyParamsItems0) 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 updateAlertRuleParamsBodyParamsItems0TypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateAlertRuleParamsBodyParamsItems0TypeTypePropEnum = append(updateAlertRuleParamsBodyParamsItems0TypeTypePropEnum, v) + } +} + +const ( + + // UpdateAlertRuleParamsBodyParamsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" + UpdateAlertRuleParamsBodyParamsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" + + // UpdateAlertRuleParamsBodyParamsItems0TypeBOOL captures enum value "BOOL" + UpdateAlertRuleParamsBodyParamsItems0TypeBOOL string = "BOOL" + + // UpdateAlertRuleParamsBodyParamsItems0TypeFLOAT captures enum value "FLOAT" + UpdateAlertRuleParamsBodyParamsItems0TypeFLOAT string = "FLOAT" + + // UpdateAlertRuleParamsBodyParamsItems0TypeSTRING captures enum value "STRING" + UpdateAlertRuleParamsBodyParamsItems0TypeSTRING string = "STRING" +) + +// prop value enum +func (o *UpdateAlertRuleParamsBodyParamsItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateAlertRuleParamsBodyParamsItems0TypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (o *UpdateAlertRuleParamsBodyParamsItems0) 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 update alert rule params body params items0 based on context it is used +func (o *UpdateAlertRuleParamsBodyParamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UpdateAlertRuleParamsBodyParamsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UpdateAlertRuleParamsBodyParamsItems0) UnmarshalBinary(b []byte) error { + var res UpdateAlertRuleParamsBodyParamsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/ia/json/client/templates/create_template_parameters.go b/api/managementpb/ia/json/client/templates/create_template_parameters.go index 500c628626..f7ac23a22a 100644 --- a/api/managementpb/ia/json/client/templates/create_template_parameters.go +++ b/api/managementpb/ia/json/client/templates/create_template_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCreateTemplateParams creates a new CreateTemplateParams object -// with the default values initialized. +// 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 { - var () return &CreateTemplateParams{ - timeout: cr.DefaultTimeout, } } // NewCreateTemplateParamsWithTimeout creates a new CreateTemplateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateTemplateParamsWithTimeout(timeout time.Duration) *CreateTemplateParams { - var () return &CreateTemplateParams{ - timeout: timeout, } } // NewCreateTemplateParamsWithContext creates a new CreateTemplateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateTemplateParamsWithContext(ctx context.Context) *CreateTemplateParams { - var () return &CreateTemplateParams{ - Context: ctx, } } // NewCreateTemplateParamsWithHTTPClient creates a new CreateTemplateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateTemplateParamsWithHTTPClient(client *http.Client) *CreateTemplateParams { - var () 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 +/* 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. Body CreateTemplateBody timeout time.Duration @@ -68,6 +67,21 @@ type CreateTemplateParams struct { 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) @@ -119,7 +133,6 @@ func (o *CreateTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/templates/create_template_responses.go b/api/managementpb/ia/json/client/templates/create_template_responses.go index 47ca951486..08c99d72e8 100644 --- a/api/managementpb/ia/json/client/templates/create_template_responses.go +++ b/api/managementpb/ia/json/client/templates/create_template_responses.go @@ -6,6 +6,7 @@ package templates // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewCreateTemplateOK() *CreateTemplateOK { return &CreateTemplateOK{} } -/*CreateTemplateOK handles this case with default header values. +/* CreateTemplateOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type CreateTemplateOK struct { func (o *CreateTemplateOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Templates/Create][%d] createTemplateOk %+v", 200, o.Payload) } - func (o *CreateTemplateOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewCreateTemplateDefault(code int) *CreateTemplateDefault { } } -/*CreateTemplateDefault handles this case with default header values. +/* CreateTemplateDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *CreateTemplateDefault) Code() int { func (o *CreateTemplateDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Templates/Create][%d] CreateTemplate default %+v", o._statusCode, o.Payload) } - func (o *CreateTemplateDefault) GetPayload() *CreateTemplateDefaultBody { return o.Payload } @@ -129,6 +128,11 @@ 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 { @@ -162,7 +166,7 @@ type CreateTemplateDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*CreateTemplateDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this create template default body @@ -180,7 +184,6 @@ func (o *CreateTemplateDefaultBody) Validate(formats strfmt.Registry) error { } func (o *CreateTemplateDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -194,6 +197,42 @@ func (o *CreateTemplateDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("CreateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CreateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CreateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -222,10 +261,10 @@ func (o *CreateTemplateDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*CreateTemplateDefaultBodyDetailsItems0 create template default body details items0 +swagger:model CreateTemplateDefaultBodyDetailsItems0 */ -type DetailsItems0 struct { +type CreateTemplateDefaultBodyDetailsItems0 struct { // type url TypeURL string `json:"type_url,omitempty"` @@ -235,13 +274,18 @@ type DetailsItems0 struct { Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// 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 *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *CreateTemplateDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -249,8 +293,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *CreateTemplateDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res CreateTemplateDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/ia/json/client/templates/delete_template_parameters.go b/api/managementpb/ia/json/client/templates/delete_template_parameters.go index 85991a058e..d5d0d89daa 100644 --- a/api/managementpb/ia/json/client/templates/delete_template_parameters.go +++ b/api/managementpb/ia/json/client/templates/delete_template_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteTemplateParams creates a new DeleteTemplateParams object -// with the default values initialized. +// 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 { - var () return &DeleteTemplateParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteTemplateParamsWithTimeout creates a new DeleteTemplateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteTemplateParamsWithTimeout(timeout time.Duration) *DeleteTemplateParams { - var () return &DeleteTemplateParams{ - timeout: timeout, } } // NewDeleteTemplateParamsWithContext creates a new DeleteTemplateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteTemplateParamsWithContext(ctx context.Context) *DeleteTemplateParams { - var () return &DeleteTemplateParams{ - Context: ctx, } } // NewDeleteTemplateParamsWithHTTPClient creates a new DeleteTemplateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteTemplateParamsWithHTTPClient(client *http.Client) *DeleteTemplateParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body DeleteTemplateBody timeout time.Duration @@ -68,6 +67,21 @@ type DeleteTemplateParams struct { 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) @@ -119,7 +133,6 @@ func (o *DeleteTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/templates/delete_template_responses.go b/api/managementpb/ia/json/client/templates/delete_template_responses.go index ce232bbeae..b81f4c35f8 100644 --- a/api/managementpb/ia/json/client/templates/delete_template_responses.go +++ b/api/managementpb/ia/json/client/templates/delete_template_responses.go @@ -6,6 +6,7 @@ package templates // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewDeleteTemplateOK() *DeleteTemplateOK { return &DeleteTemplateOK{} } -/*DeleteTemplateOK handles this case with default header values. +/* DeleteTemplateOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type DeleteTemplateOK struct { func (o *DeleteTemplateOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Templates/Delete][%d] deleteTemplateOk %+v", 200, o.Payload) } - func (o *DeleteTemplateOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewDeleteTemplateDefault(code int) *DeleteTemplateDefault { } } -/*DeleteTemplateDefault handles this case with default header values. +/* DeleteTemplateDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *DeleteTemplateDefault) Code() int { func (o *DeleteTemplateDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Templates/Delete][%d] DeleteTemplate default %+v", o._statusCode, o.Payload) } - func (o *DeleteTemplateDefault) GetPayload() *DeleteTemplateDefaultBody { return o.Payload } @@ -129,6 +128,11 @@ func (o *DeleteTemplateBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this delete template body based on context it is used +func (o *DeleteTemplateBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *DeleteTemplateBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -162,7 +166,7 @@ type DeleteTemplateDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*DeleteTemplateDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this delete template default body @@ -180,7 +184,6 @@ func (o *DeleteTemplateDefaultBody) Validate(formats strfmt.Registry) error { } func (o *DeleteTemplateDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -194,6 +197,42 @@ func (o *DeleteTemplateDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("DeleteTemplate default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DeleteTemplate default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("DeleteTemplate default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -221,3 +260,44 @@ func (o *DeleteTemplateDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*DeleteTemplateDefaultBodyDetailsItems0 delete template default body details items0 +swagger:model DeleteTemplateDefaultBodyDetailsItems0 +*/ +type DeleteTemplateDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/managementpb/ia/json/client/templates/list_templates_parameters.go b/api/managementpb/ia/json/client/templates/list_templates_parameters.go index 93a93da9c6..91d485f627 100644 --- a/api/managementpb/ia/json/client/templates/list_templates_parameters.go +++ b/api/managementpb/ia/json/client/templates/list_templates_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListTemplatesParams creates a new ListTemplatesParams object -// with the default values initialized. +// 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 { - var () return &ListTemplatesParams{ - timeout: cr.DefaultTimeout, } } // NewListTemplatesParamsWithTimeout creates a new ListTemplatesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListTemplatesParamsWithTimeout(timeout time.Duration) *ListTemplatesParams { - var () return &ListTemplatesParams{ - timeout: timeout, } } // NewListTemplatesParamsWithContext creates a new ListTemplatesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListTemplatesParamsWithContext(ctx context.Context) *ListTemplatesParams { - var () return &ListTemplatesParams{ - Context: ctx, } } // NewListTemplatesParamsWithHTTPClient creates a new ListTemplatesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListTemplatesParamsWithHTTPClient(client *http.Client) *ListTemplatesParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body ListTemplatesBody timeout time.Duration @@ -68,6 +67,21 @@ type ListTemplatesParams struct { 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) @@ -119,7 +133,6 @@ func (o *ListTemplatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/templates/list_templates_responses.go b/api/managementpb/ia/json/client/templates/list_templates_responses.go index 166186ebfa..cbf04de0c3 100644 --- a/api/managementpb/ia/json/client/templates/list_templates_responses.go +++ b/api/managementpb/ia/json/client/templates/list_templates_responses.go @@ -6,6 +6,7 @@ package templates // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListTemplatesOK() *ListTemplatesOK { return &ListTemplatesOK{} } -/*ListTemplatesOK handles this case with default header values. +/* ListTemplatesOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListTemplatesOK struct { func (o *ListTemplatesOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Templates/List][%d] listTemplatesOk %+v", 200, o.Payload) } - func (o *ListTemplatesOK) GetPayload() *ListTemplatesOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListTemplatesDefault(code int) *ListTemplatesDefault { } } -/*ListTemplatesDefault handles this case with default header values. +/* ListTemplatesDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListTemplatesDefault) Code() int { func (o *ListTemplatesDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Templates/List][%d] ListTemplates default %+v", o._statusCode, o.Payload) } - func (o *ListTemplatesDefault) GetPayload() *ListTemplatesDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *ListTemplatesBody) Validate(formats strfmt.Registry) error { } func (o *ListTemplatesBody) validatePageParams(formats strfmt.Registry) error { - if swag.IsZero(o.PageParams) { // not required return nil } @@ -155,6 +153,38 @@ func (o *ListTemplatesBody) validatePageParams(formats strfmt.Registry) error { if err := o.PageParams.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "page_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "page_params") + } + return err + } + } + + return nil +} + +// ContextValidate validate this list templates body based on the context it is used +func (o *ListTemplatesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePageParams(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListTemplatesBody) contextValidatePageParams(ctx context.Context, formats strfmt.Registry) error { + + if o.PageParams != nil { + if err := o.PageParams.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "page_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "page_params") } return err } @@ -196,7 +226,7 @@ type ListTemplatesDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ListTemplatesDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this list templates default body @@ -214,7 +244,6 @@ func (o *ListTemplatesDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ListTemplatesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *ListTemplatesDefaultBody) validateDetails(formats strfmt.Registry) erro if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListTemplates default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListTemplates default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListTemplates default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,13 +321,54 @@ func (o *ListTemplatesDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ListTemplatesDefaultBodyDetailsItems0 list templates default body details items0 +swagger:model ListTemplatesDefaultBodyDetailsItems0 +*/ +type ListTemplatesDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 { // templates - Templates []*TemplatesItems0 `json:"templates"` + Templates []*ListTemplatesOKBodyTemplatesItems0 `json:"templates"` // totals Totals *ListTemplatesOKBodyTotals `json:"totals,omitempty"` @@ -287,7 +393,6 @@ func (o *ListTemplatesOKBody) Validate(formats strfmt.Registry) error { } func (o *ListTemplatesOKBody) validateTemplates(formats strfmt.Registry) error { - if swag.IsZero(o.Templates) { // not required return nil } @@ -301,6 +406,8 @@ func (o *ListTemplatesOKBody) validateTemplates(formats strfmt.Registry) error { if err := o.Templates[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listTemplatesOk" + "." + "templates" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listTemplatesOk" + "." + "templates" + "." + strconv.Itoa(i)) } return err } @@ -312,7 +419,6 @@ func (o *ListTemplatesOKBody) validateTemplates(formats strfmt.Registry) error { } func (o *ListTemplatesOKBody) validateTotals(formats strfmt.Registry) error { - if swag.IsZero(o.Totals) { // not required return nil } @@ -321,6 +427,8 @@ func (o *ListTemplatesOKBody) validateTotals(formats strfmt.Registry) error { if err := o.Totals.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listTemplatesOk" + "." + "totals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listTemplatesOk" + "." + "totals") } return err } @@ -329,78 +437,62 @@ func (o *ListTemplatesOKBody) validateTotals(formats strfmt.Registry) error { return nil } -// MarshalBinary interface implementation -func (o *ListTemplatesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, 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) } - 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 + if err := o.contextValidateTotals(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) } - *o = res return nil } -/*ListTemplatesOKBodyTotals PageTotals represents total values for pagination. -swagger:model ListTemplatesOKBodyTotals -*/ -type ListTemplatesOKBodyTotals struct { - - // Total number of results. - TotalItems int32 `json:"total_items,omitempty"` +func (o *ListTemplatesOKBody) contextValidateTemplates(ctx context.Context, formats strfmt.Registry) error { - // Total number of pages. - TotalPages int32 `json:"total_pages,omitempty"` -} + for i := 0; i < len(o.Templates); i++ { -// Validate validates this list templates OK body totals -func (o *ListTemplatesOKBodyTotals) Validate(formats strfmt.Registry) error { - return nil -} + if o.Templates[i] != nil { + if err := o.Templates[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listTemplatesOk" + "." + "templates" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listTemplatesOk" + "." + "templates" + "." + strconv.Itoa(i)) + } + return err + } + } -// MarshalBinary interface implementation -func (o *ListTemplatesOKBodyTotals) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil } - return swag.WriteJSON(o) -} -// UnmarshalBinary interface implementation -func (o *ListTemplatesOKBodyTotals) UnmarshalBinary(b []byte) error { - var res ListTemplatesOKBodyTotals - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res return nil } -/*ListTemplatesParamsBodyPageParams PageParams represents page request parameters for pagination. -swagger:model ListTemplatesParamsBodyPageParams -*/ -type ListTemplatesParamsBodyPageParams struct { - - // Maximum number of results per page. - PageSize int32 `json:"page_size,omitempty"` +func (o *ListTemplatesOKBody) contextValidateTotals(ctx context.Context, formats strfmt.Registry) error { - // Index of the requested page, starts from 0. - Index int32 `json:"index,omitempty"` -} + if o.Totals != nil { + if err := o.Totals.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listTemplatesOk" + "." + "totals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listTemplatesOk" + "." + "totals") + } + return err + } + } -// Validate validates this list templates params body page params -func (o *ListTemplatesParamsBodyPageParams) Validate(formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ListTemplatesParamsBodyPageParams) MarshalBinary() ([]byte, error) { +func (o *ListTemplatesOKBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -408,8 +500,8 @@ func (o *ListTemplatesParamsBodyPageParams) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListTemplatesParamsBodyPageParams) UnmarshalBinary(b []byte) error { - var res ListTemplatesParamsBodyPageParams +func (o *ListTemplatesOKBody) UnmarshalBinary(b []byte) error { + var res ListTemplatesOKBody if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -417,10 +509,10 @@ func (o *ListTemplatesParamsBodyPageParams) UnmarshalBinary(b []byte) error { return nil } -/*TemplatesItems0 Template represents Alert Template that is used to create Alert Rule. -swagger:model TemplatesItems0 +/*ListTemplatesOKBodyTemplatesItems0 Template represents Alert Template that is used to create Alert Rule. +swagger:model ListTemplatesOKBodyTemplatesItems0 */ -type TemplatesItems0 struct { +type ListTemplatesOKBodyTemplatesItems0 struct { // Machine-readable name (ID). Name string `json:"name,omitempty"` @@ -432,21 +524,28 @@ type TemplatesItems0 struct { Expr string `json:"expr,omitempty"` // Query parameters definitions. - Params []*TemplatesItems0ParamsItems0 `json:"params"` + Params []*ListTemplatesOKBodyTemplatesItems0ParamsItems0 `json:"params"` // Default duration value. For string `json:"for,omitempty"` - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID 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"` + // Template creation time. Empty for built-in and SaaS templates. + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // YAML (or JSON) template file content. Empty for built-in and SaaS templates. + Yaml string `json:"yaml,omitempty"` + + // Severity represents severity level of the check result or alert. + // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] + Severity *string `json:"severity,omitempty"` + // TemplateSource defines template source. // // - BUILT_IN: Template that is shipped with PMM Server releases. @@ -455,32 +554,25 @@ type TemplatesItems0 struct { // - USER_API: Templated created via API. // Enum: [TEMPLATE_SOURCE_INVALID BUILT_IN SAAS USER_FILE 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 (or JSON) template file content. Empty for built-in and SaaS templates. - Yaml string `json:"yaml,omitempty"` } -// Validate validates this templates items0 -func (o *TemplatesItems0) Validate(formats strfmt.Registry) error { +// 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 { + if err := o.validateCreatedAt(formats); err != nil { res = append(res, err) } - if err := o.validateSource(formats); err != nil { + if err := o.validateSeverity(formats); err != nil { res = append(res, err) } - if err := o.validateCreatedAt(formats); err != nil { + if err := o.validateSource(formats); err != nil { res = append(res, err) } @@ -490,8 +582,7 @@ func (o *TemplatesItems0) Validate(formats strfmt.Registry) error { return nil } -func (o *TemplatesItems0) validateParams(formats strfmt.Registry) error { - +func (o *ListTemplatesOKBodyTemplatesItems0) validateParams(formats strfmt.Registry) error { if swag.IsZero(o.Params) { // not required return nil } @@ -505,6 +596,8 @@ func (o *TemplatesItems0) validateParams(formats strfmt.Registry) error { if err := o.Params[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("params" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + strconv.Itoa(i)) } return err } @@ -515,7 +608,19 @@ func (o *TemplatesItems0) validateParams(formats strfmt.Registry) error { return nil } -var templatesItems0TypeSeverityPropEnum []interface{} +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 +} + +var listTemplatesOkBodyTemplatesItems0TypeSeverityPropEnum []interface{} func init() { var res []string @@ -523,50 +628,49 @@ func init() { panic(err) } for _, v := range res { - templatesItems0TypeSeverityPropEnum = append(templatesItems0TypeSeverityPropEnum, v) + listTemplatesOkBodyTemplatesItems0TypeSeverityPropEnum = append(listTemplatesOkBodyTemplatesItems0TypeSeverityPropEnum, v) } } const ( - // TemplatesItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - TemplatesItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" + // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" + ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" - // TemplatesItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - TemplatesItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" + // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" + ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - // TemplatesItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - TemplatesItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" + // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" + ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" - // TemplatesItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - TemplatesItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" + // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" + ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - // TemplatesItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - TemplatesItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" + // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" + ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" - // TemplatesItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - TemplatesItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" + // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" + ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" - // TemplatesItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - TemplatesItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" + // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" + ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - // TemplatesItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - TemplatesItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" + // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" + ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" - // TemplatesItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - TemplatesItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" + // ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" + ListTemplatesOKBodyTemplatesItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" ) // prop value enum -func (o *TemplatesItems0) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, templatesItems0TypeSeverityPropEnum, true); err != nil { +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 *TemplatesItems0) validateSeverity(formats strfmt.Registry) error { - +func (o *ListTemplatesOKBodyTemplatesItems0) validateSeverity(formats strfmt.Registry) error { if swag.IsZero(o.Severity) { // not required return nil } @@ -579,7 +683,7 @@ func (o *TemplatesItems0) validateSeverity(formats strfmt.Registry) error { return nil } -var templatesItems0TypeSourcePropEnum []interface{} +var listTemplatesOkBodyTemplatesItems0TypeSourcePropEnum []interface{} func init() { var res []string @@ -587,38 +691,37 @@ func init() { panic(err) } for _, v := range res { - templatesItems0TypeSourcePropEnum = append(templatesItems0TypeSourcePropEnum, v) + listTemplatesOkBodyTemplatesItems0TypeSourcePropEnum = append(listTemplatesOkBodyTemplatesItems0TypeSourcePropEnum, v) } } const ( - // TemplatesItems0SourceTEMPLATESOURCEINVALID captures enum value "TEMPLATE_SOURCE_INVALID" - TemplatesItems0SourceTEMPLATESOURCEINVALID string = "TEMPLATE_SOURCE_INVALID" + // ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCEINVALID captures enum value "TEMPLATE_SOURCE_INVALID" + ListTemplatesOKBodyTemplatesItems0SourceTEMPLATESOURCEINVALID string = "TEMPLATE_SOURCE_INVALID" - // TemplatesItems0SourceBUILTIN captures enum value "BUILT_IN" - TemplatesItems0SourceBUILTIN string = "BUILT_IN" + // ListTemplatesOKBodyTemplatesItems0SourceBUILTIN captures enum value "BUILT_IN" + ListTemplatesOKBodyTemplatesItems0SourceBUILTIN string = "BUILT_IN" - // TemplatesItems0SourceSAAS captures enum value "SAAS" - TemplatesItems0SourceSAAS string = "SAAS" + // ListTemplatesOKBodyTemplatesItems0SourceSAAS captures enum value "SAAS" + ListTemplatesOKBodyTemplatesItems0SourceSAAS string = "SAAS" - // TemplatesItems0SourceUSERFILE captures enum value "USER_FILE" - TemplatesItems0SourceUSERFILE string = "USER_FILE" + // ListTemplatesOKBodyTemplatesItems0SourceUSERFILE captures enum value "USER_FILE" + ListTemplatesOKBodyTemplatesItems0SourceUSERFILE string = "USER_FILE" - // TemplatesItems0SourceUSERAPI captures enum value "USER_API" - TemplatesItems0SourceUSERAPI string = "USER_API" + // ListTemplatesOKBodyTemplatesItems0SourceUSERAPI captures enum value "USER_API" + ListTemplatesOKBodyTemplatesItems0SourceUSERAPI string = "USER_API" ) // prop value enum -func (o *TemplatesItems0) validateSourceEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, templatesItems0TypeSourcePropEnum, true); err != nil { +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 *TemplatesItems0) validateSource(formats strfmt.Registry) error { - +func (o *ListTemplatesOKBodyTemplatesItems0) validateSource(formats strfmt.Registry) error { if swag.IsZero(o.Source) { // not required return nil } @@ -631,21 +734,42 @@ func (o *TemplatesItems0) validateSource(formats strfmt.Registry) error { return nil } -func (o *TemplatesItems0) validateCreatedAt(formats strfmt.Registry) error { +// 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 swag.IsZero(o.CreatedAt) { // not required - return nil + if err := o.contextValidateParams(ctx, formats); err != nil { + res = append(res, err) } - if err := validate.FormatOf("created_at", "body", "date-time", o.CreatedAt.String(), formats); err != nil { - return 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 err := o.Params[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + strconv.Itoa(i)) + } + return err + } + } + } return nil } // MarshalBinary interface implementation -func (o *TemplatesItems0) MarshalBinary() ([]byte, error) { +func (o *ListTemplatesOKBodyTemplatesItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -653,8 +777,8 @@ func (o *TemplatesItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *TemplatesItems0) UnmarshalBinary(b []byte) error { - var res TemplatesItems0 +func (o *ListTemplatesOKBodyTemplatesItems0) UnmarshalBinary(b []byte) error { + var res ListTemplatesOKBodyTemplatesItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -662,10 +786,10 @@ func (o *TemplatesItems0) UnmarshalBinary(b []byte) error { return nil } -/*TemplatesItems0ParamsItems0 ParamDefinition represents a single query parameter. -swagger:model TemplatesItems0ParamsItems0 +/*ListTemplatesOKBodyTemplatesItems0ParamsItems0 ParamDefinition represents a single query parameter. +swagger:model ListTemplatesOKBodyTemplatesItems0ParamsItems0 */ -type TemplatesItems0ParamsItems0 struct { +type ListTemplatesOKBodyTemplatesItems0ParamsItems0 struct { // Machine-readable name (ID) that is used in expression. Name string `json:"name,omitempty"` @@ -673,6 +797,19 @@ type TemplatesItems0ParamsItems0 struct { // Short human-readable parameter summary. Summary string `json:"summary,omitempty"` + // bool + Bool *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool `json:"bool,omitempty"` + + // float + Float *ListTemplatesOKBodyTemplatesItems0ParamsItems0Float `json:"float,omitempty"` + + // string + String *ListTemplatesOKBodyTemplatesItems0ParamsItems0String `json:"string,omitempty"` + + // ParamType represents template parameter type. + // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] + Type *string `json:"type,omitempty"` + // ParamUnit represents template parameter unit. // // - PARAM_UNIT_INVALID: Invalid, unknown or absent. @@ -680,42 +817,29 @@ type TemplatesItems0ParamsItems0 struct { // - SECONDS: s // Enum: [PARAM_UNIT_INVALID PERCENTAGE SECONDS] Unit *string `json:"unit,omitempty"` - - // ParamType represents template parameter type. - // Enum: [PARAM_TYPE_INVALID BOOL FLOAT STRING] - Type *string `json:"type,omitempty"` - - // bool - Bool *TemplatesItems0ParamsItems0Bool `json:"bool,omitempty"` - - // float - Float *TemplatesItems0ParamsItems0Float `json:"float,omitempty"` - - // string - String *TemplatesItems0ParamsItems0String `json:"string,omitempty"` } -// Validate validates this templates items0 params items0 -func (o *TemplatesItems0ParamsItems0) Validate(formats strfmt.Registry) error { +// 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 { + if err := o.validateBool(formats); err != nil { res = append(res, err) } - if err := o.validateType(formats); err != nil { + if err := o.validateFloat(formats); err != nil { res = append(res, err) } - if err := o.validateBool(formats); err != nil { + if err := o.validateString(formats); err != nil { res = append(res, err) } - if err := o.validateFloat(formats); err != nil { + if err := o.validateType(formats); err != nil { res = append(res, err) } - if err := o.validateString(formats); err != nil { + if err := o.validateUnit(formats); err != nil { res = append(res, err) } @@ -725,111 +849,186 @@ func (o *TemplatesItems0ParamsItems0) Validate(formats strfmt.Registry) error { return nil } -var templatesItems0ParamsItems0TypeUnitPropEnum []interface{} +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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bool") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("float") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("string") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("string") + } + return err + } + } + + return nil +} + +var listTemplatesOkBodyTemplatesItems0ParamsItems0TypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["PARAM_UNIT_INVALID","PERCENTAGE","SECONDS"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { panic(err) } for _, v := range res { - templatesItems0ParamsItems0TypeUnitPropEnum = append(templatesItems0ParamsItems0TypeUnitPropEnum, v) + listTemplatesOkBodyTemplatesItems0ParamsItems0TypeTypePropEnum = append(listTemplatesOkBodyTemplatesItems0ParamsItems0TypeTypePropEnum, v) } } const ( - // TemplatesItems0ParamsItems0UnitPARAMUNITINVALID captures enum value "PARAM_UNIT_INVALID" - TemplatesItems0ParamsItems0UnitPARAMUNITINVALID string = "PARAM_UNIT_INVALID" + // ListTemplatesOKBodyTemplatesItems0ParamsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" + ListTemplatesOKBodyTemplatesItems0ParamsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - // TemplatesItems0ParamsItems0UnitPERCENTAGE captures enum value "PERCENTAGE" - TemplatesItems0ParamsItems0UnitPERCENTAGE string = "PERCENTAGE" + // ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeBOOL captures enum value "BOOL" + ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeBOOL string = "BOOL" - // TemplatesItems0ParamsItems0UnitSECONDS captures enum value "SECONDS" - TemplatesItems0ParamsItems0UnitSECONDS string = "SECONDS" + // ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeFLOAT captures enum value "FLOAT" + ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeFLOAT string = "FLOAT" + + // ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeSTRING captures enum value "STRING" + ListTemplatesOKBodyTemplatesItems0ParamsItems0TypeSTRING string = "STRING" ) // prop value enum -func (o *TemplatesItems0ParamsItems0) validateUnitEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, templatesItems0ParamsItems0TypeUnitPropEnum, true); err != nil { +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 *TemplatesItems0ParamsItems0) validateUnit(formats strfmt.Registry) error { - - if swag.IsZero(o.Unit) { // not required +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) validateType(formats strfmt.Registry) error { + if swag.IsZero(o.Type) { // not required return nil } // value enum - if err := o.validateUnitEnum("unit", "body", *o.Unit); err != nil { + if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { return err } return nil } -var templatesItems0ParamsItems0TypeTypePropEnum []interface{} +var listTemplatesOkBodyTemplatesItems0ParamsItems0TypeUnitPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["PARAM_TYPE_INVALID","BOOL","FLOAT","STRING"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["PARAM_UNIT_INVALID","PERCENTAGE","SECONDS"]`), &res); err != nil { panic(err) } for _, v := range res { - templatesItems0ParamsItems0TypeTypePropEnum = append(templatesItems0ParamsItems0TypeTypePropEnum, v) + listTemplatesOkBodyTemplatesItems0ParamsItems0TypeUnitPropEnum = append(listTemplatesOkBodyTemplatesItems0ParamsItems0TypeUnitPropEnum, v) } } const ( - // TemplatesItems0ParamsItems0TypePARAMTYPEINVALID captures enum value "PARAM_TYPE_INVALID" - TemplatesItems0ParamsItems0TypePARAMTYPEINVALID string = "PARAM_TYPE_INVALID" - - // TemplatesItems0ParamsItems0TypeBOOL captures enum value "BOOL" - TemplatesItems0ParamsItems0TypeBOOL string = "BOOL" + // ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPARAMUNITINVALID captures enum value "PARAM_UNIT_INVALID" + ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPARAMUNITINVALID string = "PARAM_UNIT_INVALID" - // TemplatesItems0ParamsItems0TypeFLOAT captures enum value "FLOAT" - TemplatesItems0ParamsItems0TypeFLOAT string = "FLOAT" + // ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPERCENTAGE captures enum value "PERCENTAGE" + ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitPERCENTAGE string = "PERCENTAGE" - // TemplatesItems0ParamsItems0TypeSTRING captures enum value "STRING" - TemplatesItems0ParamsItems0TypeSTRING string = "STRING" + // ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitSECONDS captures enum value "SECONDS" + ListTemplatesOKBodyTemplatesItems0ParamsItems0UnitSECONDS string = "SECONDS" ) // prop value enum -func (o *TemplatesItems0ParamsItems0) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, templatesItems0ParamsItems0TypeTypePropEnum, true); err != nil { +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 *TemplatesItems0ParamsItems0) validateType(formats strfmt.Registry) error { - - if swag.IsZero(o.Type) { // not required +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) validateUnit(formats strfmt.Registry) error { + if swag.IsZero(o.Unit) { // not required return nil } // value enum - if err := o.validateTypeEnum("type", "body", *o.Type); err != nil { + if err := o.validateUnitEnum("unit", "body", *o.Unit); err != nil { return err } return nil } -func (o *TemplatesItems0ParamsItems0) validateBool(formats strfmt.Registry) error { +// 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 swag.IsZero(o.Bool) { // not required - return nil + 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 err := o.Bool.Validate(formats); err != nil { + if err := o.Bool.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("bool") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bool") } return err } @@ -838,16 +1037,14 @@ func (o *TemplatesItems0ParamsItems0) validateBool(formats strfmt.Registry) erro return nil } -func (o *TemplatesItems0ParamsItems0) validateFloat(formats strfmt.Registry) error { - - if swag.IsZero(o.Float) { // not required - return nil - } +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) contextValidateFloat(ctx context.Context, formats strfmt.Registry) error { if o.Float != nil { - if err := o.Float.Validate(formats); err != nil { + if err := o.Float.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("float") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("float") } return err } @@ -856,16 +1053,14 @@ func (o *TemplatesItems0ParamsItems0) validateFloat(formats strfmt.Registry) err return nil } -func (o *TemplatesItems0ParamsItems0) validateString(formats strfmt.Registry) error { - - if swag.IsZero(o.String) { // not required - return nil - } +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) contextValidateString(ctx context.Context, formats strfmt.Registry) error { if o.String != nil { - if err := o.String.Validate(formats); err != nil { + if err := o.String.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("string") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("string") } return err } @@ -875,7 +1070,7 @@ func (o *TemplatesItems0ParamsItems0) validateString(formats strfmt.Registry) er } // MarshalBinary interface implementation -func (o *TemplatesItems0ParamsItems0) MarshalBinary() ([]byte, error) { +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -883,8 +1078,8 @@ func (o *TemplatesItems0ParamsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *TemplatesItems0ParamsItems0) UnmarshalBinary(b []byte) error { - var res TemplatesItems0ParamsItems0 +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0) UnmarshalBinary(b []byte) error { + var res ListTemplatesOKBodyTemplatesItems0ParamsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -892,10 +1087,10 @@ func (o *TemplatesItems0ParamsItems0) UnmarshalBinary(b []byte) error { return nil } -/*TemplatesItems0ParamsItems0Bool BoolParamDefinition represents boolean parameter's default value. -swagger:model TemplatesItems0ParamsItems0Bool +/*ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool BoolParamDefinition represents boolean parameter's default value. +swagger:model ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool */ -type TemplatesItems0ParamsItems0Bool struct { +type ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool struct { // BooleanFlag represent a command to set some boolean property to true, // to false, or avoid changing that property. @@ -907,8 +1102,8 @@ type TemplatesItems0ParamsItems0Bool struct { Default *string `json:"default,omitempty"` } -// Validate validates this templates items0 params items0 bool -func (o *TemplatesItems0ParamsItems0Bool) Validate(formats strfmt.Registry) error { +// Validate validates this list templates OK body templates items0 params items0 bool +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool) Validate(formats strfmt.Registry) error { var res []error if err := o.validateDefault(formats); err != nil { @@ -921,7 +1116,7 @@ func (o *TemplatesItems0ParamsItems0Bool) Validate(formats strfmt.Registry) erro return nil } -var templatesItems0ParamsItems0BoolTypeDefaultPropEnum []interface{} +var listTemplatesOkBodyTemplatesItems0ParamsItems0BoolTypeDefaultPropEnum []interface{} func init() { var res []string @@ -929,32 +1124,31 @@ func init() { panic(err) } for _, v := range res { - templatesItems0ParamsItems0BoolTypeDefaultPropEnum = append(templatesItems0ParamsItems0BoolTypeDefaultPropEnum, v) + listTemplatesOkBodyTemplatesItems0ParamsItems0BoolTypeDefaultPropEnum = append(listTemplatesOkBodyTemplatesItems0ParamsItems0BoolTypeDefaultPropEnum, v) } } const ( - // TemplatesItems0ParamsItems0BoolDefaultDONOTCHANGE captures enum value "DO_NOT_CHANGE" - TemplatesItems0ParamsItems0BoolDefaultDONOTCHANGE string = "DO_NOT_CHANGE" + // ListTemplatesOKBodyTemplatesItems0ParamsItems0BoolDefaultDONOTCHANGE captures enum value "DO_NOT_CHANGE" + ListTemplatesOKBodyTemplatesItems0ParamsItems0BoolDefaultDONOTCHANGE string = "DO_NOT_CHANGE" - // TemplatesItems0ParamsItems0BoolDefaultTRUE captures enum value "TRUE" - TemplatesItems0ParamsItems0BoolDefaultTRUE string = "TRUE" + // ListTemplatesOKBodyTemplatesItems0ParamsItems0BoolDefaultTRUE captures enum value "TRUE" + ListTemplatesOKBodyTemplatesItems0ParamsItems0BoolDefaultTRUE string = "TRUE" - // TemplatesItems0ParamsItems0BoolDefaultFALSE captures enum value "FALSE" - TemplatesItems0ParamsItems0BoolDefaultFALSE string = "FALSE" + // ListTemplatesOKBodyTemplatesItems0ParamsItems0BoolDefaultFALSE captures enum value "FALSE" + ListTemplatesOKBodyTemplatesItems0ParamsItems0BoolDefaultFALSE string = "FALSE" ) // prop value enum -func (o *TemplatesItems0ParamsItems0Bool) validateDefaultEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, templatesItems0ParamsItems0BoolTypeDefaultPropEnum, true); err != nil { +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool) validateDefaultEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listTemplatesOkBodyTemplatesItems0ParamsItems0BoolTypeDefaultPropEnum, true); err != nil { return err } return nil } -func (o *TemplatesItems0ParamsItems0Bool) validateDefault(formats strfmt.Registry) error { - +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool) validateDefault(formats strfmt.Registry) error { if swag.IsZero(o.Default) { // not required return nil } @@ -967,8 +1161,13 @@ func (o *TemplatesItems0ParamsItems0Bool) validateDefault(formats strfmt.Registr 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 *TemplatesItems0ParamsItems0Bool) MarshalBinary() ([]byte, error) { +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -976,8 +1175,8 @@ func (o *TemplatesItems0ParamsItems0Bool) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *TemplatesItems0ParamsItems0Bool) UnmarshalBinary(b []byte) error { - var res TemplatesItems0ParamsItems0Bool +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool) UnmarshalBinary(b []byte) error { + var res ListTemplatesOKBodyTemplatesItems0ParamsItems0Bool if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -985,10 +1184,10 @@ func (o *TemplatesItems0ParamsItems0Bool) UnmarshalBinary(b []byte) error { return nil } -/*TemplatesItems0ParamsItems0Float FloatParamDefinition represents float parameter's default value and valid range. -swagger:model TemplatesItems0ParamsItems0Float +/*ListTemplatesOKBodyTemplatesItems0ParamsItems0Float FloatParamDefinition represents float parameter's default value and valid range. +swagger:model ListTemplatesOKBodyTemplatesItems0ParamsItems0Float */ -type TemplatesItems0ParamsItems0Float struct { +type ListTemplatesOKBodyTemplatesItems0ParamsItems0Float struct { // True if default value is set. HasDefault bool `json:"has_default,omitempty"` @@ -1009,13 +1208,18 @@ type TemplatesItems0ParamsItems0Float struct { Max float64 `json:"max,omitempty"` } -// Validate validates this templates items0 params items0 float -func (o *TemplatesItems0ParamsItems0Float) Validate(formats strfmt.Registry) error { +// 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 *TemplatesItems0ParamsItems0Float) MarshalBinary() ([]byte, error) { +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Float) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1023,8 +1227,8 @@ func (o *TemplatesItems0ParamsItems0Float) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *TemplatesItems0ParamsItems0Float) UnmarshalBinary(b []byte) error { - var res TemplatesItems0ParamsItems0Float +func (o *ListTemplatesOKBodyTemplatesItems0ParamsItems0Float) UnmarshalBinary(b []byte) error { + var res ListTemplatesOKBodyTemplatesItems0ParamsItems0Float if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -1032,10 +1236,10 @@ func (o *TemplatesItems0ParamsItems0Float) UnmarshalBinary(b []byte) error { return nil } -/*TemplatesItems0ParamsItems0String StringParamDefinition represents string parameter's default value. -swagger:model TemplatesItems0ParamsItems0String +/*ListTemplatesOKBodyTemplatesItems0ParamsItems0String StringParamDefinition represents string parameter's default value. +swagger:model ListTemplatesOKBodyTemplatesItems0ParamsItems0String */ -type TemplatesItems0ParamsItems0String struct { +type ListTemplatesOKBodyTemplatesItems0ParamsItems0String struct { // True if default value is set. HasDefault bool `json:"has_default,omitempty"` @@ -1044,13 +1248,98 @@ type TemplatesItems0ParamsItems0String struct { Default string `json:"default,omitempty"` } -// Validate validates this templates items0 params items0 string -func (o *TemplatesItems0ParamsItems0String) Validate(formats strfmt.Registry) error { +// 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 +} + +/*ListTemplatesOKBodyTotals PageTotals represents total values for pagination. +swagger:model ListTemplatesOKBodyTotals +*/ +type ListTemplatesOKBodyTotals struct { + + // Total number of results. + TotalItems int32 `json:"total_items,omitempty"` + + // Total number of pages. + TotalPages int32 `json:"total_pages,omitempty"` +} + +// Validate validates this list templates OK body totals +func (o *ListTemplatesOKBodyTotals) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list templates OK body totals based on context it is used +func (o *ListTemplatesOKBodyTotals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListTemplatesOKBodyTotals) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListTemplatesOKBodyTotals) UnmarshalBinary(b []byte) error { + var res ListTemplatesOKBodyTotals + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListTemplatesParamsBodyPageParams PageParams represents page request parameters for pagination. +swagger:model ListTemplatesParamsBodyPageParams +*/ +type ListTemplatesParamsBodyPageParams struct { + + // Maximum number of results per page. + PageSize int32 `json:"page_size,omitempty"` + + // Index of the requested page, starts from 0. + Index int32 `json:"index,omitempty"` +} + +// Validate validates this list templates params body page params +func (o *ListTemplatesParamsBodyPageParams) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list templates params body page params based on context it is used +func (o *ListTemplatesParamsBodyPageParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *TemplatesItems0ParamsItems0String) MarshalBinary() ([]byte, error) { +func (o *ListTemplatesParamsBodyPageParams) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1058,8 +1347,8 @@ func (o *TemplatesItems0ParamsItems0String) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *TemplatesItems0ParamsItems0String) UnmarshalBinary(b []byte) error { - var res TemplatesItems0ParamsItems0String +func (o *ListTemplatesParamsBodyPageParams) UnmarshalBinary(b []byte) error { + var res ListTemplatesParamsBodyPageParams if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/ia/json/client/templates/templates_client.go b/api/managementpb/ia/json/client/templates/templates_client.go index b764b7c8ce..113dadab17 100644 --- a/api/managementpb/ia/json/client/templates/templates_client.go +++ b/api/managementpb/ia/json/client/templates/templates_client.go @@ -23,15 +23,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CreateTemplate(params *CreateTemplateParams) (*CreateTemplateOK, error) + CreateTemplate(params *CreateTemplateParams, opts ...ClientOption) (*CreateTemplateOK, error) - DeleteTemplate(params *DeleteTemplateParams) (*DeleteTemplateOK, error) + DeleteTemplate(params *DeleteTemplateParams, opts ...ClientOption) (*DeleteTemplateOK, error) - ListTemplates(params *ListTemplatesParams) (*ListTemplatesOK, error) + ListTemplates(params *ListTemplatesParams, opts ...ClientOption) (*ListTemplatesOK, error) - UpdateTemplate(params *UpdateTemplateParams) (*UpdateTemplateOK, error) + UpdateTemplate(params *UpdateTemplateParams, opts ...ClientOption) (*UpdateTemplateOK, error) SetTransport(transport runtime.ClientTransport) } @@ -39,13 +42,12 @@ type ClientService interface { /* CreateTemplate creates template creates a new template */ -func (a *Client) CreateTemplate(params *CreateTemplateParams) (*CreateTemplateOK, error) { +func (a *Client) CreateTemplate(params *CreateTemplateParams, opts ...ClientOption) (*CreateTemplateOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateTemplateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "CreateTemplate", Method: "POST", PathPattern: "/v1/management/ia/Templates/Create", @@ -56,7 +58,12 @@ func (a *Client) CreateTemplate(params *CreateTemplateParams) (*CreateTemplateOK 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 } @@ -72,13 +79,12 @@ func (a *Client) CreateTemplate(params *CreateTemplateParams) (*CreateTemplateOK /* DeleteTemplate deletes template deletes existing previously created via API */ -func (a *Client) DeleteTemplate(params *DeleteTemplateParams) (*DeleteTemplateOK, error) { +func (a *Client) DeleteTemplate(params *DeleteTemplateParams, opts ...ClientOption) (*DeleteTemplateOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteTemplateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "DeleteTemplate", Method: "POST", PathPattern: "/v1/management/ia/Templates/Delete", @@ -89,7 +95,12 @@ func (a *Client) DeleteTemplate(params *DeleteTemplateParams) (*DeleteTemplateOK 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 } @@ -105,13 +116,12 @@ func (a *Client) DeleteTemplate(params *DeleteTemplateParams) (*DeleteTemplateOK /* ListTemplates lists templates returns a list of all collected alert rule templates */ -func (a *Client) ListTemplates(params *ListTemplatesParams) (*ListTemplatesOK, error) { +func (a *Client) ListTemplates(params *ListTemplatesParams, opts ...ClientOption) (*ListTemplatesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListTemplatesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListTemplates", Method: "POST", PathPattern: "/v1/management/ia/Templates/List", @@ -122,7 +132,12 @@ func (a *Client) ListTemplates(params *ListTemplatesParams) (*ListTemplatesOK, e 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 } @@ -138,13 +153,12 @@ func (a *Client) ListTemplates(params *ListTemplatesParams) (*ListTemplatesOK, e /* UpdateTemplate updates template updates existing template previously created via API */ -func (a *Client) UpdateTemplate(params *UpdateTemplateParams) (*UpdateTemplateOK, error) { +func (a *Client) UpdateTemplate(params *UpdateTemplateParams, opts ...ClientOption) (*UpdateTemplateOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateTemplateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "UpdateTemplate", Method: "POST", PathPattern: "/v1/management/ia/Templates/Update", @@ -155,7 +169,12 @@ func (a *Client) UpdateTemplate(params *UpdateTemplateParams) (*UpdateTemplateOK 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 } diff --git a/api/managementpb/ia/json/client/templates/update_template_parameters.go b/api/managementpb/ia/json/client/templates/update_template_parameters.go index bc39b2ce57..3bbfe82bc4 100644 --- a/api/managementpb/ia/json/client/templates/update_template_parameters.go +++ b/api/managementpb/ia/json/client/templates/update_template_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUpdateTemplateParams creates a new UpdateTemplateParams object -// with the default values initialized. +// 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 { - var () return &UpdateTemplateParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateTemplateParamsWithTimeout creates a new UpdateTemplateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateTemplateParamsWithTimeout(timeout time.Duration) *UpdateTemplateParams { - var () return &UpdateTemplateParams{ - timeout: timeout, } } // NewUpdateTemplateParamsWithContext creates a new UpdateTemplateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateTemplateParamsWithContext(ctx context.Context) *UpdateTemplateParams { - var () return &UpdateTemplateParams{ - Context: ctx, } } // NewUpdateTemplateParamsWithHTTPClient creates a new UpdateTemplateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateTemplateParamsWithHTTPClient(client *http.Client) *UpdateTemplateParams { - var () 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 +/* 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. Body UpdateTemplateBody timeout time.Duration @@ -68,6 +67,21 @@ type UpdateTemplateParams struct { 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) @@ -119,7 +133,6 @@ func (o *UpdateTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/ia/json/client/templates/update_template_responses.go b/api/managementpb/ia/json/client/templates/update_template_responses.go index 37f38c56a2..1b57c6324b 100644 --- a/api/managementpb/ia/json/client/templates/update_template_responses.go +++ b/api/managementpb/ia/json/client/templates/update_template_responses.go @@ -6,6 +6,7 @@ package templates // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewUpdateTemplateOK() *UpdateTemplateOK { return &UpdateTemplateOK{} } -/*UpdateTemplateOK handles this case with default header values. +/* UpdateTemplateOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type UpdateTemplateOK struct { func (o *UpdateTemplateOK) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Templates/Update][%d] updateTemplateOk %+v", 200, o.Payload) } - func (o *UpdateTemplateOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewUpdateTemplateDefault(code int) *UpdateTemplateDefault { } } -/*UpdateTemplateDefault handles this case with default header values. +/* UpdateTemplateDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *UpdateTemplateDefault) Code() int { func (o *UpdateTemplateDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ia/Templates/Update][%d] UpdateTemplate default %+v", o._statusCode, o.Payload) } - func (o *UpdateTemplateDefault) GetPayload() *UpdateTemplateDefaultBody { return o.Payload } @@ -132,6 +131,11 @@ 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 { @@ -165,7 +169,7 @@ type UpdateTemplateDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*UpdateTemplateDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this update template default body @@ -183,7 +187,6 @@ func (o *UpdateTemplateDefaultBody) Validate(formats strfmt.Registry) error { } func (o *UpdateTemplateDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -197,6 +200,42 @@ func (o *UpdateTemplateDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("UpdateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UpdateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UpdateTemplate default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,3 +263,44 @@ func (o *UpdateTemplateDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*UpdateTemplateDefaultBodyDetailsItems0 update template default body details items0 +swagger:model UpdateTemplateDefaultBodyDetailsItems0 +*/ +type UpdateTemplateDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/managementpb/ia/json/ia.json b/api/managementpb/ia/json/ia.json index 3d438996f8..2a28d5248b 100644 --- a/api/managementpb/ia/json/ia.json +++ b/api/managementpb/ia/json/ia.json @@ -46,8 +46,7 @@ "format": "int32", "x-order": 0 } - }, - "x-order": 0 + } } } } @@ -128,8 +127,7 @@ }, "x-order": 1 } - }, - "x-order": 2 + } }, "pagerduty_config": { "description": "PagerDutyConfig represents PagerDuty configuration.", @@ -149,8 +147,7 @@ "type": "string", "x-order": 2 } - }, - "x-order": 3 + } }, "slack_config": { "description": "SlackConfig represents Slack configuration.", @@ -164,8 +161,7 @@ "type": "boolean", "x-order": 0 } - }, - "x-order": 4 + } }, "summary": { "description": "Short human-readable summary.", @@ -196,8 +192,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 0 + } }, "bearer_token": { "type": "string", @@ -255,11 +250,9 @@ "type": "string", "x-order": 3 } - }, - "x-order": 3 + } } - }, - "x-order": 2 + } }, "max_alerts": { "type": "integer", @@ -274,8 +267,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 5 + } } } }, @@ -314,8 +306,7 @@ "SEVERITY_NOTICE", "SEVERITY_INFO", "SEVERITY_DEBUG" - ], - "x-order": 11 + ] }, "disabled": { "description": "True if that rule is disabled.", @@ -351,8 +342,7 @@ "FILTER_TYPE_INVALID", "EQUAL", "REGEX" - ], - "x-order": 0 + ] }, "value": { "type": "string", @@ -399,11 +389,9 @@ "DO_NOT_CHANGE", "TRUE", "FALSE" - ], - "x-order": 0 + ] } - }, - "x-order": 4 + } }, "float": { "description": "FloatParamDefinition represents float parameter's default value and valid range.", @@ -442,8 +430,7 @@ "format": "double", "x-order": 3 } - }, - "x-order": 5 + } }, "name": { "description": "Machine-readable name (ID) that is used in expression.", @@ -464,8 +451,7 @@ "type": "boolean", "x-order": 0 } - }, - "x-order": 6 + } }, "summary": { "description": "Short human-readable parameter summary.", @@ -481,8 +467,7 @@ "BOOL", "FLOAT", "STRING" - ], - "x-order": 3 + ] }, "unit": { "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", @@ -492,8 +477,7 @@ "PARAM_UNIT_INVALID", "PERCENTAGE", "SECONDS" - ], - "x-order": 2 + ] } } }, @@ -536,8 +520,7 @@ "BOOL", "FLOAT", "STRING" - ], - "x-order": 1 + ] } } }, @@ -562,8 +545,7 @@ "SEVERITY_NOTICE", "SEVERITY_INFO", "SEVERITY_DEBUG" - ], - "x-order": 12 + ] }, "summary": { "description": "Rule human-readable summary.", @@ -575,8 +557,7 @@ "type": "string", "x-order": 3 } - }, - "x-order": 5 + } }, "severity": { "description": "Severity represents severity level of the check result or alert.", @@ -592,8 +573,7 @@ "SEVERITY_NOTICE", "SEVERITY_INFO", "SEVERITY_DEBUG" - ], - "x-order": 2 + ] }, "status": { "description": "Status represents Alert Rule's and Alert's combined status.\n\n - CLEAR: No alert.\n - PENDING: Pending, but not triggering alert.\n - TRIGGERING: Triggering (firing) alert.\n - SILENCED: Silenced alert.", @@ -605,8 +585,7 @@ "PENDING", "TRIGGERING", "SILENCED" - ], - "x-order": 3 + ] }, "summary": { "description": "Human-readable summary.", @@ -639,8 +618,7 @@ "format": "int32", "x-order": 1 } - }, - "x-order": 1 + } } } } @@ -719,8 +697,7 @@ "DO_NOT_CHANGE", "TRUE", "FALSE" - ], - "x-order": 1 + ] } } } @@ -810,8 +787,7 @@ }, "x-order": 1 } - }, - "x-order": 1 + } }, "pagerduty_config": { "description": "PagerDutyConfig represents PagerDuty configuration.", @@ -831,8 +807,7 @@ "type": "string", "x-order": 2 } - }, - "x-order": 2 + } }, "slack_config": { "description": "SlackConfig represents Slack configuration.", @@ -846,8 +821,7 @@ "type": "boolean", "x-order": 0 } - }, - "x-order": 3 + } }, "summary": { "description": "Short human-readable summary.", @@ -878,8 +852,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 0 + } }, "bearer_token": { "type": "string", @@ -937,11 +910,9 @@ "type": "string", "x-order": 3 } - }, - "x-order": 3 + } } - }, - "x-order": 2 + } }, "max_alerts": { "type": "integer", @@ -956,8 +927,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 4 + } } } } @@ -1059,8 +1029,7 @@ }, "x-order": 1 } - }, - "x-order": 2 + } }, "pagerduty_config": { "description": "PagerDutyConfig represents PagerDuty configuration.", @@ -1080,8 +1049,7 @@ "type": "string", "x-order": 2 } - }, - "x-order": 3 + } }, "slack_config": { "description": "SlackConfig represents Slack configuration.", @@ -1095,8 +1063,7 @@ "type": "boolean", "x-order": 0 } - }, - "x-order": 4 + } }, "summary": { "description": "Short human-readable summary. Empty value will not change it.", @@ -1127,8 +1094,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 0 + } }, "bearer_token": { "type": "string", @@ -1186,11 +1152,9 @@ "type": "string", "x-order": 3 } - }, - "x-order": 3 + } } - }, - "x-order": 2 + } }, "max_alerts": { "type": "integer", @@ -1205,8 +1169,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 5 + } } } } @@ -1292,8 +1255,7 @@ "format": "int32", "x-order": 0 } - }, - "x-order": 0 + } } } } @@ -1336,8 +1298,7 @@ }, "x-order": 1 } - }, - "x-order": 2 + } }, "pagerduty_config": { "description": "PagerDutyConfig represents PagerDuty configuration.", @@ -1357,8 +1318,7 @@ "type": "string", "x-order": 2 } - }, - "x-order": 3 + } }, "slack_config": { "description": "SlackConfig represents Slack configuration.", @@ -1372,8 +1332,7 @@ "type": "boolean", "x-order": 0 } - }, - "x-order": 4 + } }, "summary": { "description": "Short human-readable summary.", @@ -1404,8 +1363,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 0 + } }, "bearer_token": { "type": "string", @@ -1463,11 +1421,9 @@ "type": "string", "x-order": 3 } - }, - "x-order": 3 + } } - }, - "x-order": 2 + } }, "max_alerts": { "type": "integer", @@ -1482,8 +1438,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 5 + } } } }, @@ -1505,8 +1460,7 @@ "format": "int32", "x-order": 1 } - }, - "x-order": 1 + } } } } @@ -1680,8 +1634,7 @@ "FILTER_TYPE_INVALID", "EQUAL", "REGEX" - ], - "x-order": 0 + ] }, "value": { "type": "string", @@ -1738,8 +1691,7 @@ "BOOL", "FLOAT", "STRING" - ], - "x-order": 1 + ] } } }, @@ -1759,8 +1711,7 @@ "SEVERITY_NOTICE", "SEVERITY_INFO", "SEVERITY_DEBUG" - ], - "x-order": 6 + ] }, "source_rule_id": { "description": "ID of the rule that will be used as source. Can't be specified simultaneously with template_name.", @@ -1936,8 +1887,7 @@ "format": "int32", "x-order": 0 } - }, - "x-order": 0 + } } } } @@ -1995,8 +1945,7 @@ }, "x-order": 1 } - }, - "x-order": 2 + } }, "pagerduty_config": { "description": "PagerDutyConfig represents PagerDuty configuration.", @@ -2016,8 +1965,7 @@ "type": "string", "x-order": 2 } - }, - "x-order": 3 + } }, "slack_config": { "description": "SlackConfig represents Slack configuration.", @@ -2031,8 +1979,7 @@ "type": "boolean", "x-order": 0 } - }, - "x-order": 4 + } }, "summary": { "description": "Short human-readable summary.", @@ -2063,8 +2010,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 0 + } }, "bearer_token": { "type": "string", @@ -2122,11 +2068,9 @@ "type": "string", "x-order": 3 } - }, - "x-order": 3 + } } - }, - "x-order": 2 + } }, "max_alerts": { "type": "integer", @@ -2141,8 +2085,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 5 + } } } }, @@ -2181,8 +2124,7 @@ "SEVERITY_NOTICE", "SEVERITY_INFO", "SEVERITY_DEBUG" - ], - "x-order": 11 + ] }, "disabled": { "description": "True if that rule is disabled.", @@ -2218,8 +2160,7 @@ "FILTER_TYPE_INVALID", "EQUAL", "REGEX" - ], - "x-order": 0 + ] }, "value": { "type": "string", @@ -2266,11 +2207,9 @@ "DO_NOT_CHANGE", "TRUE", "FALSE" - ], - "x-order": 0 + ] } - }, - "x-order": 4 + } }, "float": { "description": "FloatParamDefinition represents float parameter's default value and valid range.", @@ -2309,8 +2248,7 @@ "format": "double", "x-order": 3 } - }, - "x-order": 5 + } }, "name": { "description": "Machine-readable name (ID) that is used in expression.", @@ -2331,8 +2269,7 @@ "type": "boolean", "x-order": 0 } - }, - "x-order": 6 + } }, "summary": { "description": "Short human-readable parameter summary.", @@ -2348,8 +2285,7 @@ "BOOL", "FLOAT", "STRING" - ], - "x-order": 3 + ] }, "unit": { "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", @@ -2359,8 +2295,7 @@ "PARAM_UNIT_INVALID", "PERCENTAGE", "SECONDS" - ], - "x-order": 2 + ] } } }, @@ -2403,8 +2338,7 @@ "BOOL", "FLOAT", "STRING" - ], - "x-order": 1 + ] } } }, @@ -2429,8 +2363,7 @@ "SEVERITY_NOTICE", "SEVERITY_INFO", "SEVERITY_DEBUG" - ], - "x-order": 12 + ] }, "summary": { "description": "Rule human-readable summary.", @@ -2462,8 +2395,7 @@ "format": "int32", "x-order": 1 } - }, - "x-order": 1 + } } } } @@ -2533,8 +2465,7 @@ "DO_NOT_CHANGE", "TRUE", "FALSE" - ], - "x-order": 1 + ] }, "rule_id": { "description": "Rule ID.", @@ -2649,8 +2580,7 @@ "FILTER_TYPE_INVALID", "EQUAL", "REGEX" - ], - "x-order": 0 + ] }, "value": { "type": "string", @@ -2707,8 +2637,7 @@ "BOOL", "FLOAT", "STRING" - ], - "x-order": 1 + ] } } }, @@ -2733,8 +2662,7 @@ "SEVERITY_NOTICE", "SEVERITY_INFO", "SEVERITY_DEBUG" - ], - "x-order": 5 + ] } } } @@ -2965,8 +2893,7 @@ "format": "int32", "x-order": 0 } - }, - "x-order": 1 + } }, "reload": { "description": "If true, template files will be re-read from disk.", @@ -3045,11 +2972,9 @@ "DO_NOT_CHANGE", "TRUE", "FALSE" - ], - "x-order": 0 + ] } - }, - "x-order": 4 + } }, "float": { "description": "FloatParamDefinition represents float parameter's default value and valid range.", @@ -3088,8 +3013,7 @@ "format": "double", "x-order": 3 } - }, - "x-order": 5 + } }, "name": { "description": "Machine-readable name (ID) that is used in expression.", @@ -3110,8 +3034,7 @@ "type": "boolean", "x-order": 0 } - }, - "x-order": 6 + } }, "summary": { "description": "Short human-readable parameter summary.", @@ -3127,8 +3050,7 @@ "BOOL", "FLOAT", "STRING" - ], - "x-order": 3 + ] }, "unit": { "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", @@ -3138,8 +3060,7 @@ "PARAM_UNIT_INVALID", "PERCENTAGE", "SECONDS" - ], - "x-order": 2 + ] } } }, @@ -3159,8 +3080,7 @@ "SEVERITY_NOTICE", "SEVERITY_INFO", "SEVERITY_DEBUG" - ], - "x-order": 5 + ] }, "source": { "description": "TemplateSource defines template source.\n\n - BUILT_IN: Template that is shipped with PMM Server releases.\n - SAAS: Template that is downloaded from check.percona.com.\n - USER_FILE: Templated loaded from user-suplied file.\n - USER_API: Templated created via API.", @@ -3172,8 +3092,7 @@ "SAAS", "USER_FILE", "USER_API" - ], - "x-order": 8 + ] }, "summary": { "description": "Short human-readable summary.", @@ -3205,8 +3124,7 @@ "format": "int32", "x-order": 1 } - }, - "x-order": 1 + } } } } diff --git a/api/managementpb/ia/params.pb.go b/api/managementpb/ia/params.pb.go index b230996a52..c9a263e03e 100644 --- a/api/managementpb/ia/params.pb.go +++ b/api/managementpb/ia/params.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/ia/params.proto diff --git a/api/managementpb/ia/rules.pb.go b/api/managementpb/ia/rules.pb.go index bb36a229ae..35afd8689c 100644 --- a/api/managementpb/ia/rules.pb.go +++ b/api/managementpb/ia/rules.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/ia/rules.proto diff --git a/api/managementpb/ia/status.pb.go b/api/managementpb/ia/status.pb.go index f39eaebc9e..42e6d1990f 100644 --- a/api/managementpb/ia/status.pb.go +++ b/api/managementpb/ia/status.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/ia/status.proto diff --git a/api/managementpb/ia/templates.pb.go b/api/managementpb/ia/templates.pb.go index 0ebc6f2712..2d99c43e61 100644 --- a/api/managementpb/ia/templates.pb.go +++ b/api/managementpb/ia/templates.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/ia/templates.proto diff --git a/api/managementpb/json/client/actions/actions_client.go b/api/managementpb/json/client/actions/actions_client.go index f224f9a423..691c6c00ad 100644 --- a/api/managementpb/json/client/actions/actions_client.go +++ b/api/managementpb/json/client/actions/actions_client.go @@ -23,37 +23,40 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - CancelAction(params *CancelActionParams) (*CancelActionOK, error) + CancelAction(params *CancelActionParams, opts ...ClientOption) (*CancelActionOK, error) - GetAction(params *GetActionParams) (*GetActionOK, error) + GetAction(params *GetActionParams, opts ...ClientOption) (*GetActionOK, error) - StartMongoDBExplainAction(params *StartMongoDBExplainActionParams) (*StartMongoDBExplainActionOK, error) + StartMongoDBExplainAction(params *StartMongoDBExplainActionParams, opts ...ClientOption) (*StartMongoDBExplainActionOK, error) - StartMySQLExplainAction(params *StartMySQLExplainActionParams) (*StartMySQLExplainActionOK, error) + StartMySQLExplainAction(params *StartMySQLExplainActionParams, opts ...ClientOption) (*StartMySQLExplainActionOK, error) - StartMySQLExplainJSONAction(params *StartMySQLExplainJSONActionParams) (*StartMySQLExplainJSONActionOK, error) + StartMySQLExplainJSONAction(params *StartMySQLExplainJSONActionParams, opts ...ClientOption) (*StartMySQLExplainJSONActionOK, error) - StartMySQLExplainTraditionalJSONAction(params *StartMySQLExplainTraditionalJSONActionParams) (*StartMySQLExplainTraditionalJSONActionOK, error) + StartMySQLExplainTraditionalJSONAction(params *StartMySQLExplainTraditionalJSONActionParams, opts ...ClientOption) (*StartMySQLExplainTraditionalJSONActionOK, error) - StartMySQLShowCreateTableAction(params *StartMySQLShowCreateTableActionParams) (*StartMySQLShowCreateTableActionOK, error) + StartMySQLShowCreateTableAction(params *StartMySQLShowCreateTableActionParams, opts ...ClientOption) (*StartMySQLShowCreateTableActionOK, error) - StartMySQLShowIndexAction(params *StartMySQLShowIndexActionParams) (*StartMySQLShowIndexActionOK, error) + StartMySQLShowIndexAction(params *StartMySQLShowIndexActionParams, opts ...ClientOption) (*StartMySQLShowIndexActionOK, error) - StartMySQLShowTableStatusAction(params *StartMySQLShowTableStatusActionParams) (*StartMySQLShowTableStatusActionOK, error) + StartMySQLShowTableStatusAction(params *StartMySQLShowTableStatusActionParams, opts ...ClientOption) (*StartMySQLShowTableStatusActionOK, error) - StartPTMongoDBSummaryAction(params *StartPTMongoDBSummaryActionParams) (*StartPTMongoDBSummaryActionOK, error) + StartPTMongoDBSummaryAction(params *StartPTMongoDBSummaryActionParams, opts ...ClientOption) (*StartPTMongoDBSummaryActionOK, error) - StartPTMySQLSummaryAction(params *StartPTMySQLSummaryActionParams) (*StartPTMySQLSummaryActionOK, error) + StartPTMySQLSummaryAction(params *StartPTMySQLSummaryActionParams, opts ...ClientOption) (*StartPTMySQLSummaryActionOK, error) - StartPTPgSummaryAction(params *StartPTPgSummaryActionParams) (*StartPTPgSummaryActionOK, error) + StartPTPgSummaryAction(params *StartPTPgSummaryActionParams, opts ...ClientOption) (*StartPTPgSummaryActionOK, error) - StartPTSummaryAction(params *StartPTSummaryActionParams) (*StartPTSummaryActionOK, error) + StartPTSummaryAction(params *StartPTSummaryActionParams, opts ...ClientOption) (*StartPTSummaryActionOK, error) - StartPostgreSQLShowCreateTableAction(params *StartPostgreSQLShowCreateTableActionParams) (*StartPostgreSQLShowCreateTableActionOK, error) + StartPostgreSQLShowCreateTableAction(params *StartPostgreSQLShowCreateTableActionParams, opts ...ClientOption) (*StartPostgreSQLShowCreateTableActionOK, error) - StartPostgreSQLShowIndexAction(params *StartPostgreSQLShowIndexActionParams) (*StartPostgreSQLShowIndexActionOK, error) + StartPostgreSQLShowIndexAction(params *StartPostgreSQLShowIndexActionParams, opts ...ClientOption) (*StartPostgreSQLShowIndexActionOK, error) SetTransport(transport runtime.ClientTransport) } @@ -63,13 +66,12 @@ type ClientService interface { Stops an Action. */ -func (a *Client) CancelAction(params *CancelActionParams) (*CancelActionOK, error) { +func (a *Client) CancelAction(params *CancelActionParams, opts ...ClientOption) (*CancelActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCancelActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "CancelAction", Method: "POST", PathPattern: "/v1/management/Actions/Cancel", @@ -80,7 +82,12 @@ func (a *Client) CancelAction(params *CancelActionParams) (*CancelActionOK, erro 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 } @@ -98,13 +105,12 @@ func (a *Client) CancelAction(params *CancelActionParams) (*CancelActionOK, erro Gets the result of a given Action. */ -func (a *Client) GetAction(params *GetActionParams) (*GetActionOK, error) { +func (a *Client) GetAction(params *GetActionParams, opts ...ClientOption) (*GetActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetAction", Method: "POST", PathPattern: "/v1/management/Actions/Get", @@ -115,7 +121,12 @@ func (a *Client) GetAction(params *GetActionParams) (*GetActionOK, error) { 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 } @@ -133,13 +144,12 @@ func (a *Client) GetAction(params *GetActionParams) (*GetActionOK, error) { Starts 'MongoDB EXPLAIN' Action. */ -func (a *Client) StartMongoDBExplainAction(params *StartMongoDBExplainActionParams) (*StartMongoDBExplainActionOK, error) { +func (a *Client) StartMongoDBExplainAction(params *StartMongoDBExplainActionParams, opts ...ClientOption) (*StartMongoDBExplainActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartMongoDBExplainActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartMongoDBExplainAction", Method: "POST", PathPattern: "/v1/management/Actions/StartMongoDBExplain", @@ -150,7 +160,12 @@ func (a *Client) StartMongoDBExplainAction(params *StartMongoDBExplainActionPara Reader: &StartMongoDBExplainActionReader{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 } @@ -168,13 +183,12 @@ func (a *Client) StartMongoDBExplainAction(params *StartMongoDBExplainActionPara Starts 'MySQL EXPLAIN' Action with traditional output. */ -func (a *Client) StartMySQLExplainAction(params *StartMySQLExplainActionParams) (*StartMySQLExplainActionOK, error) { +func (a *Client) StartMySQLExplainAction(params *StartMySQLExplainActionParams, opts ...ClientOption) (*StartMySQLExplainActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartMySQLExplainActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartMySQLExplainAction", Method: "POST", PathPattern: "/v1/management/Actions/StartMySQLExplain", @@ -185,7 +199,12 @@ func (a *Client) StartMySQLExplainAction(params *StartMySQLExplainActionParams) Reader: &StartMySQLExplainActionReader{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 } @@ -203,13 +222,12 @@ func (a *Client) StartMySQLExplainAction(params *StartMySQLExplainActionParams) Starts 'MySQL EXPLAIN' Action with JSON output. */ -func (a *Client) StartMySQLExplainJSONAction(params *StartMySQLExplainJSONActionParams) (*StartMySQLExplainJSONActionOK, error) { +func (a *Client) StartMySQLExplainJSONAction(params *StartMySQLExplainJSONActionParams, opts ...ClientOption) (*StartMySQLExplainJSONActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartMySQLExplainJSONActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartMySQLExplainJSONAction", Method: "POST", PathPattern: "/v1/management/Actions/StartMySQLExplainJSON", @@ -220,7 +238,12 @@ func (a *Client) StartMySQLExplainJSONAction(params *StartMySQLExplainJSONAction Reader: &StartMySQLExplainJSONActionReader{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 } @@ -238,13 +261,12 @@ func (a *Client) StartMySQLExplainJSONAction(params *StartMySQLExplainJSONAction Starts 'MySQL EXPLAIN' Action with traditional JSON output. */ -func (a *Client) StartMySQLExplainTraditionalJSONAction(params *StartMySQLExplainTraditionalJSONActionParams) (*StartMySQLExplainTraditionalJSONActionOK, error) { +func (a *Client) StartMySQLExplainTraditionalJSONAction(params *StartMySQLExplainTraditionalJSONActionParams, opts ...ClientOption) (*StartMySQLExplainTraditionalJSONActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartMySQLExplainTraditionalJSONActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartMySQLExplainTraditionalJSONAction", Method: "POST", PathPattern: "/v1/management/Actions/StartMySQLExplainTraditionalJSON", @@ -255,7 +277,12 @@ func (a *Client) StartMySQLExplainTraditionalJSONAction(params *StartMySQLExplai Reader: &StartMySQLExplainTraditionalJSONActionReader{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 } @@ -273,13 +300,12 @@ func (a *Client) StartMySQLExplainTraditionalJSONAction(params *StartMySQLExplai Starts 'MySQL SHOW CREATE TABLE' Action. */ -func (a *Client) StartMySQLShowCreateTableAction(params *StartMySQLShowCreateTableActionParams) (*StartMySQLShowCreateTableActionOK, error) { +func (a *Client) StartMySQLShowCreateTableAction(params *StartMySQLShowCreateTableActionParams, opts ...ClientOption) (*StartMySQLShowCreateTableActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartMySQLShowCreateTableActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartMySQLShowCreateTableAction", Method: "POST", PathPattern: "/v1/management/Actions/StartMySQLShowCreateTable", @@ -290,7 +316,12 @@ func (a *Client) StartMySQLShowCreateTableAction(params *StartMySQLShowCreateTab Reader: &StartMySQLShowCreateTableActionReader{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 } @@ -308,13 +339,12 @@ func (a *Client) StartMySQLShowCreateTableAction(params *StartMySQLShowCreateTab Starts 'MySQL SHOW INDEX' Action. */ -func (a *Client) StartMySQLShowIndexAction(params *StartMySQLShowIndexActionParams) (*StartMySQLShowIndexActionOK, error) { +func (a *Client) StartMySQLShowIndexAction(params *StartMySQLShowIndexActionParams, opts ...ClientOption) (*StartMySQLShowIndexActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartMySQLShowIndexActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartMySQLShowIndexAction", Method: "POST", PathPattern: "/v1/management/Actions/StartMySQLShowIndex", @@ -325,7 +355,12 @@ func (a *Client) StartMySQLShowIndexAction(params *StartMySQLShowIndexActionPara Reader: &StartMySQLShowIndexActionReader{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 } @@ -343,13 +378,12 @@ func (a *Client) StartMySQLShowIndexAction(params *StartMySQLShowIndexActionPara Starts 'MySQL SHOW TABLE STATUS' Action. */ -func (a *Client) StartMySQLShowTableStatusAction(params *StartMySQLShowTableStatusActionParams) (*StartMySQLShowTableStatusActionOK, error) { +func (a *Client) StartMySQLShowTableStatusAction(params *StartMySQLShowTableStatusActionParams, opts ...ClientOption) (*StartMySQLShowTableStatusActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartMySQLShowTableStatusActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartMySQLShowTableStatusAction", Method: "POST", PathPattern: "/v1/management/Actions/StartMySQLShowTableStatus", @@ -360,7 +394,12 @@ func (a *Client) StartMySQLShowTableStatusAction(params *StartMySQLShowTableStat Reader: &StartMySQLShowTableStatusActionReader{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 } @@ -378,13 +417,12 @@ func (a *Client) StartMySQLShowTableStatusAction(params *StartMySQLShowTableStat Starts 'Percona Toolkit MongoDB Summary' Action. */ -func (a *Client) StartPTMongoDBSummaryAction(params *StartPTMongoDBSummaryActionParams) (*StartPTMongoDBSummaryActionOK, error) { +func (a *Client) StartPTMongoDBSummaryAction(params *StartPTMongoDBSummaryActionParams, opts ...ClientOption) (*StartPTMongoDBSummaryActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartPTMongoDBSummaryActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartPTMongoDBSummaryAction", Method: "POST", PathPattern: "/v1/management/Actions/StartPTMongoDBSummary", @@ -395,7 +433,12 @@ func (a *Client) StartPTMongoDBSummaryAction(params *StartPTMongoDBSummaryAction Reader: &StartPTMongoDBSummaryActionReader{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 } @@ -413,13 +456,12 @@ func (a *Client) StartPTMongoDBSummaryAction(params *StartPTMongoDBSummaryAction Starts 'Percona Toolkit MySQL Summary' Action. */ -func (a *Client) StartPTMySQLSummaryAction(params *StartPTMySQLSummaryActionParams) (*StartPTMySQLSummaryActionOK, error) { +func (a *Client) StartPTMySQLSummaryAction(params *StartPTMySQLSummaryActionParams, opts ...ClientOption) (*StartPTMySQLSummaryActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartPTMySQLSummaryActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartPTMySQLSummaryAction", Method: "POST", PathPattern: "/v1/management/Actions/StartPTMySQLSummary", @@ -430,7 +472,12 @@ func (a *Client) StartPTMySQLSummaryAction(params *StartPTMySQLSummaryActionPara Reader: &StartPTMySQLSummaryActionReader{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 } @@ -448,13 +495,12 @@ func (a *Client) StartPTMySQLSummaryAction(params *StartPTMySQLSummaryActionPara Starts 'Percona Toolkit PostgreSQL Summary' Action. */ -func (a *Client) StartPTPgSummaryAction(params *StartPTPgSummaryActionParams) (*StartPTPgSummaryActionOK, error) { +func (a *Client) StartPTPgSummaryAction(params *StartPTPgSummaryActionParams, opts ...ClientOption) (*StartPTPgSummaryActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartPTPgSummaryActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartPTPgSummaryAction", Method: "POST", PathPattern: "/v1/management/Actions/StartPTPgSummary", @@ -465,7 +511,12 @@ func (a *Client) StartPTPgSummaryAction(params *StartPTPgSummaryActionParams) (* Reader: &StartPTPgSummaryActionReader{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 } @@ -483,13 +534,12 @@ func (a *Client) StartPTPgSummaryAction(params *StartPTPgSummaryActionParams) (* Starts 'Percona Toolkit Summary' Action. */ -func (a *Client) StartPTSummaryAction(params *StartPTSummaryActionParams) (*StartPTSummaryActionOK, error) { +func (a *Client) StartPTSummaryAction(params *StartPTSummaryActionParams, opts ...ClientOption) (*StartPTSummaryActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartPTSummaryActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartPTSummaryAction", Method: "POST", PathPattern: "/v1/management/Actions/StartPTSummary", @@ -500,7 +550,12 @@ func (a *Client) StartPTSummaryAction(params *StartPTSummaryActionParams) (*Star 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 } @@ -518,13 +573,12 @@ func (a *Client) StartPTSummaryAction(params *StartPTSummaryActionParams) (*Star Starts 'PostgreSQL SHOW CREATE TABLE' Action. */ -func (a *Client) StartPostgreSQLShowCreateTableAction(params *StartPostgreSQLShowCreateTableActionParams) (*StartPostgreSQLShowCreateTableActionOK, error) { +func (a *Client) StartPostgreSQLShowCreateTableAction(params *StartPostgreSQLShowCreateTableActionParams, opts ...ClientOption) (*StartPostgreSQLShowCreateTableActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartPostgreSQLShowCreateTableActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartPostgreSQLShowCreateTableAction", Method: "POST", PathPattern: "/v1/management/Actions/StartPostgreSQLShowCreateTable", @@ -535,7 +589,12 @@ func (a *Client) StartPostgreSQLShowCreateTableAction(params *StartPostgreSQLSho Reader: &StartPostgreSQLShowCreateTableActionReader{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 } @@ -553,13 +612,12 @@ func (a *Client) StartPostgreSQLShowCreateTableAction(params *StartPostgreSQLSho Starts 'PostgreSQL SHOW INDEX' Action. */ -func (a *Client) StartPostgreSQLShowIndexAction(params *StartPostgreSQLShowIndexActionParams) (*StartPostgreSQLShowIndexActionOK, error) { +func (a *Client) StartPostgreSQLShowIndexAction(params *StartPostgreSQLShowIndexActionParams, opts ...ClientOption) (*StartPostgreSQLShowIndexActionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartPostgreSQLShowIndexActionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartPostgreSQLShowIndexAction", Method: "POST", PathPattern: "/v1/management/Actions/StartPostgreSQLShowIndex", @@ -570,7 +628,12 @@ func (a *Client) StartPostgreSQLShowIndexAction(params *StartPostgreSQLShowIndex Reader: &StartPostgreSQLShowIndexActionReader{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 } diff --git a/api/managementpb/json/client/actions/cancel_action_parameters.go b/api/managementpb/json/client/actions/cancel_action_parameters.go index 74249f6ff1..4737c5dafe 100644 --- a/api/managementpb/json/client/actions/cancel_action_parameters.go +++ b/api/managementpb/json/client/actions/cancel_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCancelActionParams creates a new CancelActionParams object -// with the default values initialized. +// 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 { - var () return &CancelActionParams{ - timeout: cr.DefaultTimeout, } } // NewCancelActionParamsWithTimeout creates a new CancelActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCancelActionParamsWithTimeout(timeout time.Duration) *CancelActionParams { - var () return &CancelActionParams{ - timeout: timeout, } } // NewCancelActionParamsWithContext creates a new CancelActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCancelActionParamsWithContext(ctx context.Context) *CancelActionParams { - var () return &CancelActionParams{ - Context: ctx, } } // NewCancelActionParamsWithHTTPClient creates a new CancelActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCancelActionParamsWithHTTPClient(client *http.Client) *CancelActionParams { - var () 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 +/* 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. Body CancelActionBody timeout time.Duration @@ -68,6 +67,21 @@ type CancelActionParams struct { 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) @@ -119,7 +133,6 @@ func (o *CancelActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/cancel_action_responses.go b/api/managementpb/json/client/actions/cancel_action_responses.go index 65a5ccd30a..2b8fec229d 100644 --- a/api/managementpb/json/client/actions/cancel_action_responses.go +++ b/api/managementpb/json/client/actions/cancel_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewCancelActionOK() *CancelActionOK { return &CancelActionOK{} } -/*CancelActionOK handles this case with default header values. +/* CancelActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type CancelActionOK struct { func (o *CancelActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/Cancel][%d] cancelActionOk %+v", 200, o.Payload) } - func (o *CancelActionOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewCancelActionDefault(code int) *CancelActionDefault { } } -/*CancelActionDefault handles this case with default header values. +/* CancelActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *CancelActionDefault) Code() int { func (o *CancelActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/Cancel][%d] CancelAction default %+v", o._statusCode, o.Payload) } - func (o *CancelActionDefault) GetPayload() *CancelActionDefaultBody { return o.Payload } @@ -129,6 +128,11 @@ 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 { @@ -162,7 +166,7 @@ type CancelActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*CancelActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this cancel action default body @@ -180,7 +184,6 @@ func (o *CancelActionDefaultBody) Validate(formats strfmt.Registry) error { } func (o *CancelActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -194,6 +197,42 @@ func (o *CancelActionDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("CancelAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CancelAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CancelAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -222,10 +261,10 @@ func (o *CancelActionDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*CancelActionDefaultBodyDetailsItems0 cancel action default body details items0 +swagger:model CancelActionDefaultBodyDetailsItems0 */ -type DetailsItems0 struct { +type CancelActionDefaultBodyDetailsItems0 struct { // type url TypeURL string `json:"type_url,omitempty"` @@ -235,13 +274,18 @@ type DetailsItems0 struct { Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// 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 *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *CancelActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -249,8 +293,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *CancelActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res CancelActionDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/actions/get_action_parameters.go b/api/managementpb/json/client/actions/get_action_parameters.go index d84d9f30b9..840de5ba59 100644 --- a/api/managementpb/json/client/actions/get_action_parameters.go +++ b/api/managementpb/json/client/actions/get_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetActionParams creates a new GetActionParams object -// with the default values initialized. +// 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 { - var () return &GetActionParams{ - timeout: cr.DefaultTimeout, } } // NewGetActionParamsWithTimeout creates a new GetActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetActionParamsWithTimeout(timeout time.Duration) *GetActionParams { - var () return &GetActionParams{ - timeout: timeout, } } // NewGetActionParamsWithContext creates a new GetActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetActionParamsWithContext(ctx context.Context) *GetActionParams { - var () return &GetActionParams{ - Context: ctx, } } // NewGetActionParamsWithHTTPClient creates a new GetActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetActionParamsWithHTTPClient(client *http.Client) *GetActionParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body GetActionBody timeout time.Duration @@ -68,6 +67,21 @@ type GetActionParams struct { 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) @@ -119,7 +133,6 @@ func (o *GetActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/get_action_responses.go b/api/managementpb/json/client/actions/get_action_responses.go index 525b04b426..819bf4780e 100644 --- a/api/managementpb/json/client/actions/get_action_responses.go +++ b/api/managementpb/json/client/actions/get_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetActionOK() *GetActionOK { return &GetActionOK{} } -/*GetActionOK handles this case with default header values. +/* GetActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetActionOK struct { func (o *GetActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/Get][%d] getActionOk %+v", 200, o.Payload) } - func (o *GetActionOK) GetPayload() *GetActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetActionDefault(code int) *GetActionDefault { } } -/*GetActionDefault handles this case with default header values. +/* GetActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetActionDefault) Code() int { func (o *GetActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/Get][%d] GetAction default %+v", o._statusCode, o.Payload) } - func (o *GetActionDefault) GetPayload() *GetActionDefaultBody { return o.Payload } @@ -131,6 +130,11 @@ func (o *GetActionBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this get action body based on context it is used +func (o *GetActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -164,7 +168,7 @@ type GetActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get action default body @@ -182,7 +186,6 @@ func (o *GetActionDefaultBody) Validate(formats strfmt.Registry) error { } func (o *GetActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -196,6 +199,42 @@ func (o *GetActionDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,6 +263,47 @@ func (o *GetActionDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetActionDefaultBodyDetailsItems0 get action default body details items0 +swagger:model GetActionDefaultBodyDetailsItems0 +*/ +type GetActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -250,6 +330,11 @@ 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 { diff --git a/api/managementpb/json/client/actions/start_mongo_db_explain_action_parameters.go b/api/managementpb/json/client/actions/start_mongo_db_explain_action_parameters.go index d670d7947a..e2bdcedb6e 100644 --- a/api/managementpb/json/client/actions/start_mongo_db_explain_action_parameters.go +++ b/api/managementpb/json/client/actions/start_mongo_db_explain_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartMongoDBExplainActionParams creates a new StartMongoDBExplainActionParams object -// with the default values initialized. +// NewStartMongoDBExplainActionParams creates a new StartMongoDBExplainActionParams 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 NewStartMongoDBExplainActionParams() *StartMongoDBExplainActionParams { - var () return &StartMongoDBExplainActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartMongoDBExplainActionParamsWithTimeout creates a new StartMongoDBExplainActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartMongoDBExplainActionParamsWithTimeout(timeout time.Duration) *StartMongoDBExplainActionParams { - var () return &StartMongoDBExplainActionParams{ - timeout: timeout, } } // NewStartMongoDBExplainActionParamsWithContext creates a new StartMongoDBExplainActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartMongoDBExplainActionParamsWithContext(ctx context.Context) *StartMongoDBExplainActionParams { - var () return &StartMongoDBExplainActionParams{ - Context: ctx, } } // NewStartMongoDBExplainActionParamsWithHTTPClient creates a new StartMongoDBExplainActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartMongoDBExplainActionParamsWithHTTPClient(client *http.Client) *StartMongoDBExplainActionParams { - var () return &StartMongoDBExplainActionParams{ HTTPClient: client, } } -/*StartMongoDBExplainActionParams contains all the parameters to send to the API endpoint -for the start mongo DB explain action operation typically these are written to a http.Request +/* StartMongoDBExplainActionParams contains all the parameters to send to the API endpoint + for the start mongo DB explain action operation. + + Typically these are written to a http.Request. */ type StartMongoDBExplainActionParams struct { - /*Body*/ + // Body. Body StartMongoDBExplainActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartMongoDBExplainActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start mongo DB explain action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMongoDBExplainActionParams) WithDefaults() *StartMongoDBExplainActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start mongo DB explain action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMongoDBExplainActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start mongo DB explain action params func (o *StartMongoDBExplainActionParams) WithTimeout(timeout time.Duration) *StartMongoDBExplainActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartMongoDBExplainActionParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_mongo_db_explain_action_responses.go b/api/managementpb/json/client/actions/start_mongo_db_explain_action_responses.go index 47292d2b87..df60bca663 100644 --- a/api/managementpb/json/client/actions/start_mongo_db_explain_action_responses.go +++ b/api/managementpb/json/client/actions/start_mongo_db_explain_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartMongoDBExplainActionOK() *StartMongoDBExplainActionOK { return &StartMongoDBExplainActionOK{} } -/*StartMongoDBExplainActionOK handles this case with default header values. +/* StartMongoDBExplainActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartMongoDBExplainActionOK struct { func (o *StartMongoDBExplainActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMongoDBExplain][%d] startMongoDbExplainActionOk %+v", 200, o.Payload) } - func (o *StartMongoDBExplainActionOK) GetPayload() *StartMongoDBExplainActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartMongoDBExplainActionDefault(code int) *StartMongoDBExplainActionDef } } -/*StartMongoDBExplainActionDefault handles this case with default header values. +/* StartMongoDBExplainActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartMongoDBExplainActionDefault) Code() int { func (o *StartMongoDBExplainActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMongoDBExplain][%d] StartMongoDBExplainAction default %+v", o._statusCode, o.Payload) } - func (o *StartMongoDBExplainActionDefault) GetPayload() *StartMongoDBExplainActionDefaultBody { return o.Payload } @@ -137,6 +136,11 @@ func (o *StartMongoDBExplainActionBody) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this start mongo DB explain action body based on context it is used +func (o *StartMongoDBExplainActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMongoDBExplainActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -170,7 +174,7 @@ type StartMongoDBExplainActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartMongoDBExplainActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start mongo DB explain action default body @@ -188,7 +192,6 @@ func (o *StartMongoDBExplainActionDefaultBody) Validate(formats strfmt.Registry) } func (o *StartMongoDBExplainActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -202,6 +205,42 @@ func (o *StartMongoDBExplainActionDefaultBody) validateDetails(formats strfmt.Re if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartMongoDBExplainAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMongoDBExplainAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start mongo DB explain action default body based on the context it is used +func (o *StartMongoDBExplainActionDefaultBody) 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 *StartMongoDBExplainActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartMongoDBExplainAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMongoDBExplainAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -230,6 +269,47 @@ func (o *StartMongoDBExplainActionDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*StartMongoDBExplainActionDefaultBodyDetailsItems0 start mongo DB explain action default body details items0 +swagger:model StartMongoDBExplainActionDefaultBodyDetailsItems0 +*/ +type StartMongoDBExplainActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start mongo DB explain action default body details items0 +func (o *StartMongoDBExplainActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start mongo DB explain action default body details items0 based on context it is used +func (o *StartMongoDBExplainActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartMongoDBExplainActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartMongoDBExplainActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartMongoDBExplainActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartMongoDBExplainActionOKBody start mongo DB explain action OK body swagger:model StartMongoDBExplainActionOKBody */ @@ -247,6 +327,11 @@ func (o *StartMongoDBExplainActionOKBody) Validate(formats strfmt.Registry) erro return nil } +// ContextValidate validates this start mongo DB explain action OK body based on context it is used +func (o *StartMongoDBExplainActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMongoDBExplainActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_my_sql_explain_action_parameters.go b/api/managementpb/json/client/actions/start_my_sql_explain_action_parameters.go index 4b0c629f59..2e4d7736d7 100644 --- a/api/managementpb/json/client/actions/start_my_sql_explain_action_parameters.go +++ b/api/managementpb/json/client/actions/start_my_sql_explain_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartMySQLExplainActionParams creates a new StartMySQLExplainActionParams object -// with the default values initialized. +// NewStartMySQLExplainActionParams creates a new StartMySQLExplainActionParams 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 NewStartMySQLExplainActionParams() *StartMySQLExplainActionParams { - var () return &StartMySQLExplainActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartMySQLExplainActionParamsWithTimeout creates a new StartMySQLExplainActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartMySQLExplainActionParamsWithTimeout(timeout time.Duration) *StartMySQLExplainActionParams { - var () return &StartMySQLExplainActionParams{ - timeout: timeout, } } // NewStartMySQLExplainActionParamsWithContext creates a new StartMySQLExplainActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartMySQLExplainActionParamsWithContext(ctx context.Context) *StartMySQLExplainActionParams { - var () return &StartMySQLExplainActionParams{ - Context: ctx, } } // NewStartMySQLExplainActionParamsWithHTTPClient creates a new StartMySQLExplainActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartMySQLExplainActionParamsWithHTTPClient(client *http.Client) *StartMySQLExplainActionParams { - var () return &StartMySQLExplainActionParams{ HTTPClient: client, } } -/*StartMySQLExplainActionParams contains all the parameters to send to the API endpoint -for the start my SQL explain action operation typically these are written to a http.Request +/* StartMySQLExplainActionParams contains all the parameters to send to the API endpoint + for the start my SQL explain action operation. + + Typically these are written to a http.Request. */ type StartMySQLExplainActionParams struct { - /*Body*/ + // Body. Body StartMySQLExplainActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartMySQLExplainActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start my SQL explain action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLExplainActionParams) WithDefaults() *StartMySQLExplainActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start my SQL explain action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLExplainActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start my SQL explain action params func (o *StartMySQLExplainActionParams) WithTimeout(timeout time.Duration) *StartMySQLExplainActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartMySQLExplainActionParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_my_sql_explain_action_responses.go b/api/managementpb/json/client/actions/start_my_sql_explain_action_responses.go index 7d814fd9e8..401a4b93fd 100644 --- a/api/managementpb/json/client/actions/start_my_sql_explain_action_responses.go +++ b/api/managementpb/json/client/actions/start_my_sql_explain_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartMySQLExplainActionOK() *StartMySQLExplainActionOK { return &StartMySQLExplainActionOK{} } -/*StartMySQLExplainActionOK handles this case with default header values. +/* StartMySQLExplainActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartMySQLExplainActionOK struct { func (o *StartMySQLExplainActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLExplain][%d] startMySqlExplainActionOk %+v", 200, o.Payload) } - func (o *StartMySQLExplainActionOK) GetPayload() *StartMySQLExplainActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartMySQLExplainActionDefault(code int) *StartMySQLExplainActionDefault } } -/*StartMySQLExplainActionDefault handles this case with default header values. +/* StartMySQLExplainActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartMySQLExplainActionDefault) Code() int { func (o *StartMySQLExplainActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLExplain][%d] StartMySQLExplainAction default %+v", o._statusCode, o.Payload) } - func (o *StartMySQLExplainActionDefault) GetPayload() *StartMySQLExplainActionDefaultBody { return o.Payload } @@ -140,6 +139,11 @@ func (o *StartMySQLExplainActionBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this start my SQL explain action body based on context it is used +func (o *StartMySQLExplainActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLExplainActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -173,7 +177,7 @@ type StartMySQLExplainActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartMySQLExplainActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start my SQL explain action default body @@ -191,7 +195,6 @@ func (o *StartMySQLExplainActionDefaultBody) Validate(formats strfmt.Registry) e } func (o *StartMySQLExplainActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -205,6 +208,42 @@ func (o *StartMySQLExplainActionDefaultBody) validateDetails(formats strfmt.Regi if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartMySQLExplainAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLExplainAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start my SQL explain action default body based on the context it is used +func (o *StartMySQLExplainActionDefaultBody) 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 *StartMySQLExplainActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartMySQLExplainAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLExplainAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -233,6 +272,47 @@ func (o *StartMySQLExplainActionDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*StartMySQLExplainActionDefaultBodyDetailsItems0 start my SQL explain action default body details items0 +swagger:model StartMySQLExplainActionDefaultBodyDetailsItems0 +*/ +type StartMySQLExplainActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start my SQL explain action default body details items0 +func (o *StartMySQLExplainActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start my SQL explain action default body details items0 based on context it is used +func (o *StartMySQLExplainActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartMySQLExplainActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartMySQLExplainActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartMySQLExplainActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartMySQLExplainActionOKBody start my SQL explain action OK body swagger:model StartMySQLExplainActionOKBody */ @@ -250,6 +330,11 @@ func (o *StartMySQLExplainActionOKBody) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this start my SQL explain action OK body based on context it is used +func (o *StartMySQLExplainActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLExplainActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_my_sql_explain_json_action_parameters.go b/api/managementpb/json/client/actions/start_my_sql_explain_json_action_parameters.go index c6076b6178..a3639265e8 100644 --- a/api/managementpb/json/client/actions/start_my_sql_explain_json_action_parameters.go +++ b/api/managementpb/json/client/actions/start_my_sql_explain_json_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartMySQLExplainJSONActionParams creates a new StartMySQLExplainJSONActionParams object -// with the default values initialized. +// NewStartMySQLExplainJSONActionParams creates a new StartMySQLExplainJSONActionParams 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 NewStartMySQLExplainJSONActionParams() *StartMySQLExplainJSONActionParams { - var () return &StartMySQLExplainJSONActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartMySQLExplainJSONActionParamsWithTimeout creates a new StartMySQLExplainJSONActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartMySQLExplainJSONActionParamsWithTimeout(timeout time.Duration) *StartMySQLExplainJSONActionParams { - var () return &StartMySQLExplainJSONActionParams{ - timeout: timeout, } } // NewStartMySQLExplainJSONActionParamsWithContext creates a new StartMySQLExplainJSONActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartMySQLExplainJSONActionParamsWithContext(ctx context.Context) *StartMySQLExplainJSONActionParams { - var () return &StartMySQLExplainJSONActionParams{ - Context: ctx, } } // NewStartMySQLExplainJSONActionParamsWithHTTPClient creates a new StartMySQLExplainJSONActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartMySQLExplainJSONActionParamsWithHTTPClient(client *http.Client) *StartMySQLExplainJSONActionParams { - var () return &StartMySQLExplainJSONActionParams{ HTTPClient: client, } } -/*StartMySQLExplainJSONActionParams contains all the parameters to send to the API endpoint -for the start my SQL explain JSON action operation typically these are written to a http.Request +/* StartMySQLExplainJSONActionParams contains all the parameters to send to the API endpoint + for the start my SQL explain JSON action operation. + + Typically these are written to a http.Request. */ type StartMySQLExplainJSONActionParams struct { - /*Body*/ + // Body. Body StartMySQLExplainJSONActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartMySQLExplainJSONActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start my SQL explain JSON action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLExplainJSONActionParams) WithDefaults() *StartMySQLExplainJSONActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start my SQL explain JSON action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLExplainJSONActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start my SQL explain JSON action params func (o *StartMySQLExplainJSONActionParams) WithTimeout(timeout time.Duration) *StartMySQLExplainJSONActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartMySQLExplainJSONActionParams) WriteToRequest(r runtime.ClientReque return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_my_sql_explain_json_action_responses.go b/api/managementpb/json/client/actions/start_my_sql_explain_json_action_responses.go index 5ced51b4f5..91b1fc252f 100644 --- a/api/managementpb/json/client/actions/start_my_sql_explain_json_action_responses.go +++ b/api/managementpb/json/client/actions/start_my_sql_explain_json_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartMySQLExplainJSONActionOK() *StartMySQLExplainJSONActionOK { return &StartMySQLExplainJSONActionOK{} } -/*StartMySQLExplainJSONActionOK handles this case with default header values. +/* StartMySQLExplainJSONActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartMySQLExplainJSONActionOK struct { func (o *StartMySQLExplainJSONActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLExplainJSON][%d] startMySqlExplainJsonActionOk %+v", 200, o.Payload) } - func (o *StartMySQLExplainJSONActionOK) GetPayload() *StartMySQLExplainJSONActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartMySQLExplainJSONActionDefault(code int) *StartMySQLExplainJSONActio } } -/*StartMySQLExplainJSONActionDefault handles this case with default header values. +/* StartMySQLExplainJSONActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartMySQLExplainJSONActionDefault) Code() int { func (o *StartMySQLExplainJSONActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLExplainJSON][%d] StartMySQLExplainJSONAction default %+v", o._statusCode, o.Payload) } - func (o *StartMySQLExplainJSONActionDefault) GetPayload() *StartMySQLExplainJSONActionDefaultBody { return o.Payload } @@ -140,6 +139,11 @@ func (o *StartMySQLExplainJSONActionBody) Validate(formats strfmt.Registry) erro return nil } +// ContextValidate validates this start my SQL explain JSON action body based on context it is used +func (o *StartMySQLExplainJSONActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLExplainJSONActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -173,7 +177,7 @@ type StartMySQLExplainJSONActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartMySQLExplainJSONActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start my SQL explain JSON action default body @@ -191,7 +195,6 @@ func (o *StartMySQLExplainJSONActionDefaultBody) Validate(formats strfmt.Registr } func (o *StartMySQLExplainJSONActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -205,6 +208,42 @@ func (o *StartMySQLExplainJSONActionDefaultBody) validateDetails(formats strfmt. if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartMySQLExplainJSONAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLExplainJSONAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start my SQL explain JSON action default body based on the context it is used +func (o *StartMySQLExplainJSONActionDefaultBody) 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 *StartMySQLExplainJSONActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartMySQLExplainJSONAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLExplainJSONAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -233,6 +272,47 @@ func (o *StartMySQLExplainJSONActionDefaultBody) UnmarshalBinary(b []byte) error return nil } +/*StartMySQLExplainJSONActionDefaultBodyDetailsItems0 start my SQL explain JSON action default body details items0 +swagger:model StartMySQLExplainJSONActionDefaultBodyDetailsItems0 +*/ +type StartMySQLExplainJSONActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start my SQL explain JSON action default body details items0 +func (o *StartMySQLExplainJSONActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start my SQL explain JSON action default body details items0 based on context it is used +func (o *StartMySQLExplainJSONActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartMySQLExplainJSONActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartMySQLExplainJSONActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartMySQLExplainJSONActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartMySQLExplainJSONActionOKBody start my SQL explain JSON action OK body swagger:model StartMySQLExplainJSONActionOKBody */ @@ -250,6 +330,11 @@ func (o *StartMySQLExplainJSONActionOKBody) Validate(formats strfmt.Registry) er return nil } +// ContextValidate validates this start my SQL explain JSON action OK body based on context it is used +func (o *StartMySQLExplainJSONActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLExplainJSONActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_my_sql_explain_traditional_json_action_parameters.go b/api/managementpb/json/client/actions/start_my_sql_explain_traditional_json_action_parameters.go index e7b7de7f91..3062ce1a99 100644 --- a/api/managementpb/json/client/actions/start_my_sql_explain_traditional_json_action_parameters.go +++ b/api/managementpb/json/client/actions/start_my_sql_explain_traditional_json_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartMySQLExplainTraditionalJSONActionParams creates a new StartMySQLExplainTraditionalJSONActionParams object -// with the default values initialized. +// NewStartMySQLExplainTraditionalJSONActionParams creates a new StartMySQLExplainTraditionalJSONActionParams 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 NewStartMySQLExplainTraditionalJSONActionParams() *StartMySQLExplainTraditionalJSONActionParams { - var () return &StartMySQLExplainTraditionalJSONActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartMySQLExplainTraditionalJSONActionParamsWithTimeout creates a new StartMySQLExplainTraditionalJSONActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartMySQLExplainTraditionalJSONActionParamsWithTimeout(timeout time.Duration) *StartMySQLExplainTraditionalJSONActionParams { - var () return &StartMySQLExplainTraditionalJSONActionParams{ - timeout: timeout, } } // NewStartMySQLExplainTraditionalJSONActionParamsWithContext creates a new StartMySQLExplainTraditionalJSONActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartMySQLExplainTraditionalJSONActionParamsWithContext(ctx context.Context) *StartMySQLExplainTraditionalJSONActionParams { - var () return &StartMySQLExplainTraditionalJSONActionParams{ - Context: ctx, } } // NewStartMySQLExplainTraditionalJSONActionParamsWithHTTPClient creates a new StartMySQLExplainTraditionalJSONActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartMySQLExplainTraditionalJSONActionParamsWithHTTPClient(client *http.Client) *StartMySQLExplainTraditionalJSONActionParams { - var () return &StartMySQLExplainTraditionalJSONActionParams{ HTTPClient: client, } } -/*StartMySQLExplainTraditionalJSONActionParams contains all the parameters to send to the API endpoint -for the start my SQL explain traditional JSON action operation typically these are written to a http.Request +/* StartMySQLExplainTraditionalJSONActionParams contains all the parameters to send to the API endpoint + for the start my SQL explain traditional JSON action operation. + + Typically these are written to a http.Request. */ type StartMySQLExplainTraditionalJSONActionParams struct { - /*Body*/ + // Body. Body StartMySQLExplainTraditionalJSONActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartMySQLExplainTraditionalJSONActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start my SQL explain traditional JSON action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLExplainTraditionalJSONActionParams) WithDefaults() *StartMySQLExplainTraditionalJSONActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start my SQL explain traditional JSON action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLExplainTraditionalJSONActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start my SQL explain traditional JSON action params func (o *StartMySQLExplainTraditionalJSONActionParams) WithTimeout(timeout time.Duration) *StartMySQLExplainTraditionalJSONActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartMySQLExplainTraditionalJSONActionParams) WriteToRequest(r runtime. return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_my_sql_explain_traditional_json_action_responses.go b/api/managementpb/json/client/actions/start_my_sql_explain_traditional_json_action_responses.go index 52f5aa30b8..1a5aee6df0 100644 --- a/api/managementpb/json/client/actions/start_my_sql_explain_traditional_json_action_responses.go +++ b/api/managementpb/json/client/actions/start_my_sql_explain_traditional_json_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartMySQLExplainTraditionalJSONActionOK() *StartMySQLExplainTraditional return &StartMySQLExplainTraditionalJSONActionOK{} } -/*StartMySQLExplainTraditionalJSONActionOK handles this case with default header values. +/* StartMySQLExplainTraditionalJSONActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartMySQLExplainTraditionalJSONActionOK struct { func (o *StartMySQLExplainTraditionalJSONActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLExplainTraditionalJSON][%d] startMySqlExplainTraditionalJsonActionOk %+v", 200, o.Payload) } - func (o *StartMySQLExplainTraditionalJSONActionOK) GetPayload() *StartMySQLExplainTraditionalJSONActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartMySQLExplainTraditionalJSONActionDefault(code int) *StartMySQLExpla } } -/*StartMySQLExplainTraditionalJSONActionDefault handles this case with default header values. +/* StartMySQLExplainTraditionalJSONActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartMySQLExplainTraditionalJSONActionDefault) Code() int { func (o *StartMySQLExplainTraditionalJSONActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLExplainTraditionalJSON][%d] StartMySQLExplainTraditionalJSONAction default %+v", o._statusCode, o.Payload) } - func (o *StartMySQLExplainTraditionalJSONActionDefault) GetPayload() *StartMySQLExplainTraditionalJSONActionDefaultBody { return o.Payload } @@ -140,6 +139,11 @@ func (o *StartMySQLExplainTraditionalJSONActionBody) Validate(formats strfmt.Reg return nil } +// ContextValidate validates this start my SQL explain traditional JSON action body based on context it is used +func (o *StartMySQLExplainTraditionalJSONActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLExplainTraditionalJSONActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -173,7 +177,7 @@ type StartMySQLExplainTraditionalJSONActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartMySQLExplainTraditionalJSONActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start my SQL explain traditional JSON action default body @@ -191,7 +195,6 @@ func (o *StartMySQLExplainTraditionalJSONActionDefaultBody) Validate(formats str } func (o *StartMySQLExplainTraditionalJSONActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -205,6 +208,42 @@ func (o *StartMySQLExplainTraditionalJSONActionDefaultBody) validateDetails(form if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartMySQLExplainTraditionalJSONAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLExplainTraditionalJSONAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start my SQL explain traditional JSON action default body based on the context it is used +func (o *StartMySQLExplainTraditionalJSONActionDefaultBody) 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 *StartMySQLExplainTraditionalJSONActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartMySQLExplainTraditionalJSONAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLExplainTraditionalJSONAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -233,6 +272,47 @@ func (o *StartMySQLExplainTraditionalJSONActionDefaultBody) UnmarshalBinary(b [] return nil } +/*StartMySQLExplainTraditionalJSONActionDefaultBodyDetailsItems0 start my SQL explain traditional JSON action default body details items0 +swagger:model StartMySQLExplainTraditionalJSONActionDefaultBodyDetailsItems0 +*/ +type StartMySQLExplainTraditionalJSONActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start my SQL explain traditional JSON action default body details items0 +func (o *StartMySQLExplainTraditionalJSONActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start my SQL explain traditional JSON action default body details items0 based on context it is used +func (o *StartMySQLExplainTraditionalJSONActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartMySQLExplainTraditionalJSONActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartMySQLExplainTraditionalJSONActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartMySQLExplainTraditionalJSONActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartMySQLExplainTraditionalJSONActionOKBody start my SQL explain traditional JSON action OK body swagger:model StartMySQLExplainTraditionalJSONActionOKBody */ @@ -250,6 +330,11 @@ func (o *StartMySQLExplainTraditionalJSONActionOKBody) Validate(formats strfmt.R return nil } +// ContextValidate validates this start my SQL explain traditional JSON action OK body based on context it is used +func (o *StartMySQLExplainTraditionalJSONActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLExplainTraditionalJSONActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_my_sql_show_create_table_action_parameters.go b/api/managementpb/json/client/actions/start_my_sql_show_create_table_action_parameters.go index 5b7fa57a8f..486c7dc636 100644 --- a/api/managementpb/json/client/actions/start_my_sql_show_create_table_action_parameters.go +++ b/api/managementpb/json/client/actions/start_my_sql_show_create_table_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartMySQLShowCreateTableActionParams creates a new StartMySQLShowCreateTableActionParams object -// with the default values initialized. +// NewStartMySQLShowCreateTableActionParams creates a new StartMySQLShowCreateTableActionParams 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 NewStartMySQLShowCreateTableActionParams() *StartMySQLShowCreateTableActionParams { - var () return &StartMySQLShowCreateTableActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartMySQLShowCreateTableActionParamsWithTimeout creates a new StartMySQLShowCreateTableActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartMySQLShowCreateTableActionParamsWithTimeout(timeout time.Duration) *StartMySQLShowCreateTableActionParams { - var () return &StartMySQLShowCreateTableActionParams{ - timeout: timeout, } } // NewStartMySQLShowCreateTableActionParamsWithContext creates a new StartMySQLShowCreateTableActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartMySQLShowCreateTableActionParamsWithContext(ctx context.Context) *StartMySQLShowCreateTableActionParams { - var () return &StartMySQLShowCreateTableActionParams{ - Context: ctx, } } // NewStartMySQLShowCreateTableActionParamsWithHTTPClient creates a new StartMySQLShowCreateTableActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartMySQLShowCreateTableActionParamsWithHTTPClient(client *http.Client) *StartMySQLShowCreateTableActionParams { - var () return &StartMySQLShowCreateTableActionParams{ HTTPClient: client, } } -/*StartMySQLShowCreateTableActionParams contains all the parameters to send to the API endpoint -for the start my SQL show create table action operation typically these are written to a http.Request +/* StartMySQLShowCreateTableActionParams contains all the parameters to send to the API endpoint + for the start my SQL show create table action operation. + + Typically these are written to a http.Request. */ type StartMySQLShowCreateTableActionParams struct { - /*Body*/ + // Body. Body StartMySQLShowCreateTableActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartMySQLShowCreateTableActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start my SQL show create table action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLShowCreateTableActionParams) WithDefaults() *StartMySQLShowCreateTableActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start my SQL show create table action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLShowCreateTableActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start my SQL show create table action params func (o *StartMySQLShowCreateTableActionParams) WithTimeout(timeout time.Duration) *StartMySQLShowCreateTableActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartMySQLShowCreateTableActionParams) WriteToRequest(r runtime.ClientR return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_my_sql_show_create_table_action_responses.go b/api/managementpb/json/client/actions/start_my_sql_show_create_table_action_responses.go index a29488c0e4..4c8c79d0cf 100644 --- a/api/managementpb/json/client/actions/start_my_sql_show_create_table_action_responses.go +++ b/api/managementpb/json/client/actions/start_my_sql_show_create_table_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartMySQLShowCreateTableActionOK() *StartMySQLShowCreateTableActionOK { return &StartMySQLShowCreateTableActionOK{} } -/*StartMySQLShowCreateTableActionOK handles this case with default header values. +/* StartMySQLShowCreateTableActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartMySQLShowCreateTableActionOK struct { func (o *StartMySQLShowCreateTableActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLShowCreateTable][%d] startMySqlShowCreateTableActionOk %+v", 200, o.Payload) } - func (o *StartMySQLShowCreateTableActionOK) GetPayload() *StartMySQLShowCreateTableActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartMySQLShowCreateTableActionDefault(code int) *StartMySQLShowCreateTa } } -/*StartMySQLShowCreateTableActionDefault handles this case with default header values. +/* StartMySQLShowCreateTableActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartMySQLShowCreateTableActionDefault) Code() int { func (o *StartMySQLShowCreateTableActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLShowCreateTable][%d] StartMySQLShowCreateTableAction default %+v", o._statusCode, o.Payload) } - func (o *StartMySQLShowCreateTableActionDefault) GetPayload() *StartMySQLShowCreateTableActionDefaultBody { return o.Payload } @@ -140,6 +139,11 @@ func (o *StartMySQLShowCreateTableActionBody) Validate(formats strfmt.Registry) return nil } +// ContextValidate validates this start my SQL show create table action body based on context it is used +func (o *StartMySQLShowCreateTableActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLShowCreateTableActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -173,7 +177,7 @@ type StartMySQLShowCreateTableActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartMySQLShowCreateTableActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start my SQL show create table action default body @@ -191,7 +195,6 @@ func (o *StartMySQLShowCreateTableActionDefaultBody) Validate(formats strfmt.Reg } func (o *StartMySQLShowCreateTableActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -205,6 +208,42 @@ func (o *StartMySQLShowCreateTableActionDefaultBody) validateDetails(formats str if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartMySQLShowCreateTableAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLShowCreateTableAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start my SQL show create table action default body based on the context it is used +func (o *StartMySQLShowCreateTableActionDefaultBody) 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 *StartMySQLShowCreateTableActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartMySQLShowCreateTableAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLShowCreateTableAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -233,6 +272,47 @@ func (o *StartMySQLShowCreateTableActionDefaultBody) UnmarshalBinary(b []byte) e return nil } +/*StartMySQLShowCreateTableActionDefaultBodyDetailsItems0 start my SQL show create table action default body details items0 +swagger:model StartMySQLShowCreateTableActionDefaultBodyDetailsItems0 +*/ +type StartMySQLShowCreateTableActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start my SQL show create table action default body details items0 +func (o *StartMySQLShowCreateTableActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start my SQL show create table action default body details items0 based on context it is used +func (o *StartMySQLShowCreateTableActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartMySQLShowCreateTableActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartMySQLShowCreateTableActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartMySQLShowCreateTableActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartMySQLShowCreateTableActionOKBody start my SQL show create table action OK body swagger:model StartMySQLShowCreateTableActionOKBody */ @@ -250,6 +330,11 @@ func (o *StartMySQLShowCreateTableActionOKBody) Validate(formats strfmt.Registry return nil } +// ContextValidate validates this start my SQL show create table action OK body based on context it is used +func (o *StartMySQLShowCreateTableActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLShowCreateTableActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_my_sql_show_index_action_parameters.go b/api/managementpb/json/client/actions/start_my_sql_show_index_action_parameters.go index 32d1c2b2cf..4c78b25e64 100644 --- a/api/managementpb/json/client/actions/start_my_sql_show_index_action_parameters.go +++ b/api/managementpb/json/client/actions/start_my_sql_show_index_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartMySQLShowIndexActionParams creates a new StartMySQLShowIndexActionParams object -// with the default values initialized. +// NewStartMySQLShowIndexActionParams creates a new StartMySQLShowIndexActionParams 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 NewStartMySQLShowIndexActionParams() *StartMySQLShowIndexActionParams { - var () return &StartMySQLShowIndexActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartMySQLShowIndexActionParamsWithTimeout creates a new StartMySQLShowIndexActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartMySQLShowIndexActionParamsWithTimeout(timeout time.Duration) *StartMySQLShowIndexActionParams { - var () return &StartMySQLShowIndexActionParams{ - timeout: timeout, } } // NewStartMySQLShowIndexActionParamsWithContext creates a new StartMySQLShowIndexActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartMySQLShowIndexActionParamsWithContext(ctx context.Context) *StartMySQLShowIndexActionParams { - var () return &StartMySQLShowIndexActionParams{ - Context: ctx, } } // NewStartMySQLShowIndexActionParamsWithHTTPClient creates a new StartMySQLShowIndexActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartMySQLShowIndexActionParamsWithHTTPClient(client *http.Client) *StartMySQLShowIndexActionParams { - var () return &StartMySQLShowIndexActionParams{ HTTPClient: client, } } -/*StartMySQLShowIndexActionParams contains all the parameters to send to the API endpoint -for the start my SQL show index action operation typically these are written to a http.Request +/* StartMySQLShowIndexActionParams contains all the parameters to send to the API endpoint + for the start my SQL show index action operation. + + Typically these are written to a http.Request. */ type StartMySQLShowIndexActionParams struct { - /*Body*/ + // Body. Body StartMySQLShowIndexActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartMySQLShowIndexActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start my SQL show index action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLShowIndexActionParams) WithDefaults() *StartMySQLShowIndexActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start my SQL show index action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLShowIndexActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start my SQL show index action params func (o *StartMySQLShowIndexActionParams) WithTimeout(timeout time.Duration) *StartMySQLShowIndexActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartMySQLShowIndexActionParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_my_sql_show_index_action_responses.go b/api/managementpb/json/client/actions/start_my_sql_show_index_action_responses.go index bdbf78ed91..53e2e26592 100644 --- a/api/managementpb/json/client/actions/start_my_sql_show_index_action_responses.go +++ b/api/managementpb/json/client/actions/start_my_sql_show_index_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartMySQLShowIndexActionOK() *StartMySQLShowIndexActionOK { return &StartMySQLShowIndexActionOK{} } -/*StartMySQLShowIndexActionOK handles this case with default header values. +/* StartMySQLShowIndexActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartMySQLShowIndexActionOK struct { func (o *StartMySQLShowIndexActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLShowIndex][%d] startMySqlShowIndexActionOk %+v", 200, o.Payload) } - func (o *StartMySQLShowIndexActionOK) GetPayload() *StartMySQLShowIndexActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartMySQLShowIndexActionDefault(code int) *StartMySQLShowIndexActionDef } } -/*StartMySQLShowIndexActionDefault handles this case with default header values. +/* StartMySQLShowIndexActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartMySQLShowIndexActionDefault) Code() int { func (o *StartMySQLShowIndexActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLShowIndex][%d] StartMySQLShowIndexAction default %+v", o._statusCode, o.Payload) } - func (o *StartMySQLShowIndexActionDefault) GetPayload() *StartMySQLShowIndexActionDefaultBody { return o.Payload } @@ -140,6 +139,11 @@ func (o *StartMySQLShowIndexActionBody) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this start my SQL show index action body based on context it is used +func (o *StartMySQLShowIndexActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLShowIndexActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -173,7 +177,7 @@ type StartMySQLShowIndexActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartMySQLShowIndexActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start my SQL show index action default body @@ -191,7 +195,6 @@ func (o *StartMySQLShowIndexActionDefaultBody) Validate(formats strfmt.Registry) } func (o *StartMySQLShowIndexActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -205,6 +208,42 @@ func (o *StartMySQLShowIndexActionDefaultBody) validateDetails(formats strfmt.Re if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartMySQLShowIndexAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLShowIndexAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start my SQL show index action default body based on the context it is used +func (o *StartMySQLShowIndexActionDefaultBody) 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 *StartMySQLShowIndexActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartMySQLShowIndexAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLShowIndexAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -233,6 +272,47 @@ func (o *StartMySQLShowIndexActionDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*StartMySQLShowIndexActionDefaultBodyDetailsItems0 start my SQL show index action default body details items0 +swagger:model StartMySQLShowIndexActionDefaultBodyDetailsItems0 +*/ +type StartMySQLShowIndexActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start my SQL show index action default body details items0 +func (o *StartMySQLShowIndexActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start my SQL show index action default body details items0 based on context it is used +func (o *StartMySQLShowIndexActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartMySQLShowIndexActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartMySQLShowIndexActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartMySQLShowIndexActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartMySQLShowIndexActionOKBody start my SQL show index action OK body swagger:model StartMySQLShowIndexActionOKBody */ @@ -250,6 +330,11 @@ func (o *StartMySQLShowIndexActionOKBody) Validate(formats strfmt.Registry) erro return nil } +// ContextValidate validates this start my SQL show index action OK body based on context it is used +func (o *StartMySQLShowIndexActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLShowIndexActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_my_sql_show_table_status_action_parameters.go b/api/managementpb/json/client/actions/start_my_sql_show_table_status_action_parameters.go index 048545f9f1..e4a6fcd7d5 100644 --- a/api/managementpb/json/client/actions/start_my_sql_show_table_status_action_parameters.go +++ b/api/managementpb/json/client/actions/start_my_sql_show_table_status_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartMySQLShowTableStatusActionParams creates a new StartMySQLShowTableStatusActionParams object -// with the default values initialized. +// NewStartMySQLShowTableStatusActionParams creates a new StartMySQLShowTableStatusActionParams 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 NewStartMySQLShowTableStatusActionParams() *StartMySQLShowTableStatusActionParams { - var () return &StartMySQLShowTableStatusActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartMySQLShowTableStatusActionParamsWithTimeout creates a new StartMySQLShowTableStatusActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartMySQLShowTableStatusActionParamsWithTimeout(timeout time.Duration) *StartMySQLShowTableStatusActionParams { - var () return &StartMySQLShowTableStatusActionParams{ - timeout: timeout, } } // NewStartMySQLShowTableStatusActionParamsWithContext creates a new StartMySQLShowTableStatusActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartMySQLShowTableStatusActionParamsWithContext(ctx context.Context) *StartMySQLShowTableStatusActionParams { - var () return &StartMySQLShowTableStatusActionParams{ - Context: ctx, } } // NewStartMySQLShowTableStatusActionParamsWithHTTPClient creates a new StartMySQLShowTableStatusActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartMySQLShowTableStatusActionParamsWithHTTPClient(client *http.Client) *StartMySQLShowTableStatusActionParams { - var () return &StartMySQLShowTableStatusActionParams{ HTTPClient: client, } } -/*StartMySQLShowTableStatusActionParams contains all the parameters to send to the API endpoint -for the start my SQL show table status action operation typically these are written to a http.Request +/* StartMySQLShowTableStatusActionParams contains all the parameters to send to the API endpoint + for the start my SQL show table status action operation. + + Typically these are written to a http.Request. */ type StartMySQLShowTableStatusActionParams struct { - /*Body*/ + // Body. Body StartMySQLShowTableStatusActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartMySQLShowTableStatusActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start my SQL show table status action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLShowTableStatusActionParams) WithDefaults() *StartMySQLShowTableStatusActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start my SQL show table status action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartMySQLShowTableStatusActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start my SQL show table status action params func (o *StartMySQLShowTableStatusActionParams) WithTimeout(timeout time.Duration) *StartMySQLShowTableStatusActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartMySQLShowTableStatusActionParams) WriteToRequest(r runtime.ClientR return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_my_sql_show_table_status_action_responses.go b/api/managementpb/json/client/actions/start_my_sql_show_table_status_action_responses.go index 1aa9297ba9..69c9b1f85b 100644 --- a/api/managementpb/json/client/actions/start_my_sql_show_table_status_action_responses.go +++ b/api/managementpb/json/client/actions/start_my_sql_show_table_status_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartMySQLShowTableStatusActionOK() *StartMySQLShowTableStatusActionOK { return &StartMySQLShowTableStatusActionOK{} } -/*StartMySQLShowTableStatusActionOK handles this case with default header values. +/* StartMySQLShowTableStatusActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartMySQLShowTableStatusActionOK struct { func (o *StartMySQLShowTableStatusActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLShowTableStatus][%d] startMySqlShowTableStatusActionOk %+v", 200, o.Payload) } - func (o *StartMySQLShowTableStatusActionOK) GetPayload() *StartMySQLShowTableStatusActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartMySQLShowTableStatusActionDefault(code int) *StartMySQLShowTableSta } } -/*StartMySQLShowTableStatusActionDefault handles this case with default header values. +/* StartMySQLShowTableStatusActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartMySQLShowTableStatusActionDefault) Code() int { func (o *StartMySQLShowTableStatusActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartMySQLShowTableStatus][%d] StartMySQLShowTableStatusAction default %+v", o._statusCode, o.Payload) } - func (o *StartMySQLShowTableStatusActionDefault) GetPayload() *StartMySQLShowTableStatusActionDefaultBody { return o.Payload } @@ -140,6 +139,11 @@ func (o *StartMySQLShowTableStatusActionBody) Validate(formats strfmt.Registry) return nil } +// ContextValidate validates this start my SQL show table status action body based on context it is used +func (o *StartMySQLShowTableStatusActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLShowTableStatusActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -173,7 +177,7 @@ type StartMySQLShowTableStatusActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartMySQLShowTableStatusActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start my SQL show table status action default body @@ -191,7 +195,6 @@ func (o *StartMySQLShowTableStatusActionDefaultBody) Validate(formats strfmt.Reg } func (o *StartMySQLShowTableStatusActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -205,6 +208,42 @@ func (o *StartMySQLShowTableStatusActionDefaultBody) validateDetails(formats str if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartMySQLShowTableStatusAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLShowTableStatusAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start my SQL show table status action default body based on the context it is used +func (o *StartMySQLShowTableStatusActionDefaultBody) 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 *StartMySQLShowTableStatusActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartMySQLShowTableStatusAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartMySQLShowTableStatusAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -233,6 +272,47 @@ func (o *StartMySQLShowTableStatusActionDefaultBody) UnmarshalBinary(b []byte) e return nil } +/*StartMySQLShowTableStatusActionDefaultBodyDetailsItems0 start my SQL show table status action default body details items0 +swagger:model StartMySQLShowTableStatusActionDefaultBodyDetailsItems0 +*/ +type StartMySQLShowTableStatusActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start my SQL show table status action default body details items0 +func (o *StartMySQLShowTableStatusActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start my SQL show table status action default body details items0 based on context it is used +func (o *StartMySQLShowTableStatusActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartMySQLShowTableStatusActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartMySQLShowTableStatusActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartMySQLShowTableStatusActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartMySQLShowTableStatusActionOKBody start my SQL show table status action OK body swagger:model StartMySQLShowTableStatusActionOKBody */ @@ -250,6 +330,11 @@ func (o *StartMySQLShowTableStatusActionOKBody) Validate(formats strfmt.Registry return nil } +// ContextValidate validates this start my SQL show table status action OK body based on context it is used +func (o *StartMySQLShowTableStatusActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartMySQLShowTableStatusActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_postgre_sql_show_create_table_action_parameters.go b/api/managementpb/json/client/actions/start_postgre_sql_show_create_table_action_parameters.go index 12daf26469..a7d9fe0d5a 100644 --- a/api/managementpb/json/client/actions/start_postgre_sql_show_create_table_action_parameters.go +++ b/api/managementpb/json/client/actions/start_postgre_sql_show_create_table_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartPostgreSQLShowCreateTableActionParams creates a new StartPostgreSQLShowCreateTableActionParams object -// with the default values initialized. +// NewStartPostgreSQLShowCreateTableActionParams creates a new StartPostgreSQLShowCreateTableActionParams 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 NewStartPostgreSQLShowCreateTableActionParams() *StartPostgreSQLShowCreateTableActionParams { - var () return &StartPostgreSQLShowCreateTableActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartPostgreSQLShowCreateTableActionParamsWithTimeout creates a new StartPostgreSQLShowCreateTableActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartPostgreSQLShowCreateTableActionParamsWithTimeout(timeout time.Duration) *StartPostgreSQLShowCreateTableActionParams { - var () return &StartPostgreSQLShowCreateTableActionParams{ - timeout: timeout, } } // NewStartPostgreSQLShowCreateTableActionParamsWithContext creates a new StartPostgreSQLShowCreateTableActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartPostgreSQLShowCreateTableActionParamsWithContext(ctx context.Context) *StartPostgreSQLShowCreateTableActionParams { - var () return &StartPostgreSQLShowCreateTableActionParams{ - Context: ctx, } } // NewStartPostgreSQLShowCreateTableActionParamsWithHTTPClient creates a new StartPostgreSQLShowCreateTableActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartPostgreSQLShowCreateTableActionParamsWithHTTPClient(client *http.Client) *StartPostgreSQLShowCreateTableActionParams { - var () return &StartPostgreSQLShowCreateTableActionParams{ HTTPClient: client, } } -/*StartPostgreSQLShowCreateTableActionParams contains all the parameters to send to the API endpoint -for the start postgre SQL show create table action operation typically these are written to a http.Request +/* StartPostgreSQLShowCreateTableActionParams contains all the parameters to send to the API endpoint + for the start postgre SQL show create table action operation. + + Typically these are written to a http.Request. */ type StartPostgreSQLShowCreateTableActionParams struct { - /*Body*/ + // Body. Body StartPostgreSQLShowCreateTableActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartPostgreSQLShowCreateTableActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start postgre SQL show create table action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartPostgreSQLShowCreateTableActionParams) WithDefaults() *StartPostgreSQLShowCreateTableActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start postgre SQL show create table action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartPostgreSQLShowCreateTableActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start postgre SQL show create table action params func (o *StartPostgreSQLShowCreateTableActionParams) WithTimeout(timeout time.Duration) *StartPostgreSQLShowCreateTableActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartPostgreSQLShowCreateTableActionParams) WriteToRequest(r runtime.Cl return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_postgre_sql_show_create_table_action_responses.go b/api/managementpb/json/client/actions/start_postgre_sql_show_create_table_action_responses.go index ca1d6f15f1..53c6b35cd1 100644 --- a/api/managementpb/json/client/actions/start_postgre_sql_show_create_table_action_responses.go +++ b/api/managementpb/json/client/actions/start_postgre_sql_show_create_table_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartPostgreSQLShowCreateTableActionOK() *StartPostgreSQLShowCreateTable return &StartPostgreSQLShowCreateTableActionOK{} } -/*StartPostgreSQLShowCreateTableActionOK handles this case with default header values. +/* StartPostgreSQLShowCreateTableActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartPostgreSQLShowCreateTableActionOK struct { func (o *StartPostgreSQLShowCreateTableActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPostgreSQLShowCreateTable][%d] startPostgreSqlShowCreateTableActionOk %+v", 200, o.Payload) } - func (o *StartPostgreSQLShowCreateTableActionOK) GetPayload() *StartPostgreSQLShowCreateTableActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartPostgreSQLShowCreateTableActionDefault(code int) *StartPostgreSQLSh } } -/*StartPostgreSQLShowCreateTableActionDefault handles this case with default header values. +/* StartPostgreSQLShowCreateTableActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartPostgreSQLShowCreateTableActionDefault) Code() int { func (o *StartPostgreSQLShowCreateTableActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPostgreSQLShowCreateTable][%d] StartPostgreSQLShowCreateTableAction default %+v", o._statusCode, o.Payload) } - func (o *StartPostgreSQLShowCreateTableActionDefault) GetPayload() *StartPostgreSQLShowCreateTableActionDefaultBody { return o.Payload } @@ -140,6 +139,11 @@ func (o *StartPostgreSQLShowCreateTableActionBody) Validate(formats strfmt.Regis return nil } +// ContextValidate validates this start postgre SQL show create table action body based on context it is used +func (o *StartPostgreSQLShowCreateTableActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartPostgreSQLShowCreateTableActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -173,7 +177,7 @@ type StartPostgreSQLShowCreateTableActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartPostgreSQLShowCreateTableActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start postgre SQL show create table action default body @@ -191,7 +195,6 @@ func (o *StartPostgreSQLShowCreateTableActionDefaultBody) Validate(formats strfm } func (o *StartPostgreSQLShowCreateTableActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -205,6 +208,42 @@ func (o *StartPostgreSQLShowCreateTableActionDefaultBody) validateDetails(format if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartPostgreSQLShowCreateTableAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPostgreSQLShowCreateTableAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start postgre SQL show create table action default body based on the context it is used +func (o *StartPostgreSQLShowCreateTableActionDefaultBody) 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 *StartPostgreSQLShowCreateTableActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartPostgreSQLShowCreateTableAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPostgreSQLShowCreateTableAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -233,6 +272,47 @@ func (o *StartPostgreSQLShowCreateTableActionDefaultBody) UnmarshalBinary(b []by return nil } +/*StartPostgreSQLShowCreateTableActionDefaultBodyDetailsItems0 start postgre SQL show create table action default body details items0 +swagger:model StartPostgreSQLShowCreateTableActionDefaultBodyDetailsItems0 +*/ +type StartPostgreSQLShowCreateTableActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start postgre SQL show create table action default body details items0 +func (o *StartPostgreSQLShowCreateTableActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start postgre SQL show create table action default body details items0 based on context it is used +func (o *StartPostgreSQLShowCreateTableActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartPostgreSQLShowCreateTableActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartPostgreSQLShowCreateTableActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartPostgreSQLShowCreateTableActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartPostgreSQLShowCreateTableActionOKBody start postgre SQL show create table action OK body swagger:model StartPostgreSQLShowCreateTableActionOKBody */ @@ -250,6 +330,11 @@ func (o *StartPostgreSQLShowCreateTableActionOKBody) Validate(formats strfmt.Reg return nil } +// ContextValidate validates this start postgre SQL show create table action OK body based on context it is used +func (o *StartPostgreSQLShowCreateTableActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartPostgreSQLShowCreateTableActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_postgre_sql_show_index_action_parameters.go b/api/managementpb/json/client/actions/start_postgre_sql_show_index_action_parameters.go index 8a4378822d..5271268e43 100644 --- a/api/managementpb/json/client/actions/start_postgre_sql_show_index_action_parameters.go +++ b/api/managementpb/json/client/actions/start_postgre_sql_show_index_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartPostgreSQLShowIndexActionParams creates a new StartPostgreSQLShowIndexActionParams object -// with the default values initialized. +// NewStartPostgreSQLShowIndexActionParams creates a new StartPostgreSQLShowIndexActionParams 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 NewStartPostgreSQLShowIndexActionParams() *StartPostgreSQLShowIndexActionParams { - var () return &StartPostgreSQLShowIndexActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartPostgreSQLShowIndexActionParamsWithTimeout creates a new StartPostgreSQLShowIndexActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartPostgreSQLShowIndexActionParamsWithTimeout(timeout time.Duration) *StartPostgreSQLShowIndexActionParams { - var () return &StartPostgreSQLShowIndexActionParams{ - timeout: timeout, } } // NewStartPostgreSQLShowIndexActionParamsWithContext creates a new StartPostgreSQLShowIndexActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartPostgreSQLShowIndexActionParamsWithContext(ctx context.Context) *StartPostgreSQLShowIndexActionParams { - var () return &StartPostgreSQLShowIndexActionParams{ - Context: ctx, } } // NewStartPostgreSQLShowIndexActionParamsWithHTTPClient creates a new StartPostgreSQLShowIndexActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartPostgreSQLShowIndexActionParamsWithHTTPClient(client *http.Client) *StartPostgreSQLShowIndexActionParams { - var () return &StartPostgreSQLShowIndexActionParams{ HTTPClient: client, } } -/*StartPostgreSQLShowIndexActionParams contains all the parameters to send to the API endpoint -for the start postgre SQL show index action operation typically these are written to a http.Request +/* StartPostgreSQLShowIndexActionParams contains all the parameters to send to the API endpoint + for the start postgre SQL show index action operation. + + Typically these are written to a http.Request. */ type StartPostgreSQLShowIndexActionParams struct { - /*Body*/ + // Body. Body StartPostgreSQLShowIndexActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartPostgreSQLShowIndexActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start postgre SQL show index action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartPostgreSQLShowIndexActionParams) WithDefaults() *StartPostgreSQLShowIndexActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start postgre SQL show index action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartPostgreSQLShowIndexActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start postgre SQL show index action params func (o *StartPostgreSQLShowIndexActionParams) WithTimeout(timeout time.Duration) *StartPostgreSQLShowIndexActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartPostgreSQLShowIndexActionParams) WriteToRequest(r runtime.ClientRe return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_postgre_sql_show_index_action_responses.go b/api/managementpb/json/client/actions/start_postgre_sql_show_index_action_responses.go index 3471920a62..acc9aaac4f 100644 --- a/api/managementpb/json/client/actions/start_postgre_sql_show_index_action_responses.go +++ b/api/managementpb/json/client/actions/start_postgre_sql_show_index_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartPostgreSQLShowIndexActionOK() *StartPostgreSQLShowIndexActionOK { return &StartPostgreSQLShowIndexActionOK{} } -/*StartPostgreSQLShowIndexActionOK handles this case with default header values. +/* StartPostgreSQLShowIndexActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartPostgreSQLShowIndexActionOK struct { func (o *StartPostgreSQLShowIndexActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPostgreSQLShowIndex][%d] startPostgreSqlShowIndexActionOk %+v", 200, o.Payload) } - func (o *StartPostgreSQLShowIndexActionOK) GetPayload() *StartPostgreSQLShowIndexActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartPostgreSQLShowIndexActionDefault(code int) *StartPostgreSQLShowInde } } -/*StartPostgreSQLShowIndexActionDefault handles this case with default header values. +/* StartPostgreSQLShowIndexActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartPostgreSQLShowIndexActionDefault) Code() int { func (o *StartPostgreSQLShowIndexActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPostgreSQLShowIndex][%d] StartPostgreSQLShowIndexAction default %+v", o._statusCode, o.Payload) } - func (o *StartPostgreSQLShowIndexActionDefault) GetPayload() *StartPostgreSQLShowIndexActionDefaultBody { return o.Payload } @@ -140,6 +139,11 @@ func (o *StartPostgreSQLShowIndexActionBody) Validate(formats strfmt.Registry) e return nil } +// ContextValidate validates this start postgre SQL show index action body based on context it is used +func (o *StartPostgreSQLShowIndexActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartPostgreSQLShowIndexActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -173,7 +177,7 @@ type StartPostgreSQLShowIndexActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartPostgreSQLShowIndexActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start postgre SQL show index action default body @@ -191,7 +195,6 @@ func (o *StartPostgreSQLShowIndexActionDefaultBody) Validate(formats strfmt.Regi } func (o *StartPostgreSQLShowIndexActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -205,6 +208,42 @@ func (o *StartPostgreSQLShowIndexActionDefaultBody) validateDetails(formats strf if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartPostgreSQLShowIndexAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPostgreSQLShowIndexAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start postgre SQL show index action default body based on the context it is used +func (o *StartPostgreSQLShowIndexActionDefaultBody) 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 *StartPostgreSQLShowIndexActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartPostgreSQLShowIndexAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPostgreSQLShowIndexAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -233,6 +272,47 @@ func (o *StartPostgreSQLShowIndexActionDefaultBody) UnmarshalBinary(b []byte) er return nil } +/*StartPostgreSQLShowIndexActionDefaultBodyDetailsItems0 start postgre SQL show index action default body details items0 +swagger:model StartPostgreSQLShowIndexActionDefaultBodyDetailsItems0 +*/ +type StartPostgreSQLShowIndexActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start postgre SQL show index action default body details items0 +func (o *StartPostgreSQLShowIndexActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start postgre SQL show index action default body details items0 based on context it is used +func (o *StartPostgreSQLShowIndexActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartPostgreSQLShowIndexActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartPostgreSQLShowIndexActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartPostgreSQLShowIndexActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartPostgreSQLShowIndexActionOKBody start postgre SQL show index action OK body swagger:model StartPostgreSQLShowIndexActionOKBody */ @@ -250,6 +330,11 @@ func (o *StartPostgreSQLShowIndexActionOKBody) Validate(formats strfmt.Registry) return nil } +// ContextValidate validates this start postgre SQL show index action OK body based on context it is used +func (o *StartPostgreSQLShowIndexActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartPostgreSQLShowIndexActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_parameters.go b/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_parameters.go index 35231aa8d7..a22b83aab1 100644 --- a/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_parameters.go +++ b/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartPTMongoDBSummaryActionParams creates a new StartPTMongoDBSummaryActionParams object -// with the default values initialized. +// NewStartPTMongoDBSummaryActionParams creates a new StartPTMongoDBSummaryActionParams 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 NewStartPTMongoDBSummaryActionParams() *StartPTMongoDBSummaryActionParams { - var () return &StartPTMongoDBSummaryActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartPTMongoDBSummaryActionParamsWithTimeout creates a new StartPTMongoDBSummaryActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartPTMongoDBSummaryActionParamsWithTimeout(timeout time.Duration) *StartPTMongoDBSummaryActionParams { - var () return &StartPTMongoDBSummaryActionParams{ - timeout: timeout, } } // NewStartPTMongoDBSummaryActionParamsWithContext creates a new StartPTMongoDBSummaryActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartPTMongoDBSummaryActionParamsWithContext(ctx context.Context) *StartPTMongoDBSummaryActionParams { - var () return &StartPTMongoDBSummaryActionParams{ - Context: ctx, } } // NewStartPTMongoDBSummaryActionParamsWithHTTPClient creates a new StartPTMongoDBSummaryActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartPTMongoDBSummaryActionParamsWithHTTPClient(client *http.Client) *StartPTMongoDBSummaryActionParams { - var () return &StartPTMongoDBSummaryActionParams{ HTTPClient: client, } } -/*StartPTMongoDBSummaryActionParams contains all the parameters to send to the API endpoint -for the start PT mongo DB summary action operation typically these are written to a http.Request +/* StartPTMongoDBSummaryActionParams contains all the parameters to send to the API endpoint + for the start PT mongo DB summary action operation. + + Typically these are written to a http.Request. */ type StartPTMongoDBSummaryActionParams struct { - /*Body*/ + // Body. Body StartPTMongoDBSummaryActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartPTMongoDBSummaryActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start PT mongo DB summary action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartPTMongoDBSummaryActionParams) WithDefaults() *StartPTMongoDBSummaryActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start PT mongo DB summary action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartPTMongoDBSummaryActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start PT mongo DB summary action params func (o *StartPTMongoDBSummaryActionParams) WithTimeout(timeout time.Duration) *StartPTMongoDBSummaryActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartPTMongoDBSummaryActionParams) WriteToRequest(r runtime.ClientReque return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_responses.go b/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_responses.go index 3669db13ff..da80c1d7f8 100644 --- a/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_responses.go +++ b/api/managementpb/json/client/actions/start_pt_mongo_db_summary_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartPTMongoDBSummaryActionOK() *StartPTMongoDBSummaryActionOK { return &StartPTMongoDBSummaryActionOK{} } -/*StartPTMongoDBSummaryActionOK handles this case with default header values. +/* StartPTMongoDBSummaryActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartPTMongoDBSummaryActionOK struct { func (o *StartPTMongoDBSummaryActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPTMongoDBSummary][%d] startPtMongoDbSummaryActionOk %+v", 200, o.Payload) } - func (o *StartPTMongoDBSummaryActionOK) GetPayload() *StartPTMongoDBSummaryActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartPTMongoDBSummaryActionDefault(code int) *StartPTMongoDBSummaryActio } } -/*StartPTMongoDBSummaryActionDefault handles this case with default header values. +/* StartPTMongoDBSummaryActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartPTMongoDBSummaryActionDefault) Code() int { func (o *StartPTMongoDBSummaryActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPTMongoDBSummary][%d] StartPTMongoDBSummaryAction default %+v", o._statusCode, o.Payload) } - func (o *StartPTMongoDBSummaryActionDefault) GetPayload() *StartPTMongoDBSummaryActionDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ func (o *StartPTMongoDBSummaryActionBody) Validate(formats strfmt.Registry) erro return nil } +// ContextValidate validates this start PT mongo DB summary action body based on context it is used +func (o *StartPTMongoDBSummaryActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartPTMongoDBSummaryActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -167,7 +171,7 @@ type StartPTMongoDBSummaryActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartPTMongoDBSummaryActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start PT mongo DB summary action default body @@ -185,7 +189,6 @@ func (o *StartPTMongoDBSummaryActionDefaultBody) Validate(formats strfmt.Registr } func (o *StartPTMongoDBSummaryActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *StartPTMongoDBSummaryActionDefaultBody) validateDetails(formats strfmt. if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartPTMongoDBSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPTMongoDBSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start PT mongo DB summary action default body based on the context it is used +func (o *StartPTMongoDBSummaryActionDefaultBody) 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 *StartPTMongoDBSummaryActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartPTMongoDBSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPTMongoDBSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,6 +266,47 @@ func (o *StartPTMongoDBSummaryActionDefaultBody) UnmarshalBinary(b []byte) error return nil } +/*StartPTMongoDBSummaryActionDefaultBodyDetailsItems0 start PT mongo DB summary action default body details items0 +swagger:model StartPTMongoDBSummaryActionDefaultBodyDetailsItems0 +*/ +type StartPTMongoDBSummaryActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start PT mongo DB summary action default body details items0 +func (o *StartPTMongoDBSummaryActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start PT mongo DB summary action default body details items0 based on context it is used +func (o *StartPTMongoDBSummaryActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartPTMongoDBSummaryActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartPTMongoDBSummaryActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartPTMongoDBSummaryActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartPTMongoDBSummaryActionOKBody Message to retrieve the prepared pt-mongodb-summary data swagger:model StartPTMongoDBSummaryActionOKBody */ @@ -244,6 +324,11 @@ func (o *StartPTMongoDBSummaryActionOKBody) Validate(formats strfmt.Registry) er return nil } +// ContextValidate validates this start PT mongo DB summary action OK body based on context it is used +func (o *StartPTMongoDBSummaryActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartPTMongoDBSummaryActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_pt_my_sql_summary_action_parameters.go b/api/managementpb/json/client/actions/start_pt_my_sql_summary_action_parameters.go index 58466b9520..787245d68c 100644 --- a/api/managementpb/json/client/actions/start_pt_my_sql_summary_action_parameters.go +++ b/api/managementpb/json/client/actions/start_pt_my_sql_summary_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartPTMySQLSummaryActionParams creates a new StartPTMySQLSummaryActionParams object -// with the default values initialized. +// NewStartPTMySQLSummaryActionParams creates a new StartPTMySQLSummaryActionParams 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 NewStartPTMySQLSummaryActionParams() *StartPTMySQLSummaryActionParams { - var () return &StartPTMySQLSummaryActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartPTMySQLSummaryActionParamsWithTimeout creates a new StartPTMySQLSummaryActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartPTMySQLSummaryActionParamsWithTimeout(timeout time.Duration) *StartPTMySQLSummaryActionParams { - var () return &StartPTMySQLSummaryActionParams{ - timeout: timeout, } } // NewStartPTMySQLSummaryActionParamsWithContext creates a new StartPTMySQLSummaryActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartPTMySQLSummaryActionParamsWithContext(ctx context.Context) *StartPTMySQLSummaryActionParams { - var () return &StartPTMySQLSummaryActionParams{ - Context: ctx, } } // NewStartPTMySQLSummaryActionParamsWithHTTPClient creates a new StartPTMySQLSummaryActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartPTMySQLSummaryActionParamsWithHTTPClient(client *http.Client) *StartPTMySQLSummaryActionParams { - var () return &StartPTMySQLSummaryActionParams{ HTTPClient: client, } } -/*StartPTMySQLSummaryActionParams contains all the parameters to send to the API endpoint -for the start PT my SQL summary action operation typically these are written to a http.Request +/* StartPTMySQLSummaryActionParams contains all the parameters to send to the API endpoint + for the start PT my SQL summary action operation. + + Typically these are written to a http.Request. */ type StartPTMySQLSummaryActionParams struct { - /*Body*/ + // Body. Body StartPTMySQLSummaryActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartPTMySQLSummaryActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start PT my SQL summary action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartPTMySQLSummaryActionParams) WithDefaults() *StartPTMySQLSummaryActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start PT my SQL summary action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartPTMySQLSummaryActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start PT my SQL summary action params func (o *StartPTMySQLSummaryActionParams) WithTimeout(timeout time.Duration) *StartPTMySQLSummaryActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartPTMySQLSummaryActionParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_pt_my_sql_summary_action_responses.go b/api/managementpb/json/client/actions/start_pt_my_sql_summary_action_responses.go index 22442c477e..bf7cb31317 100644 --- a/api/managementpb/json/client/actions/start_pt_my_sql_summary_action_responses.go +++ b/api/managementpb/json/client/actions/start_pt_my_sql_summary_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartPTMySQLSummaryActionOK() *StartPTMySQLSummaryActionOK { return &StartPTMySQLSummaryActionOK{} } -/*StartPTMySQLSummaryActionOK handles this case with default header values. +/* StartPTMySQLSummaryActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartPTMySQLSummaryActionOK struct { func (o *StartPTMySQLSummaryActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPTMySQLSummary][%d] startPtMySqlSummaryActionOk %+v", 200, o.Payload) } - func (o *StartPTMySQLSummaryActionOK) GetPayload() *StartPTMySQLSummaryActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartPTMySQLSummaryActionDefault(code int) *StartPTMySQLSummaryActionDef } } -/*StartPTMySQLSummaryActionDefault handles this case with default header values. +/* StartPTMySQLSummaryActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartPTMySQLSummaryActionDefault) Code() int { func (o *StartPTMySQLSummaryActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPTMySQLSummary][%d] StartPTMySQLSummaryAction default %+v", o._statusCode, o.Payload) } - func (o *StartPTMySQLSummaryActionDefault) GetPayload() *StartPTMySQLSummaryActionDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ func (o *StartPTMySQLSummaryActionBody) Validate(formats strfmt.Registry) error return nil } +// ContextValidate validates this start PT my SQL summary action body based on context it is used +func (o *StartPTMySQLSummaryActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartPTMySQLSummaryActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -167,7 +171,7 @@ type StartPTMySQLSummaryActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartPTMySQLSummaryActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start PT my SQL summary action default body @@ -185,7 +189,6 @@ func (o *StartPTMySQLSummaryActionDefaultBody) Validate(formats strfmt.Registry) } func (o *StartPTMySQLSummaryActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *StartPTMySQLSummaryActionDefaultBody) validateDetails(formats strfmt.Re if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartPTMySQLSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPTMySQLSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start PT my SQL summary action default body based on the context it is used +func (o *StartPTMySQLSummaryActionDefaultBody) 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 *StartPTMySQLSummaryActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartPTMySQLSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPTMySQLSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,6 +266,47 @@ func (o *StartPTMySQLSummaryActionDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*StartPTMySQLSummaryActionDefaultBodyDetailsItems0 start PT my SQL summary action default body details items0 +swagger:model StartPTMySQLSummaryActionDefaultBodyDetailsItems0 +*/ +type StartPTMySQLSummaryActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start PT my SQL summary action default body details items0 +func (o *StartPTMySQLSummaryActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start PT my SQL summary action default body details items0 based on context it is used +func (o *StartPTMySQLSummaryActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartPTMySQLSummaryActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartPTMySQLSummaryActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartPTMySQLSummaryActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartPTMySQLSummaryActionOKBody Message to retrieve the prepared pt-mysql-summary data swagger:model StartPTMySQLSummaryActionOKBody */ @@ -244,6 +324,11 @@ func (o *StartPTMySQLSummaryActionOKBody) Validate(formats strfmt.Registry) erro return nil } +// ContextValidate validates this start PT my SQL summary action OK body based on context it is used +func (o *StartPTMySQLSummaryActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartPTMySQLSummaryActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_pt_pg_summary_action_parameters.go b/api/managementpb/json/client/actions/start_pt_pg_summary_action_parameters.go index b79ca29a18..035066ca98 100644 --- a/api/managementpb/json/client/actions/start_pt_pg_summary_action_parameters.go +++ b/api/managementpb/json/client/actions/start_pt_pg_summary_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartPTPgSummaryActionParams creates a new StartPTPgSummaryActionParams object -// with the default values initialized. +// NewStartPTPgSummaryActionParams creates a new StartPTPgSummaryActionParams 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 NewStartPTPgSummaryActionParams() *StartPTPgSummaryActionParams { - var () return &StartPTPgSummaryActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartPTPgSummaryActionParamsWithTimeout creates a new StartPTPgSummaryActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartPTPgSummaryActionParamsWithTimeout(timeout time.Duration) *StartPTPgSummaryActionParams { - var () return &StartPTPgSummaryActionParams{ - timeout: timeout, } } // NewStartPTPgSummaryActionParamsWithContext creates a new StartPTPgSummaryActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartPTPgSummaryActionParamsWithContext(ctx context.Context) *StartPTPgSummaryActionParams { - var () return &StartPTPgSummaryActionParams{ - Context: ctx, } } // NewStartPTPgSummaryActionParamsWithHTTPClient creates a new StartPTPgSummaryActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartPTPgSummaryActionParamsWithHTTPClient(client *http.Client) *StartPTPgSummaryActionParams { - var () return &StartPTPgSummaryActionParams{ HTTPClient: client, } } -/*StartPTPgSummaryActionParams contains all the parameters to send to the API endpoint -for the start PT pg summary action operation typically these are written to a http.Request +/* StartPTPgSummaryActionParams contains all the parameters to send to the API endpoint + for the start PT pg summary action operation. + + Typically these are written to a http.Request. */ type StartPTPgSummaryActionParams struct { - /*Body*/ + // Body. Body StartPTPgSummaryActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartPTPgSummaryActionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start PT pg summary action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartPTPgSummaryActionParams) WithDefaults() *StartPTPgSummaryActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start PT pg summary action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartPTPgSummaryActionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start PT pg summary action params func (o *StartPTPgSummaryActionParams) WithTimeout(timeout time.Duration) *StartPTPgSummaryActionParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartPTPgSummaryActionParams) WriteToRequest(r runtime.ClientRequest, r return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_pt_pg_summary_action_responses.go b/api/managementpb/json/client/actions/start_pt_pg_summary_action_responses.go index 8dff176c2e..71bcc9ce0b 100644 --- a/api/managementpb/json/client/actions/start_pt_pg_summary_action_responses.go +++ b/api/managementpb/json/client/actions/start_pt_pg_summary_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartPTPgSummaryActionOK() *StartPTPgSummaryActionOK { return &StartPTPgSummaryActionOK{} } -/*StartPTPgSummaryActionOK handles this case with default header values. +/* StartPTPgSummaryActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartPTPgSummaryActionOK struct { func (o *StartPTPgSummaryActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPTPgSummary][%d] startPtPgSummaryActionOk %+v", 200, o.Payload) } - func (o *StartPTPgSummaryActionOK) GetPayload() *StartPTPgSummaryActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartPTPgSummaryActionDefault(code int) *StartPTPgSummaryActionDefault { } } -/*StartPTPgSummaryActionDefault handles this case with default header values. +/* StartPTPgSummaryActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartPTPgSummaryActionDefault) Code() int { func (o *StartPTPgSummaryActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPTPgSummary][%d] StartPTPgSummaryAction default %+v", o._statusCode, o.Payload) } - func (o *StartPTPgSummaryActionDefault) GetPayload() *StartPTPgSummaryActionDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ func (o *StartPTPgSummaryActionBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this start PT pg summary action body based on context it is used +func (o *StartPTPgSummaryActionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartPTPgSummaryActionBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -167,7 +171,7 @@ type StartPTPgSummaryActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartPTPgSummaryActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start PT pg summary action default body @@ -185,7 +189,6 @@ func (o *StartPTPgSummaryActionDefaultBody) Validate(formats strfmt.Registry) er } func (o *StartPTPgSummaryActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *StartPTPgSummaryActionDefaultBody) validateDetails(formats strfmt.Regis if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartPTPgSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPTPgSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start PT pg summary action default body based on the context it is used +func (o *StartPTPgSummaryActionDefaultBody) 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 *StartPTPgSummaryActionDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartPTPgSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPTPgSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,6 +266,47 @@ func (o *StartPTPgSummaryActionDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*StartPTPgSummaryActionDefaultBodyDetailsItems0 start PT pg summary action default body details items0 +swagger:model StartPTPgSummaryActionDefaultBodyDetailsItems0 +*/ +type StartPTPgSummaryActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start PT pg summary action default body details items0 +func (o *StartPTPgSummaryActionDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start PT pg summary action default body details items0 based on context it is used +func (o *StartPTPgSummaryActionDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartPTPgSummaryActionDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartPTPgSummaryActionDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartPTPgSummaryActionDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*StartPTPgSummaryActionOKBody Message to retrieve the prepared pt-pg-summary data swagger:model StartPTPgSummaryActionOKBody */ @@ -244,6 +324,11 @@ func (o *StartPTPgSummaryActionOKBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this start PT pg summary action OK body based on context it is used +func (o *StartPTPgSummaryActionOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartPTPgSummaryActionOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/managementpb/json/client/actions/start_pt_summary_action_parameters.go b/api/managementpb/json/client/actions/start_pt_summary_action_parameters.go index 24103faed4..541723ad16 100644 --- a/api/managementpb/json/client/actions/start_pt_summary_action_parameters.go +++ b/api/managementpb/json/client/actions/start_pt_summary_action_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartPTSummaryActionParams creates a new StartPTSummaryActionParams object -// with the default values initialized. +// 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 { - var () return &StartPTSummaryActionParams{ - timeout: cr.DefaultTimeout, } } // NewStartPTSummaryActionParamsWithTimeout creates a new StartPTSummaryActionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartPTSummaryActionParamsWithTimeout(timeout time.Duration) *StartPTSummaryActionParams { - var () return &StartPTSummaryActionParams{ - timeout: timeout, } } // NewStartPTSummaryActionParamsWithContext creates a new StartPTSummaryActionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartPTSummaryActionParamsWithContext(ctx context.Context) *StartPTSummaryActionParams { - var () return &StartPTSummaryActionParams{ - Context: ctx, } } // NewStartPTSummaryActionParamsWithHTTPClient creates a new StartPTSummaryActionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartPTSummaryActionParamsWithHTTPClient(client *http.Client) *StartPTSummaryActionParams { - var () 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 +/* 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. Body StartPTSummaryActionBody timeout time.Duration @@ -68,6 +67,21 @@ type StartPTSummaryActionParams struct { 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) @@ -119,7 +133,6 @@ func (o *StartPTSummaryActionParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/actions/start_pt_summary_action_responses.go b/api/managementpb/json/client/actions/start_pt_summary_action_responses.go index 885834cc8a..0a4d832be8 100644 --- a/api/managementpb/json/client/actions/start_pt_summary_action_responses.go +++ b/api/managementpb/json/client/actions/start_pt_summary_action_responses.go @@ -6,6 +6,7 @@ package actions // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartPTSummaryActionOK() *StartPTSummaryActionOK { return &StartPTSummaryActionOK{} } -/*StartPTSummaryActionOK handles this case with default header values. +/* StartPTSummaryActionOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartPTSummaryActionOK struct { func (o *StartPTSummaryActionOK) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPTSummary][%d] startPtSummaryActionOk %+v", 200, o.Payload) } - func (o *StartPTSummaryActionOK) GetPayload() *StartPTSummaryActionOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartPTSummaryActionDefault(code int) *StartPTSummaryActionDefault { } } -/*StartPTSummaryActionDefault handles this case with default header values. +/* StartPTSummaryActionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartPTSummaryActionDefault) Code() int { func (o *StartPTSummaryActionDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Actions/StartPTSummary][%d] StartPTSummaryAction default %+v", o._statusCode, o.Payload) } - func (o *StartPTSummaryActionDefault) GetPayload() *StartPTSummaryActionDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ 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 { @@ -167,7 +171,7 @@ type StartPTSummaryActionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartPTSummaryActionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start PT summary action default body @@ -185,7 +189,6 @@ func (o *StartPTSummaryActionDefaultBody) Validate(formats strfmt.Registry) erro } func (o *StartPTSummaryActionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *StartPTSummaryActionDefaultBody) validateDetails(formats strfmt.Registr if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartPTSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartPTSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartPTSummaryAction default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,6 +266,47 @@ func (o *StartPTSummaryActionDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*StartPTSummaryActionDefaultBodyDetailsItems0 start PT summary action default body details items0 +swagger:model StartPTSummaryActionDefaultBodyDetailsItems0 +*/ +type StartPTSummaryActionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -244,6 +324,11 @@ 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 { diff --git a/api/managementpb/json/client/annotation/add_annotation_parameters.go b/api/managementpb/json/client/annotation/add_annotation_parameters.go index cb68517a42..621f238d80 100644 --- a/api/managementpb/json/client/annotation/add_annotation_parameters.go +++ b/api/managementpb/json/client/annotation/add_annotation_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddAnnotationParams creates a new AddAnnotationParams object -// with the default values initialized. +// 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 { - var () return &AddAnnotationParams{ - timeout: cr.DefaultTimeout, } } // NewAddAnnotationParamsWithTimeout creates a new AddAnnotationParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddAnnotationParamsWithTimeout(timeout time.Duration) *AddAnnotationParams { - var () return &AddAnnotationParams{ - timeout: timeout, } } // NewAddAnnotationParamsWithContext creates a new AddAnnotationParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddAnnotationParamsWithContext(ctx context.Context) *AddAnnotationParams { - var () return &AddAnnotationParams{ - Context: ctx, } } // NewAddAnnotationParamsWithHTTPClient creates a new AddAnnotationParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddAnnotationParamsWithHTTPClient(client *http.Client) *AddAnnotationParams { - var () 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 +/* 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*/ + // Body. Body AddAnnotationBody timeout time.Duration @@ -68,6 +67,21 @@ type AddAnnotationParams struct { 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) @@ -119,7 +133,6 @@ func (o *AddAnnotationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/annotation/add_annotation_responses.go b/api/managementpb/json/client/annotation/add_annotation_responses.go index ae1e029e11..ef6d4122a8 100644 --- a/api/managementpb/json/client/annotation/add_annotation_responses.go +++ b/api/managementpb/json/client/annotation/add_annotation_responses.go @@ -6,6 +6,7 @@ package annotation // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAddAnnotationOK() *AddAnnotationOK { return &AddAnnotationOK{} } -/*AddAnnotationOK handles this case with default header values. +/* AddAnnotationOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AddAnnotationOK struct { func (o *AddAnnotationOK) Error() string { return fmt.Sprintf("[POST /v1/management/Annotations/Add][%d] addAnnotationOk %+v", 200, o.Payload) } - func (o *AddAnnotationOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewAddAnnotationDefault(code int) *AddAnnotationDefault { } } -/*AddAnnotationDefault handles this case with default header values. +/* AddAnnotationDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *AddAnnotationDefault) Code() int { func (o *AddAnnotationDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Annotations/Add][%d] AddAnnotation default %+v", o._statusCode, o.Payload) } - func (o *AddAnnotationDefault) GetPayload() *AddAnnotationDefaultBody { return o.Payload } @@ -138,6 +137,11 @@ 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 { @@ -171,7 +175,7 @@ type AddAnnotationDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddAnnotationDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add annotation default body @@ -189,7 +193,6 @@ func (o *AddAnnotationDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddAnnotationDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -203,6 +206,42 @@ func (o *AddAnnotationDefaultBody) validateDetails(formats strfmt.Registry) erro if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddAnnotation default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -231,10 +270,10 @@ func (o *AddAnnotationDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*AddAnnotationDefaultBodyDetailsItems0 add annotation default body details items0 +swagger:model AddAnnotationDefaultBodyDetailsItems0 */ -type DetailsItems0 struct { +type AddAnnotationDefaultBodyDetailsItems0 struct { // type url TypeURL string `json:"type_url,omitempty"` @@ -244,13 +283,18 @@ type DetailsItems0 struct { Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// 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 *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddAnnotationDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -258,8 +302,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddAnnotationDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddAnnotationDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/annotation/annotation_client.go b/api/managementpb/json/client/annotation/annotation_client.go index 1c29b880d9..542184ed13 100644 --- a/api/managementpb/json/client/annotation/annotation_client.go +++ b/api/managementpb/json/client/annotation/annotation_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddAnnotation(params *AddAnnotationParams) (*AddAnnotationOK, error) + AddAnnotation(params *AddAnnotationParams, opts ...ClientOption) (*AddAnnotationOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { Adds annotation. */ -func (a *Client) AddAnnotation(params *AddAnnotationParams) (*AddAnnotationOK, error) { +func (a *Client) AddAnnotation(params *AddAnnotationParams, opts ...ClientOption) (*AddAnnotationOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddAnnotationParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddAnnotation", Method: "POST", PathPattern: "/v1/management/Annotations/Add", @@ -52,7 +54,12 @@ func (a *Client) AddAnnotation(params *AddAnnotationParams) (*AddAnnotationOK, e 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 } diff --git a/api/managementpb/json/client/external/add_external_parameters.go b/api/managementpb/json/client/external/add_external_parameters.go index 039a00d250..a761e68e2b 100644 --- a/api/managementpb/json/client/external/add_external_parameters.go +++ b/api/managementpb/json/client/external/add_external_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddExternalParams creates a new AddExternalParams object -// with the default values initialized. +// NewAddExternalParams creates a new AddExternalParams 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 NewAddExternalParams() *AddExternalParams { - var () return &AddExternalParams{ - timeout: cr.DefaultTimeout, } } // NewAddExternalParamsWithTimeout creates a new AddExternalParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddExternalParamsWithTimeout(timeout time.Duration) *AddExternalParams { - var () return &AddExternalParams{ - timeout: timeout, } } // NewAddExternalParamsWithContext creates a new AddExternalParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddExternalParamsWithContext(ctx context.Context) *AddExternalParams { - var () return &AddExternalParams{ - Context: ctx, } } // NewAddExternalParamsWithHTTPClient creates a new AddExternalParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddExternalParamsWithHTTPClient(client *http.Client) *AddExternalParams { - var () return &AddExternalParams{ HTTPClient: client, } } -/*AddExternalParams contains all the parameters to send to the API endpoint -for the add external operation typically these are written to a http.Request +/* AddExternalParams contains all the parameters to send to the API endpoint + for the add external operation. + + Typically these are written to a http.Request. */ type AddExternalParams struct { - /*Body*/ + // Body. Body AddExternalBody timeout time.Duration @@ -68,6 +67,21 @@ type AddExternalParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add external params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddExternalParams) WithDefaults() *AddExternalParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add external params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddExternalParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add external params func (o *AddExternalParams) WithTimeout(timeout time.Duration) *AddExternalParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddExternalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/external/add_external_responses.go b/api/managementpb/json/client/external/add_external_responses.go index fd7a292e3d..1254c88044 100644 --- a/api/managementpb/json/client/external/add_external_responses.go +++ b/api/managementpb/json/client/external/add_external_responses.go @@ -6,6 +6,7 @@ package external // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddExternalOK() *AddExternalOK { return &AddExternalOK{} } -/*AddExternalOK handles this case with default header values. +/* AddExternalOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddExternalOK struct { func (o *AddExternalOK) Error() string { return fmt.Sprintf("[POST /v1/management/External/Add][%d] addExternalOk %+v", 200, o.Payload) } - func (o *AddExternalOK) GetPayload() *AddExternalOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddExternalDefault(code int) *AddExternalDefault { } } -/*AddExternalDefault handles this case with default header values. +/* AddExternalDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddExternalDefault) Code() int { func (o *AddExternalDefault) Error() string { return fmt.Sprintf("[POST /v1/management/External/Add][%d] AddExternal default %+v", o._statusCode, o.Payload) } - func (o *AddExternalDefault) GetPayload() *AddExternalDefaultBody { return o.Payload } @@ -174,27 +173,27 @@ type AddExternalBody struct { // Group name of external service. Group string `json:"group,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // Enum: [AUTO PULL PUSH] - MetricsMode *string `json:"metrics_mode,omitempty"` - // Skip connection check. SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` // add node AddNode *AddExternalParamsBodyAddNode `json:"add_node,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // Enum: [AUTO PULL PUSH] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add external body func (o *AddExternalBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -204,6 +203,25 @@ func (o *AddExternalBody) Validate(formats strfmt.Registry) error { return nil } +func (o *AddExternalBody) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") + } + return err + } + } + + return nil +} + var addExternalBodyTypeMetricsModePropEnum []interface{} func init() { @@ -237,7 +255,6 @@ func (o *AddExternalBody) validateMetricsModeEnum(path, location string, value s } func (o *AddExternalBody) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required return nil } @@ -250,16 +267,28 @@ func (o *AddExternalBody) validateMetricsMode(formats strfmt.Registry) error { return nil } -func (o *AddExternalBody) validateAddNode(formats strfmt.Registry) error { +// ContextValidate validate this add external body based on the context it is used +func (o *AddExternalBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.AddNode) { // not required - return nil + if err := o.contextValidateAddNode(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) } + return nil +} + +func (o *AddExternalBody) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { + if err := o.AddNode.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") } return err } @@ -301,7 +330,7 @@ type AddExternalDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddExternalDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add external default body @@ -319,7 +348,6 @@ func (o *AddExternalDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddExternalDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -333,6 +361,42 @@ func (o *AddExternalDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddExternal default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddExternal default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add external default body based on the context it is used +func (o *AddExternalDefaultBody) 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 *AddExternalDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddExternal default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddExternal default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -361,6 +425,47 @@ func (o *AddExternalDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddExternalDefaultBodyDetailsItems0 add external default body details items0 +swagger:model AddExternalDefaultBodyDetailsItems0 +*/ +type AddExternalDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add external default body details items0 +func (o *AddExternalDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add external default body details items0 based on context it is used +func (o *AddExternalDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddExternalDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddExternalDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddExternalDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddExternalOKBody add external OK body swagger:model AddExternalOKBody */ @@ -392,7 +497,6 @@ func (o *AddExternalOKBody) Validate(formats strfmt.Registry) error { } func (o *AddExternalOKBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required return nil } @@ -401,6 +505,8 @@ func (o *AddExternalOKBody) validateExternalExporter(formats strfmt.Registry) er if err := o.ExternalExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addExternalOk" + "." + "external_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addExternalOk" + "." + "external_exporter") } return err } @@ -410,7 +516,6 @@ func (o *AddExternalOKBody) validateExternalExporter(formats strfmt.Registry) er } func (o *AddExternalOKBody) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required return nil } @@ -419,6 +524,58 @@ func (o *AddExternalOKBody) validateService(formats strfmt.Registry) error { if err := o.Service.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addExternalOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addExternalOk" + "." + "service") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add external OK body based on the context it is used +func (o *AddExternalOKBody) 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 *AddExternalOKBody) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.ExternalExporter != nil { + if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addExternalOk" + "." + "external_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addExternalOk" + "." + "external_exporter") + } + return err + } + } + + return nil +} + +func (o *AddExternalOKBody) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + + if o.Service != nil { + if err := o.Service.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addExternalOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addExternalOk" + "." + "service") } return err } @@ -486,6 +643,11 @@ func (o *AddExternalOKBodyExternalExporter) Validate(formats strfmt.Registry) er return nil } +// ContextValidate validates this add external OK body external exporter based on context it is used +func (o *AddExternalOKBodyExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddExternalOKBodyExternalExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -539,6 +701,11 @@ func (o *AddExternalOKBodyService) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add external OK body service based on context it is used +func (o *AddExternalOKBodyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddExternalOKBodyService) MarshalBinary() ([]byte, error) { if o == nil { @@ -562,10 +729,6 @@ swagger:model AddExternalParamsBodyAddNode */ type AddExternalParamsBodyAddNode struct { - // NodeType describes supported Node types. - // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] - NodeType *string `json:"node_type,omitempty"` - // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -592,6 +755,10 @@ type AddExternalParamsBodyAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add external params body add node @@ -650,7 +817,6 @@ func (o *AddExternalParamsBodyAddNode) validateNodeTypeEnum(path, location strin } func (o *AddExternalParamsBodyAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required return nil } @@ -663,44 +829,13 @@ func (o *AddExternalParamsBodyAddNode) validateNodeType(formats strfmt.Registry) return nil } -// MarshalBinary interface implementation -func (o *AddExternalParamsBodyAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddExternalParamsBodyAddNode) UnmarshalBinary(b []byte) error { - var res AddExternalParamsBodyAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add external params body add node based on context it is used +func (o *AddExternalParamsBodyAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddExternalParamsBodyAddNode) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -708,8 +843,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddExternalParamsBodyAddNode) UnmarshalBinary(b []byte) error { + var res AddExternalParamsBodyAddNode if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/external/external_client.go b/api/managementpb/json/client/external/external_client.go index 2cfcc95760..1c86edcf93 100644 --- a/api/managementpb/json/client/external/external_client.go +++ b/api/managementpb/json/client/external/external_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddExternal(params *AddExternalParams) (*AddExternalOK, error) + AddExternal(params *AddExternalParams, opts ...ClientOption) (*AddExternalOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { Adds external service and adds external exporter. It automatically adds a service to inventory, which is running on provided "node_id", then adds an "external exporter" agent to inventory, which is running on provided "runs_on_node_id". */ -func (a *Client) AddExternal(params *AddExternalParams) (*AddExternalOK, error) { +func (a *Client) AddExternal(params *AddExternalParams, opts ...ClientOption) (*AddExternalOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddExternalParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddExternal", Method: "POST", PathPattern: "/v1/management/External/Add", @@ -52,7 +54,12 @@ func (a *Client) AddExternal(params *AddExternalParams) (*AddExternalOK, error) Reader: &AddExternalReader{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 } diff --git a/api/managementpb/json/client/ha_proxy/add_ha_proxy_parameters.go b/api/managementpb/json/client/ha_proxy/add_ha_proxy_parameters.go index aa94c2395b..ac96b51246 100644 --- a/api/managementpb/json/client/ha_proxy/add_ha_proxy_parameters.go +++ b/api/managementpb/json/client/ha_proxy/add_ha_proxy_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddHAProxyParams creates a new AddHAProxyParams object -// with the default values initialized. +// NewAddHAProxyParams creates a new AddHAProxyParams 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 NewAddHAProxyParams() *AddHAProxyParams { - var () return &AddHAProxyParams{ - timeout: cr.DefaultTimeout, } } // NewAddHAProxyParamsWithTimeout creates a new AddHAProxyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddHAProxyParamsWithTimeout(timeout time.Duration) *AddHAProxyParams { - var () return &AddHAProxyParams{ - timeout: timeout, } } // NewAddHAProxyParamsWithContext creates a new AddHAProxyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddHAProxyParamsWithContext(ctx context.Context) *AddHAProxyParams { - var () return &AddHAProxyParams{ - Context: ctx, } } // NewAddHAProxyParamsWithHTTPClient creates a new AddHAProxyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddHAProxyParamsWithHTTPClient(client *http.Client) *AddHAProxyParams { - var () return &AddHAProxyParams{ HTTPClient: client, } } -/*AddHAProxyParams contains all the parameters to send to the API endpoint -for the add HA proxy operation typically these are written to a http.Request +/* AddHAProxyParams contains all the parameters to send to the API endpoint + for the add HA proxy operation. + + Typically these are written to a http.Request. */ type AddHAProxyParams struct { - /*Body*/ + // Body. Body AddHAProxyBody timeout time.Duration @@ -68,6 +67,21 @@ type AddHAProxyParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add HA proxy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddHAProxyParams) WithDefaults() *AddHAProxyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add HA proxy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddHAProxyParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add HA proxy params func (o *AddHAProxyParams) WithTimeout(timeout time.Duration) *AddHAProxyParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddHAProxyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/ha_proxy/add_ha_proxy_responses.go b/api/managementpb/json/client/ha_proxy/add_ha_proxy_responses.go index 3360444af4..fb8cb285a1 100644 --- a/api/managementpb/json/client/ha_proxy/add_ha_proxy_responses.go +++ b/api/managementpb/json/client/ha_proxy/add_ha_proxy_responses.go @@ -6,6 +6,7 @@ package ha_proxy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddHAProxyOK() *AddHAProxyOK { return &AddHAProxyOK{} } -/*AddHAProxyOK handles this case with default header values. +/* AddHAProxyOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddHAProxyOK struct { func (o *AddHAProxyOK) Error() string { return fmt.Sprintf("[POST /v1/management/HAProxy/Add][%d] addHaProxyOk %+v", 200, o.Payload) } - func (o *AddHAProxyOK) GetPayload() *AddHAProxyOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddHAProxyDefault(code int) *AddHAProxyDefault { } } -/*AddHAProxyDefault handles this case with default header values. +/* AddHAProxyDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddHAProxyDefault) Code() int { func (o *AddHAProxyDefault) Error() string { return fmt.Sprintf("[POST /v1/management/HAProxy/Add][%d] AddHAProxy default %+v", o._statusCode, o.Payload) } - func (o *AddHAProxyDefault) GetPayload() *AddHAProxyDefaultBody { return o.Payload } @@ -166,27 +165,27 @@ type AddHAProxyBody struct { // Custom user-assigned labels for Service. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // Enum: [AUTO PULL PUSH] - MetricsMode *string `json:"metrics_mode,omitempty"` - // Skip connection check. SkipConnectionCheck bool `json:"skip_connection_check,omitempty"` // add node AddNode *AddHAProxyParamsBodyAddNode `json:"add_node,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // Enum: [AUTO PULL PUSH] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add HA proxy body func (o *AddHAProxyBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -196,6 +195,25 @@ func (o *AddHAProxyBody) Validate(formats strfmt.Registry) error { return nil } +func (o *AddHAProxyBody) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") + } + return err + } + } + + return nil +} + var addHaProxyBodyTypeMetricsModePropEnum []interface{} func init() { @@ -229,7 +247,6 @@ func (o *AddHAProxyBody) validateMetricsModeEnum(path, location string, value st } func (o *AddHAProxyBody) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required return nil } @@ -242,16 +259,28 @@ func (o *AddHAProxyBody) validateMetricsMode(formats strfmt.Registry) error { return nil } -func (o *AddHAProxyBody) validateAddNode(formats strfmt.Registry) error { +// ContextValidate validate this add HA proxy body based on the context it is used +func (o *AddHAProxyBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.AddNode) { // not required - return nil + if err := o.contextValidateAddNode(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) } + return nil +} + +func (o *AddHAProxyBody) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { + if err := o.AddNode.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") } return err } @@ -293,7 +322,7 @@ type AddHAProxyDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddHAProxyDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add HA proxy default body @@ -311,7 +340,6 @@ func (o *AddHAProxyDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddHAProxyDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -325,6 +353,42 @@ func (o *AddHAProxyDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddHAProxy default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddHAProxy default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add HA proxy default body based on the context it is used +func (o *AddHAProxyDefaultBody) 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 *AddHAProxyDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddHAProxy default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddHAProxy default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -353,6 +417,47 @@ func (o *AddHAProxyDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddHAProxyDefaultBodyDetailsItems0 add HA proxy default body details items0 +swagger:model AddHAProxyDefaultBodyDetailsItems0 +*/ +type AddHAProxyDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add HA proxy default body details items0 +func (o *AddHAProxyDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add HA proxy default body details items0 based on context it is used +func (o *AddHAProxyDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddHAProxyDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddHAProxyDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddHAProxyDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddHAProxyOKBody add HA proxy OK body swagger:model AddHAProxyOKBody */ @@ -384,7 +489,6 @@ func (o *AddHAProxyOKBody) Validate(formats strfmt.Registry) error { } func (o *AddHAProxyOKBody) validateExternalExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ExternalExporter) { // not required return nil } @@ -393,6 +497,8 @@ func (o *AddHAProxyOKBody) validateExternalExporter(formats strfmt.Registry) err if err := o.ExternalExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addHaProxyOk" + "." + "external_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addHaProxyOk" + "." + "external_exporter") } return err } @@ -402,7 +508,6 @@ func (o *AddHAProxyOKBody) validateExternalExporter(formats strfmt.Registry) err } func (o *AddHAProxyOKBody) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required return nil } @@ -411,6 +516,58 @@ func (o *AddHAProxyOKBody) validateService(formats strfmt.Registry) error { if err := o.Service.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addHaProxyOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addHaProxyOk" + "." + "service") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add HA proxy OK body based on the context it is used +func (o *AddHAProxyOKBody) 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 *AddHAProxyOKBody) contextValidateExternalExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.ExternalExporter != nil { + if err := o.ExternalExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addHaProxyOk" + "." + "external_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addHaProxyOk" + "." + "external_exporter") + } + return err + } + } + + return nil +} + +func (o *AddHAProxyOKBody) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + + if o.Service != nil { + if err := o.Service.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addHaProxyOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addHaProxyOk" + "." + "service") } return err } @@ -478,6 +635,11 @@ func (o *AddHAProxyOKBodyExternalExporter) Validate(formats strfmt.Registry) err return nil } +// ContextValidate validates this add HA proxy OK body external exporter based on context it is used +func (o *AddHAProxyOKBodyExternalExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddHAProxyOKBodyExternalExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -528,6 +690,11 @@ func (o *AddHAProxyOKBodyService) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add HA proxy OK body service based on context it is used +func (o *AddHAProxyOKBodyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddHAProxyOKBodyService) MarshalBinary() ([]byte, error) { if o == nil { @@ -551,10 +718,6 @@ swagger:model AddHAProxyParamsBodyAddNode */ type AddHAProxyParamsBodyAddNode struct { - // NodeType describes supported Node types. - // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] - NodeType *string `json:"node_type,omitempty"` - // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -581,6 +744,10 @@ type AddHAProxyParamsBodyAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add HA proxy params body add node @@ -639,7 +806,6 @@ func (o *AddHAProxyParamsBodyAddNode) validateNodeTypeEnum(path, location string } func (o *AddHAProxyParamsBodyAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required return nil } @@ -652,44 +818,13 @@ func (o *AddHAProxyParamsBodyAddNode) validateNodeType(formats strfmt.Registry) return nil } -// MarshalBinary interface implementation -func (o *AddHAProxyParamsBodyAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddHAProxyParamsBodyAddNode) UnmarshalBinary(b []byte) error { - var res AddHAProxyParamsBodyAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add HA proxy params body add node based on context it is used +func (o *AddHAProxyParamsBodyAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddHAProxyParamsBodyAddNode) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -697,8 +832,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddHAProxyParamsBodyAddNode) UnmarshalBinary(b []byte) error { + var res AddHAProxyParamsBodyAddNode if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/ha_proxy/ha_proxy_client.go b/api/managementpb/json/client/ha_proxy/ha_proxy_client.go index 026d8e5b4d..43d6ab1b3b 100644 --- a/api/managementpb/json/client/ha_proxy/ha_proxy_client.go +++ b/api/managementpb/json/client/ha_proxy/ha_proxy_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddHAProxy(params *AddHAProxyParams) (*AddHAProxyOK, error) + AddHAProxy(params *AddHAProxyParams, opts ...ClientOption) (*AddHAProxyOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { Adds HAProxy service and external exporter. It automatically adds a service to inventory, which is running on the provided "node_id", then adds an "external exporter" agent to the inventory. */ -func (a *Client) AddHAProxy(params *AddHAProxyParams) (*AddHAProxyOK, error) { +func (a *Client) AddHAProxy(params *AddHAProxyParams, opts ...ClientOption) (*AddHAProxyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddHAProxyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddHAProxy", Method: "POST", PathPattern: "/v1/management/HAProxy/Add", @@ -52,7 +54,12 @@ func (a *Client) AddHAProxy(params *AddHAProxyParams) (*AddHAProxyOK, error) { Reader: &AddHAProxyReader{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 } diff --git a/api/managementpb/json/client/mongo_db/add_mongo_db_parameters.go b/api/managementpb/json/client/mongo_db/add_mongo_db_parameters.go index a12e131d0f..b0ca73e6c2 100644 --- a/api/managementpb/json/client/mongo_db/add_mongo_db_parameters.go +++ b/api/managementpb/json/client/mongo_db/add_mongo_db_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddMongoDBParams creates a new AddMongoDBParams object -// with the default values initialized. +// NewAddMongoDBParams creates a new AddMongoDBParams 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 NewAddMongoDBParams() *AddMongoDBParams { - var () return &AddMongoDBParams{ - timeout: cr.DefaultTimeout, } } // NewAddMongoDBParamsWithTimeout creates a new AddMongoDBParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddMongoDBParamsWithTimeout(timeout time.Duration) *AddMongoDBParams { - var () return &AddMongoDBParams{ - timeout: timeout, } } // NewAddMongoDBParamsWithContext creates a new AddMongoDBParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddMongoDBParamsWithContext(ctx context.Context) *AddMongoDBParams { - var () return &AddMongoDBParams{ - Context: ctx, } } // NewAddMongoDBParamsWithHTTPClient creates a new AddMongoDBParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddMongoDBParamsWithHTTPClient(client *http.Client) *AddMongoDBParams { - var () return &AddMongoDBParams{ HTTPClient: client, } } -/*AddMongoDBParams contains all the parameters to send to the API endpoint -for the add mongo DB operation typically these are written to a http.Request +/* AddMongoDBParams contains all the parameters to send to the API endpoint + for the add mongo DB operation. + + Typically these are written to a http.Request. */ type AddMongoDBParams struct { - /*Body*/ + // Body. Body AddMongoDBBody timeout time.Duration @@ -68,6 +67,21 @@ type AddMongoDBParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add mongo DB params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMongoDBParams) WithDefaults() *AddMongoDBParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add mongo DB params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMongoDBParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add mongo DB params func (o *AddMongoDBParams) WithTimeout(timeout time.Duration) *AddMongoDBParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddMongoDBParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/mongo_db/add_mongo_db_responses.go b/api/managementpb/json/client/mongo_db/add_mongo_db_responses.go index ad999e063f..0952a8db52 100644 --- a/api/managementpb/json/client/mongo_db/add_mongo_db_responses.go +++ b/api/managementpb/json/client/mongo_db/add_mongo_db_responses.go @@ -6,6 +6,7 @@ package mongo_db // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddMongoDBOK() *AddMongoDBOK { return &AddMongoDBOK{} } -/*AddMongoDBOK handles this case with default header values. +/* AddMongoDBOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddMongoDBOK struct { func (o *AddMongoDBOK) Error() string { return fmt.Sprintf("[POST /v1/management/MongoDB/Add][%d] addMongoDbOk %+v", 200, o.Payload) } - func (o *AddMongoDBOK) GetPayload() *AddMongoDBOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddMongoDBDefault(code int) *AddMongoDBDefault { } } -/*AddMongoDBDefault handles this case with default header values. +/* AddMongoDBDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddMongoDBDefault) Code() int { func (o *AddMongoDBDefault) Error() string { return fmt.Sprintf("[POST /v1/management/MongoDB/Add][%d] AddMongoDB default %+v", o._statusCode, o.Payload) } - func (o *AddMongoDBDefault) GetPayload() *AddMongoDBDefaultBody { return o.Payload } @@ -189,11 +188,6 @@ type AddMongoDBBody struct { // Certificate Authority certificate chain. TLSCa string `json:"tls_ca,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // Enum: [AUTO PULL PUSH] - MetricsMode *string `json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` @@ -220,17 +214,22 @@ type AddMongoDBBody struct { // add node AddNode *AddMongoDBParamsBodyAddNode `json:"add_node,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // Enum: [AUTO PULL PUSH] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add mongo DB body func (o *AddMongoDBBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -240,6 +239,25 @@ func (o *AddMongoDBBody) Validate(formats strfmt.Registry) error { return nil } +func (o *AddMongoDBBody) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") + } + return err + } + } + + return nil +} + var addMongoDbBodyTypeMetricsModePropEnum []interface{} func init() { @@ -273,7 +291,6 @@ func (o *AddMongoDBBody) validateMetricsModeEnum(path, location string, value st } func (o *AddMongoDBBody) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required return nil } @@ -286,16 +303,28 @@ func (o *AddMongoDBBody) validateMetricsMode(formats strfmt.Registry) error { return nil } -func (o *AddMongoDBBody) validateAddNode(formats strfmt.Registry) error { +// ContextValidate validate this add mongo DB body based on the context it is used +func (o *AddMongoDBBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.AddNode) { // not required - return nil + if err := o.contextValidateAddNode(ctx, formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddMongoDBBody) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { + if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { + if err := o.AddNode.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") } return err } @@ -337,7 +366,7 @@ type AddMongoDBDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddMongoDBDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add mongo DB default body @@ -355,7 +384,6 @@ func (o *AddMongoDBDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddMongoDBDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -369,6 +397,42 @@ func (o *AddMongoDBDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddMongoDB default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMongoDB default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add mongo DB default body based on the context it is used +func (o *AddMongoDBDefaultBody) 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 *AddMongoDBDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddMongoDB default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMongoDB default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -397,6 +461,47 @@ func (o *AddMongoDBDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddMongoDBDefaultBodyDetailsItems0 add mongo DB default body details items0 +swagger:model AddMongoDBDefaultBodyDetailsItems0 +*/ +type AddMongoDBDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add mongo DB default body details items0 +func (o *AddMongoDBDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add mongo DB default body details items0 based on context it is used +func (o *AddMongoDBDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddMongoDBDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddMongoDBDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddMongoDBDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddMongoDBOKBody add mongo DB OK body swagger:model AddMongoDBOKBody */ @@ -435,7 +540,6 @@ func (o *AddMongoDBOKBody) Validate(formats strfmt.Registry) error { } func (o *AddMongoDBOKBody) validateMongodbExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MongodbExporter) { // not required return nil } @@ -444,6 +548,8 @@ func (o *AddMongoDBOKBody) validateMongodbExporter(formats strfmt.Registry) erro if err := o.MongodbExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMongoDbOk" + "." + "mongodb_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMongoDbOk" + "." + "mongodb_exporter") } return err } @@ -453,7 +559,6 @@ func (o *AddMongoDBOKBody) validateMongodbExporter(formats strfmt.Registry) erro } func (o *AddMongoDBOKBody) validateQANMongodbProfiler(formats strfmt.Registry) error { - if swag.IsZero(o.QANMongodbProfiler) { // not required return nil } @@ -462,6 +567,8 @@ func (o *AddMongoDBOKBody) validateQANMongodbProfiler(formats strfmt.Registry) e if err := o.QANMongodbProfiler.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMongoDbOk" + "." + "qan_mongodb_profiler") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMongoDbOk" + "." + "qan_mongodb_profiler") } return err } @@ -471,7 +578,6 @@ func (o *AddMongoDBOKBody) validateQANMongodbProfiler(formats strfmt.Registry) e } func (o *AddMongoDBOKBody) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required return nil } @@ -480,6 +586,78 @@ func (o *AddMongoDBOKBody) validateService(formats strfmt.Registry) error { if err := o.Service.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMongoDbOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMongoDbOk" + "." + "service") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add mongo DB OK body based on the context it is used +func (o *AddMongoDBOKBody) 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.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 *AddMongoDBOKBody) contextValidateMongodbExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.MongodbExporter != nil { + if err := o.MongodbExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMongoDbOk" + "." + "mongodb_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMongoDbOk" + "." + "mongodb_exporter") + } + return err + } + } + + return nil +} + +func (o *AddMongoDBOKBody) contextValidateQANMongodbProfiler(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMongodbProfiler != nil { + if err := o.QANMongodbProfiler.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMongoDbOk" + "." + "qan_mongodb_profiler") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMongoDbOk" + "." + "qan_mongodb_profiler") + } + return err + } + } + + return nil +} + +func (o *AddMongoDBOKBody) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + + if o.Service != nil { + if err := o.Service.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMongoDbOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMongoDbOk" + "." + "service") } return err } @@ -541,17 +719,6 @@ type AddMongoDBOKBodyMongodbExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics. ListenPort int64 `json:"listen_port,omitempty"` @@ -564,6 +731,17 @@ type AddMongoDBOKBodyMongodbExporter struct { // Enable All collectors. EnableAllCollectors bool `json:"enable_all_collectors,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,omitempty"` } // Validate validates this add mongo DB OK body mongodb exporter @@ -625,7 +803,6 @@ func (o *AddMongoDBOKBodyMongodbExporter) validateStatusEnum(path, location stri } func (o *AddMongoDBOKBodyMongodbExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -638,6 +815,11 @@ func (o *AddMongoDBOKBodyMongodbExporter) validateStatus(formats strfmt.Registry return nil } +// ContextValidate validates this add mongo DB OK body mongodb exporter based on context it is used +func (o *AddMongoDBOKBodyMongodbExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMongoDBOKBodyMongodbExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -756,7 +938,6 @@ func (o *AddMongoDBOKBodyQANMongodbProfiler) validateStatusEnum(path, location s } func (o *AddMongoDBOKBodyQANMongodbProfiler) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -769,6 +950,11 @@ func (o *AddMongoDBOKBodyQANMongodbProfiler) validateStatus(formats strfmt.Regis return nil } +// ContextValidate validates this add mongo DB OK body QAN mongodb profiler based on context it is used +func (o *AddMongoDBOKBodyQANMongodbProfiler) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMongoDBOKBodyQANMongodbProfiler) MarshalBinary() ([]byte, error) { if o == nil { @@ -831,6 +1017,11 @@ func (o *AddMongoDBOKBodyService) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add mongo DB OK body service based on context it is used +func (o *AddMongoDBOKBodyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMongoDBOKBodyService) MarshalBinary() ([]byte, error) { if o == nil { @@ -854,10 +1045,6 @@ swagger:model AddMongoDBParamsBodyAddNode */ type AddMongoDBParamsBodyAddNode struct { - // NodeType describes supported Node types. - // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] - NodeType *string `json:"node_type,omitempty"` - // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -884,6 +1071,10 @@ type AddMongoDBParamsBodyAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add mongo DB params body add node @@ -942,7 +1133,6 @@ func (o *AddMongoDBParamsBodyAddNode) validateNodeTypeEnum(path, location string } func (o *AddMongoDBParamsBodyAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required return nil } @@ -955,44 +1145,13 @@ func (o *AddMongoDBParamsBodyAddNode) validateNodeType(formats strfmt.Registry) return nil } -// MarshalBinary interface implementation -func (o *AddMongoDBParamsBodyAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddMongoDBParamsBodyAddNode) UnmarshalBinary(b []byte) error { - var res AddMongoDBParamsBodyAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add mongo DB params body add node based on context it is used +func (o *AddMongoDBParamsBodyAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddMongoDBParamsBodyAddNode) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1000,8 +1159,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddMongoDBParamsBodyAddNode) UnmarshalBinary(b []byte) error { + var res AddMongoDBParamsBodyAddNode if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/mongo_db/mongo_db_client.go b/api/managementpb/json/client/mongo_db/mongo_db_client.go index b95c883de6..55a01fa449 100644 --- a/api/managementpb/json/client/mongo_db/mongo_db_client.go +++ b/api/managementpb/json/client/mongo_db/mongo_db_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddMongoDB(params *AddMongoDBParams) (*AddMongoDBOK, error) + AddMongoDB(params *AddMongoDBParams, opts ...ClientOption) (*AddMongoDBOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { Adds MongoDB Service and starts several Agents. It automatically adds a service to inventory, which is running on the provided "node_id", then adds "mongodb_exporter", and "qan_mongodb_profiler" agents with the provided "pmm_agent_id" and other parameters. */ -func (a *Client) AddMongoDB(params *AddMongoDBParams) (*AddMongoDBOK, error) { +func (a *Client) AddMongoDB(params *AddMongoDBParams, opts ...ClientOption) (*AddMongoDBOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddMongoDBParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddMongoDB", Method: "POST", PathPattern: "/v1/management/MongoDB/Add", @@ -52,7 +54,12 @@ func (a *Client) AddMongoDB(params *AddMongoDBParams) (*AddMongoDBOK, error) { Reader: &AddMongoDBReader{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 } diff --git a/api/managementpb/json/client/my_sql/add_my_sql_parameters.go b/api/managementpb/json/client/my_sql/add_my_sql_parameters.go index e2ad0c9bec..95730e6c34 100644 --- a/api/managementpb/json/client/my_sql/add_my_sql_parameters.go +++ b/api/managementpb/json/client/my_sql/add_my_sql_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddMySQLParams creates a new AddMySQLParams object -// with the default values initialized. +// NewAddMySQLParams creates a new AddMySQLParams 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 NewAddMySQLParams() *AddMySQLParams { - var () return &AddMySQLParams{ - timeout: cr.DefaultTimeout, } } // NewAddMySQLParamsWithTimeout creates a new AddMySQLParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddMySQLParamsWithTimeout(timeout time.Duration) *AddMySQLParams { - var () return &AddMySQLParams{ - timeout: timeout, } } // NewAddMySQLParamsWithContext creates a new AddMySQLParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddMySQLParamsWithContext(ctx context.Context) *AddMySQLParams { - var () return &AddMySQLParams{ - Context: ctx, } } // NewAddMySQLParamsWithHTTPClient creates a new AddMySQLParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddMySQLParamsWithHTTPClient(client *http.Client) *AddMySQLParams { - var () return &AddMySQLParams{ HTTPClient: client, } } -/*AddMySQLParams contains all the parameters to send to the API endpoint -for the add my SQL operation typically these are written to a http.Request +/* AddMySQLParams contains all the parameters to send to the API endpoint + for the add my SQL operation. + + Typically these are written to a http.Request. */ type AddMySQLParams struct { - /*Body*/ + // Body. Body AddMySQLBody timeout time.Duration @@ -68,6 +67,21 @@ type AddMySQLParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add my SQL params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMySQLParams) WithDefaults() *AddMySQLParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add my SQL params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddMySQLParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add my SQL params func (o *AddMySQLParams) WithTimeout(timeout time.Duration) *AddMySQLParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddMySQLParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/my_sql/add_my_sql_responses.go b/api/managementpb/json/client/my_sql/add_my_sql_responses.go index 1a0b5ac7eb..a656dc39fb 100644 --- a/api/managementpb/json/client/my_sql/add_my_sql_responses.go +++ b/api/managementpb/json/client/my_sql/add_my_sql_responses.go @@ -6,6 +6,7 @@ package my_sql // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddMySQLOK() *AddMySQLOK { return &AddMySQLOK{} } -/*AddMySQLOK handles this case with default header values. +/* AddMySQLOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddMySQLOK struct { func (o *AddMySQLOK) Error() string { return fmt.Sprintf("[POST /v1/management/MySQL/Add][%d] addMySqlOk %+v", 200, o.Payload) } - func (o *AddMySQLOK) GetPayload() *AddMySQLOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddMySQLDefault(code int) *AddMySQLDefault { } } -/*AddMySQLDefault handles this case with default header values. +/* AddMySQLDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddMySQLDefault) Code() int { func (o *AddMySQLDefault) Error() string { return fmt.Sprintf("[POST /v1/management/MySQL/Add][%d] AddMySQL default %+v", o._statusCode, o.Payload) } - func (o *AddMySQLDefault) GetPayload() *AddMySQLDefaultBody { return o.Payload } @@ -205,11 +204,6 @@ type AddMySQLBody struct { // Use negative value to disable them. TablestatsGroupTableLimit int32 `json:"tablestats_group_table_limit,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // Enum: [AUTO PULL PUSH] - MetricsMode *string `json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` @@ -218,17 +212,22 @@ type AddMySQLBody struct { // add node AddNode *AddMySQLParamsBodyAddNode `json:"add_node,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // Enum: [AUTO PULL PUSH] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add my SQL body func (o *AddMySQLBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -238,6 +237,25 @@ func (o *AddMySQLBody) Validate(formats strfmt.Registry) error { return nil } +func (o *AddMySQLBody) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") + } + return err + } + } + + return nil +} + var addMySqlBodyTypeMetricsModePropEnum []interface{} func init() { @@ -271,7 +289,6 @@ func (o *AddMySQLBody) validateMetricsModeEnum(path, location string, value stri } func (o *AddMySQLBody) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required return nil } @@ -284,16 +301,28 @@ func (o *AddMySQLBody) validateMetricsMode(formats strfmt.Registry) error { return nil } -func (o *AddMySQLBody) validateAddNode(formats strfmt.Registry) error { +// ContextValidate validate this add my SQL body based on the context it is used +func (o *AddMySQLBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.AddNode) { // not required - return nil + if err := o.contextValidateAddNode(ctx, formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddMySQLBody) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { + if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { + if err := o.AddNode.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") } return err } @@ -335,7 +364,7 @@ type AddMySQLDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddMySQLDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add my SQL default body @@ -353,7 +382,6 @@ func (o *AddMySQLDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddMySQLDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -367,6 +395,42 @@ func (o *AddMySQLDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddMySQL default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMySQL default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add my SQL default body based on the context it is used +func (o *AddMySQLDefaultBody) 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 *AddMySQLDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddMySQL default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddMySQL default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -395,6 +459,47 @@ func (o *AddMySQLDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddMySQLDefaultBodyDetailsItems0 add my SQL default body details items0 +swagger:model AddMySQLDefaultBodyDetailsItems0 +*/ +type AddMySQLDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add my SQL default body details items0 +func (o *AddMySQLDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add my SQL default body details items0 based on context it is used +func (o *AddMySQLDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddMySQLDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddMySQLDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddMySQLDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddMySQLOKBody add my SQL OK body swagger:model AddMySQLOKBody */ @@ -443,7 +548,6 @@ func (o *AddMySQLOKBody) Validate(formats strfmt.Registry) error { } func (o *AddMySQLOKBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required return nil } @@ -452,6 +556,8 @@ func (o *AddMySQLOKBody) validateMysqldExporter(formats strfmt.Registry) error { if err := o.MysqldExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMySqlOk" + "." + "mysqld_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySqlOk" + "." + "mysqld_exporter") } return err } @@ -461,7 +567,6 @@ func (o *AddMySQLOKBody) validateMysqldExporter(formats strfmt.Registry) error { } func (o *AddMySQLOKBody) validateQANMysqlPerfschema(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschema) { // not required return nil } @@ -470,6 +575,8 @@ func (o *AddMySQLOKBody) validateQANMysqlPerfschema(formats strfmt.Registry) err if err := o.QANMysqlPerfschema.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMySqlOk" + "." + "qan_mysql_perfschema") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySqlOk" + "." + "qan_mysql_perfschema") } return err } @@ -479,7 +586,6 @@ func (o *AddMySQLOKBody) validateQANMysqlPerfschema(formats strfmt.Registry) err } func (o *AddMySQLOKBody) validateQANMysqlSlowlog(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlSlowlog) { // not required return nil } @@ -488,6 +594,8 @@ func (o *AddMySQLOKBody) validateQANMysqlSlowlog(formats strfmt.Registry) error if err := o.QANMysqlSlowlog.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMySqlOk" + "." + "qan_mysql_slowlog") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySqlOk" + "." + "qan_mysql_slowlog") } return err } @@ -497,7 +605,6 @@ func (o *AddMySQLOKBody) validateQANMysqlSlowlog(formats strfmt.Registry) error } func (o *AddMySQLOKBody) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required return nil } @@ -506,6 +613,98 @@ func (o *AddMySQLOKBody) validateService(formats strfmt.Registry) error { if err := o.Service.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addMySqlOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySqlOk" + "." + "service") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add my SQL OK body based on the context it is used +func (o *AddMySQLOKBody) 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 *AddMySQLOKBody) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.MysqldExporter != nil { + if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMySqlOk" + "." + "mysqld_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySqlOk" + "." + "mysqld_exporter") + } + return err + } + } + + return nil +} + +func (o *AddMySQLOKBody) contextValidateQANMysqlPerfschema(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMysqlPerfschema != nil { + if err := o.QANMysqlPerfschema.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMySqlOk" + "." + "qan_mysql_perfschema") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySqlOk" + "." + "qan_mysql_perfschema") + } + return err + } + } + + return nil +} + +func (o *AddMySQLOKBody) contextValidateQANMysqlSlowlog(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMysqlSlowlog != nil { + if err := o.QANMysqlSlowlog.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMySqlOk" + "." + "qan_mysql_slowlog") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySqlOk" + "." + "qan_mysql_slowlog") + } + return err + } + } + + return nil +} + +func (o *AddMySQLOKBody) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + + if o.Service != nil { + if err := o.Service.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addMySqlOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addMySqlOk" + "." + "service") } return err } @@ -581,6 +780,12 @@ type AddMySQLOKBodyMysqldExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // 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"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -591,12 +796,6 @@ type AddMySQLOKBodyMysqldExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` } // Validate validates this add my SQL OK body mysqld exporter @@ -658,7 +857,6 @@ func (o *AddMySQLOKBodyMysqldExporter) validateStatusEnum(path, location string, } func (o *AddMySQLOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -671,6 +869,11 @@ func (o *AddMySQLOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) e return nil } +// ContextValidate validates this add my SQL OK body mysqld exporter based on context it is used +func (o *AddMySQLOKBodyMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMySQLOKBodyMysqldExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -801,7 +1004,6 @@ func (o *AddMySQLOKBodyQANMysqlPerfschema) validateStatusEnum(path, location str } func (o *AddMySQLOKBodyQANMysqlPerfschema) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -814,6 +1016,11 @@ func (o *AddMySQLOKBodyQANMysqlPerfschema) validateStatus(formats strfmt.Registr return nil } +// ContextValidate validates this add my SQL OK body QAN mysql perfschema based on context it is used +func (o *AddMySQLOKBodyQANMysqlPerfschema) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMySQLOKBodyQANMysqlPerfschema) MarshalBinary() ([]byte, error) { if o == nil { @@ -947,7 +1154,6 @@ func (o *AddMySQLOKBodyQANMysqlSlowlog) validateStatusEnum(path, location string } func (o *AddMySQLOKBodyQANMysqlSlowlog) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -960,6 +1166,11 @@ func (o *AddMySQLOKBodyQANMysqlSlowlog) validateStatus(formats strfmt.Registry) return nil } +// ContextValidate validates this add my SQL OK body QAN mysql slowlog based on context it is used +func (o *AddMySQLOKBodyQANMysqlSlowlog) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMySQLOKBodyQANMysqlSlowlog) MarshalBinary() ([]byte, error) { if o == nil { @@ -1022,6 +1233,11 @@ func (o *AddMySQLOKBodyService) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add my SQL OK body service based on context it is used +func (o *AddMySQLOKBodyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddMySQLOKBodyService) MarshalBinary() ([]byte, error) { if o == nil { @@ -1045,10 +1261,6 @@ swagger:model AddMySQLParamsBodyAddNode */ type AddMySQLParamsBodyAddNode struct { - // NodeType describes supported Node types. - // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] - NodeType *string `json:"node_type,omitempty"` - // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -1075,6 +1287,10 @@ type AddMySQLParamsBodyAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add my SQL params body add node @@ -1133,7 +1349,6 @@ func (o *AddMySQLParamsBodyAddNode) validateNodeTypeEnum(path, location string, } func (o *AddMySQLParamsBodyAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required return nil } @@ -1146,44 +1361,13 @@ func (o *AddMySQLParamsBodyAddNode) validateNodeType(formats strfmt.Registry) er return nil } -// MarshalBinary interface implementation -func (o *AddMySQLParamsBodyAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddMySQLParamsBodyAddNode) UnmarshalBinary(b []byte) error { - var res AddMySQLParamsBodyAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add my SQL params body add node based on context it is used +func (o *AddMySQLParamsBodyAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddMySQLParamsBodyAddNode) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1191,8 +1375,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddMySQLParamsBodyAddNode) UnmarshalBinary(b []byte) error { + var res AddMySQLParamsBodyAddNode if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/my_sql/my_sql_client.go b/api/managementpb/json/client/my_sql/my_sql_client.go index 28e6adc96a..6a8c0f6f58 100644 --- a/api/managementpb/json/client/my_sql/my_sql_client.go +++ b/api/managementpb/json/client/my_sql/my_sql_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddMySQL(params *AddMySQLParams) (*AddMySQLOK, error) + AddMySQL(params *AddMySQLParams, opts ...ClientOption) (*AddMySQLOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { Adds MySQL Service and starts several Agents. It automatically adds a service to inventory, which is running on the provided "node_id", then adds "mysqld_exporter", and "qan_mysql_perfschema" agents with the provided "pmm_agent_id" and other parameters. */ -func (a *Client) AddMySQL(params *AddMySQLParams) (*AddMySQLOK, error) { +func (a *Client) AddMySQL(params *AddMySQLParams, opts ...ClientOption) (*AddMySQLOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddMySQLParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddMySQL", Method: "POST", PathPattern: "/v1/management/MySQL/Add", @@ -52,7 +54,12 @@ func (a *Client) AddMySQL(params *AddMySQLParams) (*AddMySQLOK, error) { Reader: &AddMySQLReader{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 } diff --git a/api/managementpb/json/client/node/node_client.go b/api/managementpb/json/client/node/node_client.go index b52d92d709..63c7e29da3 100644 --- a/api/managementpb/json/client/node/node_client.go +++ b/api/managementpb/json/client/node/node_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - RegisterNode(params *RegisterNodeParams) (*RegisterNodeOK, error) + RegisterNode(params *RegisterNodeParams, opts ...ClientOption) (*RegisterNodeOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { Registers a new Node and pmm-agent. */ -func (a *Client) RegisterNode(params *RegisterNodeParams) (*RegisterNodeOK, error) { +func (a *Client) RegisterNode(params *RegisterNodeParams, opts ...ClientOption) (*RegisterNodeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRegisterNodeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RegisterNode", Method: "POST", PathPattern: "/v1/management/Node/Register", @@ -52,7 +54,12 @@ func (a *Client) RegisterNode(params *RegisterNodeParams) (*RegisterNodeOK, erro 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 } diff --git a/api/managementpb/json/client/node/register_node_parameters.go b/api/managementpb/json/client/node/register_node_parameters.go index 5762dc011d..2ed51ae21d 100644 --- a/api/managementpb/json/client/node/register_node_parameters.go +++ b/api/managementpb/json/client/node/register_node_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRegisterNodeParams creates a new RegisterNodeParams object -// with the default values initialized. +// 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 { - var () return &RegisterNodeParams{ - timeout: cr.DefaultTimeout, } } // NewRegisterNodeParamsWithTimeout creates a new RegisterNodeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRegisterNodeParamsWithTimeout(timeout time.Duration) *RegisterNodeParams { - var () return &RegisterNodeParams{ - timeout: timeout, } } // NewRegisterNodeParamsWithContext creates a new RegisterNodeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRegisterNodeParamsWithContext(ctx context.Context) *RegisterNodeParams { - var () return &RegisterNodeParams{ - Context: ctx, } } // NewRegisterNodeParamsWithHTTPClient creates a new RegisterNodeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRegisterNodeParamsWithHTTPClient(client *http.Client) *RegisterNodeParams { - var () 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 +/* 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. Body RegisterNodeBody timeout time.Duration @@ -68,6 +67,21 @@ type RegisterNodeParams struct { 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) @@ -119,7 +133,6 @@ func (o *RegisterNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/node/register_node_responses.go b/api/managementpb/json/client/node/register_node_responses.go index 3345d54180..f7a2032e1d 100644 --- a/api/managementpb/json/client/node/register_node_responses.go +++ b/api/managementpb/json/client/node/register_node_responses.go @@ -6,6 +6,7 @@ package node // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewRegisterNodeOK() *RegisterNodeOK { return &RegisterNodeOK{} } -/*RegisterNodeOK handles this case with default header values. +/* RegisterNodeOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type RegisterNodeOK struct { func (o *RegisterNodeOK) Error() string { return fmt.Sprintf("[POST /v1/management/Node/Register][%d] registerNodeOk %+v", 200, o.Payload) } - func (o *RegisterNodeOK) GetPayload() *RegisterNodeOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewRegisterNodeDefault(code int) *RegisterNodeDefault { } } -/*RegisterNodeDefault handles this case with default header values. +/* RegisterNodeDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *RegisterNodeDefault) Code() int { func (o *RegisterNodeDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Node/Register][%d] RegisterNode default %+v", o._statusCode, o.Payload) } - func (o *RegisterNodeDefault) GetPayload() *RegisterNodeDefaultBody { return o.Payload } @@ -119,51 +118,11 @@ func (o *RegisterNodeDefault) readResponse(response runtime.ClientResponse, cons return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*RegisterNodeBody register node body swagger:model RegisterNodeBody */ type RegisterNodeBody struct { - // NodeType describes supported Node types. - // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] - NodeType *string `json:"node_type,omitempty"` - // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -197,24 +156,28 @@ type RegisterNodeBody struct { // If true, and Node with that name already exist, it will be removed with all dependent Services and Agents. Reregister bool `json:"reregister,omitempty"` + // List of collector names to disable in this exporter. + DisableCollectors []string `json:"disable_collectors"` + // MetricsMode defines desired metrics mode for agent, // it can be pull, push or auto mode chosen by server. // Enum: [AUTO PULL PUSH] MetricsMode *string `json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. - DisableCollectors []string `json:"disable_collectors"` + // NodeType describes supported Node types. + // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this register node body func (o *RegisterNodeBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateNodeType(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateNodeType(formats); err != nil { res = append(res, err) } @@ -224,107 +187,110 @@ func (o *RegisterNodeBody) Validate(formats strfmt.Registry) error { return nil } -var registerNodeBodyTypeNodeTypePropEnum []interface{} +var registerNodeBodyTypeMetricsModePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["NODE_TYPE_INVALID","GENERIC_NODE","CONTAINER_NODE","REMOTE_NODE","REMOTE_RDS_NODE","REMOTE_AZURE_DATABASE_NODE"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AUTO","PULL","PUSH"]`), &res); err != nil { panic(err) } for _, v := range res { - registerNodeBodyTypeNodeTypePropEnum = append(registerNodeBodyTypeNodeTypePropEnum, v) + registerNodeBodyTypeMetricsModePropEnum = append(registerNodeBodyTypeMetricsModePropEnum, v) } } const ( - // RegisterNodeBodyNodeTypeNODETYPEINVALID captures enum value "NODE_TYPE_INVALID" - RegisterNodeBodyNodeTypeNODETYPEINVALID string = "NODE_TYPE_INVALID" - - // RegisterNodeBodyNodeTypeGENERICNODE captures enum value "GENERIC_NODE" - RegisterNodeBodyNodeTypeGENERICNODE string = "GENERIC_NODE" - - // RegisterNodeBodyNodeTypeCONTAINERNODE captures enum value "CONTAINER_NODE" - RegisterNodeBodyNodeTypeCONTAINERNODE string = "CONTAINER_NODE" - - // RegisterNodeBodyNodeTypeREMOTENODE captures enum value "REMOTE_NODE" - RegisterNodeBodyNodeTypeREMOTENODE string = "REMOTE_NODE" + // RegisterNodeBodyMetricsModeAUTO captures enum value "AUTO" + RegisterNodeBodyMetricsModeAUTO string = "AUTO" - // RegisterNodeBodyNodeTypeREMOTERDSNODE captures enum value "REMOTE_RDS_NODE" - RegisterNodeBodyNodeTypeREMOTERDSNODE string = "REMOTE_RDS_NODE" + // RegisterNodeBodyMetricsModePULL captures enum value "PULL" + RegisterNodeBodyMetricsModePULL string = "PULL" - // RegisterNodeBodyNodeTypeREMOTEAZUREDATABASENODE captures enum value "REMOTE_AZURE_DATABASE_NODE" - RegisterNodeBodyNodeTypeREMOTEAZUREDATABASENODE string = "REMOTE_AZURE_DATABASE_NODE" + // RegisterNodeBodyMetricsModePUSH captures enum value "PUSH" + RegisterNodeBodyMetricsModePUSH string = "PUSH" ) // prop value enum -func (o *RegisterNodeBody) validateNodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, registerNodeBodyTypeNodeTypePropEnum, true); err != nil { +func (o *RegisterNodeBody) validateMetricsModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, registerNodeBodyTypeMetricsModePropEnum, true); err != nil { return err } return nil } -func (o *RegisterNodeBody) validateNodeType(formats strfmt.Registry) error { - - if swag.IsZero(o.NodeType) { // not required +func (o *RegisterNodeBody) validateMetricsMode(formats strfmt.Registry) error { + if swag.IsZero(o.MetricsMode) { // not required return nil } // value enum - if err := o.validateNodeTypeEnum("body"+"."+"node_type", "body", *o.NodeType); err != nil { + if err := o.validateMetricsModeEnum("body"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { return err } return nil } -var registerNodeBodyTypeMetricsModePropEnum []interface{} +var registerNodeBodyTypeNodeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["AUTO","PULL","PUSH"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["NODE_TYPE_INVALID","GENERIC_NODE","CONTAINER_NODE","REMOTE_NODE","REMOTE_RDS_NODE","REMOTE_AZURE_DATABASE_NODE"]`), &res); err != nil { panic(err) } for _, v := range res { - registerNodeBodyTypeMetricsModePropEnum = append(registerNodeBodyTypeMetricsModePropEnum, v) + registerNodeBodyTypeNodeTypePropEnum = append(registerNodeBodyTypeNodeTypePropEnum, v) } } const ( - // RegisterNodeBodyMetricsModeAUTO captures enum value "AUTO" - RegisterNodeBodyMetricsModeAUTO string = "AUTO" + // RegisterNodeBodyNodeTypeNODETYPEINVALID captures enum value "NODE_TYPE_INVALID" + RegisterNodeBodyNodeTypeNODETYPEINVALID string = "NODE_TYPE_INVALID" - // RegisterNodeBodyMetricsModePULL captures enum value "PULL" - RegisterNodeBodyMetricsModePULL string = "PULL" + // RegisterNodeBodyNodeTypeGENERICNODE captures enum value "GENERIC_NODE" + RegisterNodeBodyNodeTypeGENERICNODE string = "GENERIC_NODE" - // RegisterNodeBodyMetricsModePUSH captures enum value "PUSH" - RegisterNodeBodyMetricsModePUSH string = "PUSH" + // RegisterNodeBodyNodeTypeCONTAINERNODE captures enum value "CONTAINER_NODE" + RegisterNodeBodyNodeTypeCONTAINERNODE string = "CONTAINER_NODE" + + // RegisterNodeBodyNodeTypeREMOTENODE captures enum value "REMOTE_NODE" + RegisterNodeBodyNodeTypeREMOTENODE string = "REMOTE_NODE" + + // RegisterNodeBodyNodeTypeREMOTERDSNODE captures enum value "REMOTE_RDS_NODE" + RegisterNodeBodyNodeTypeREMOTERDSNODE string = "REMOTE_RDS_NODE" + + // RegisterNodeBodyNodeTypeREMOTEAZUREDATABASENODE captures enum value "REMOTE_AZURE_DATABASE_NODE" + RegisterNodeBodyNodeTypeREMOTEAZUREDATABASENODE string = "REMOTE_AZURE_DATABASE_NODE" ) // prop value enum -func (o *RegisterNodeBody) validateMetricsModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, registerNodeBodyTypeMetricsModePropEnum, true); err != nil { +func (o *RegisterNodeBody) validateNodeTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, registerNodeBodyTypeNodeTypePropEnum, true); err != nil { return err } return nil } -func (o *RegisterNodeBody) validateMetricsMode(formats strfmt.Registry) error { - - if swag.IsZero(o.MetricsMode) { // not required +func (o *RegisterNodeBody) validateNodeType(formats strfmt.Registry) error { + if swag.IsZero(o.NodeType) { // not required return nil } // value enum - if err := o.validateMetricsModeEnum("body"+"."+"metrics_mode", "body", *o.MetricsMode); err != nil { + if err := o.validateNodeTypeEnum("body"+"."+"node_type", "body", *o.NodeType); err != nil { return err } return nil } +// 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 { @@ -358,7 +324,7 @@ type RegisterNodeDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RegisterNodeDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this register node default body @@ -376,7 +342,6 @@ func (o *RegisterNodeDefaultBody) Validate(formats strfmt.Registry) error { } func (o *RegisterNodeDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -390,6 +355,42 @@ func (o *RegisterNodeDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RegisterNode default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -418,6 +419,47 @@ func (o *RegisterNodeDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*RegisterNodeDefaultBodyDetailsItems0 register node default body details items0 +swagger:model RegisterNodeDefaultBodyDetailsItems0 +*/ +type RegisterNodeDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -456,7 +498,6 @@ func (o *RegisterNodeOKBody) Validate(formats strfmt.Registry) error { } func (o *RegisterNodeOKBody) validateContainerNode(formats strfmt.Registry) error { - if swag.IsZero(o.ContainerNode) { // not required return nil } @@ -465,6 +506,8 @@ func (o *RegisterNodeOKBody) validateContainerNode(formats strfmt.Registry) erro if err := o.ContainerNode.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("registerNodeOk" + "." + "container_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("registerNodeOk" + "." + "container_node") } return err } @@ -474,7 +517,6 @@ func (o *RegisterNodeOKBody) validateContainerNode(formats strfmt.Registry) erro } func (o *RegisterNodeOKBody) validateGenericNode(formats strfmt.Registry) error { - if swag.IsZero(o.GenericNode) { // not required return nil } @@ -483,6 +525,8 @@ func (o *RegisterNodeOKBody) validateGenericNode(formats strfmt.Registry) error if err := o.GenericNode.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("registerNodeOk" + "." + "generic_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("registerNodeOk" + "." + "generic_node") } return err } @@ -492,7 +536,6 @@ func (o *RegisterNodeOKBody) validateGenericNode(formats strfmt.Registry) error } func (o *RegisterNodeOKBody) validatePMMAgent(formats strfmt.Registry) error { - if swag.IsZero(o.PMMAgent) { // not required return nil } @@ -501,6 +544,78 @@ func (o *RegisterNodeOKBody) validatePMMAgent(formats strfmt.Registry) error { if err := o.PMMAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("registerNodeOk" + "." + "pmm_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.ContainerNode.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registerNodeOk" + "." + "container_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.GenericNode.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registerNodeOk" + "." + "generic_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.PMMAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registerNodeOk" + "." + "pmm_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("registerNodeOk" + "." + "pmm_agent") } return err } @@ -568,6 +683,11 @@ func (o *RegisterNodeOKBodyContainerNode) Validate(formats strfmt.Registry) erro 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 { @@ -624,6 +744,11 @@ 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 { @@ -665,6 +790,11 @@ 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 { diff --git a/api/managementpb/json/client/pmm_management_client.go b/api/managementpb/json/client/pmm_management_api_client.go similarity index 89% rename from api/managementpb/json/client/pmm_management_client.go rename to api/managementpb/json/client/pmm_management_api_client.go index 388af91317..7e0446fa67 100644 --- a/api/managementpb/json/client/pmm_management_client.go +++ b/api/managementpb/json/client/pmm_management_api_client.go @@ -24,7 +24,7 @@ import ( "github.com/percona/pmm/api/managementpb/json/client/service" ) -// Default PMM management HTTP client. +// Default PMM management API HTTP client. var Default = NewHTTPClient(nil) const ( @@ -39,14 +39,14 @@ const ( // DefaultSchemes are the default schemes found in Meta (info) section of spec file var DefaultSchemes = []string{"http", "https"} -// NewHTTPClient creates a new PMM management HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMManagement { +// 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 HTTP client, +// NewHTTPClientWithConfig creates a new PMM management API HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMManagement { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMManagementAPI { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -57,14 +57,14 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMM return New(transport, formats) } -// New creates a new PMM management client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMManagement { +// 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(PMMManagement) + cli := new(PMMManagementAPI) cli.Transport = transport cli.Actions = actions.New(transport, formats) cli.Annotation = annotation.New(transport, formats) @@ -120,8 +120,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// PMMManagement is a client for PMM management -type PMMManagement struct { +// PMMManagementAPI is a client for PMM management API +type PMMManagementAPI struct { Actions actions.ClientService Annotation annotation.ClientService @@ -150,7 +150,7 @@ type PMMManagement struct { } // SetTransport changes the transport on the client and all its subresources -func (c *PMMManagement) SetTransport(transport runtime.ClientTransport) { +func (c *PMMManagementAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Actions.SetTransport(transport) c.Annotation.SetTransport(transport) diff --git a/api/managementpb/json/client/postgre_sql/add_postgre_sql_parameters.go b/api/managementpb/json/client/postgre_sql/add_postgre_sql_parameters.go index 12b97f05de..f23c94af6a 100644 --- a/api/managementpb/json/client/postgre_sql/add_postgre_sql_parameters.go +++ b/api/managementpb/json/client/postgre_sql/add_postgre_sql_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddPostgreSQLParams creates a new AddPostgreSQLParams object -// with the default values initialized. +// NewAddPostgreSQLParams creates a new AddPostgreSQLParams 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 NewAddPostgreSQLParams() *AddPostgreSQLParams { - var () return &AddPostgreSQLParams{ - timeout: cr.DefaultTimeout, } } // NewAddPostgreSQLParamsWithTimeout creates a new AddPostgreSQLParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddPostgreSQLParamsWithTimeout(timeout time.Duration) *AddPostgreSQLParams { - var () return &AddPostgreSQLParams{ - timeout: timeout, } } // NewAddPostgreSQLParamsWithContext creates a new AddPostgreSQLParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddPostgreSQLParamsWithContext(ctx context.Context) *AddPostgreSQLParams { - var () return &AddPostgreSQLParams{ - Context: ctx, } } // NewAddPostgreSQLParamsWithHTTPClient creates a new AddPostgreSQLParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddPostgreSQLParamsWithHTTPClient(client *http.Client) *AddPostgreSQLParams { - var () return &AddPostgreSQLParams{ HTTPClient: client, } } -/*AddPostgreSQLParams contains all the parameters to send to the API endpoint -for the add postgre SQL operation typically these are written to a http.Request +/* AddPostgreSQLParams contains all the parameters to send to the API endpoint + for the add postgre SQL operation. + + Typically these are written to a http.Request. */ type AddPostgreSQLParams struct { - /*Body*/ + // Body. Body AddPostgreSQLBody timeout time.Duration @@ -68,6 +67,21 @@ type AddPostgreSQLParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add postgre SQL params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddPostgreSQLParams) WithDefaults() *AddPostgreSQLParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add postgre SQL params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddPostgreSQLParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add postgre SQL params func (o *AddPostgreSQLParams) WithTimeout(timeout time.Duration) *AddPostgreSQLParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddPostgreSQLParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/postgre_sql/add_postgre_sql_responses.go b/api/managementpb/json/client/postgre_sql/add_postgre_sql_responses.go index d27398b5d6..5693da9565 100644 --- a/api/managementpb/json/client/postgre_sql/add_postgre_sql_responses.go +++ b/api/managementpb/json/client/postgre_sql/add_postgre_sql_responses.go @@ -6,6 +6,7 @@ package postgre_sql // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddPostgreSQLOK() *AddPostgreSQLOK { return &AddPostgreSQLOK{} } -/*AddPostgreSQLOK handles this case with default header values. +/* AddPostgreSQLOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddPostgreSQLOK struct { func (o *AddPostgreSQLOK) Error() string { return fmt.Sprintf("[POST /v1/management/PostgreSQL/Add][%d] addPostgreSqlOk %+v", 200, o.Payload) } - func (o *AddPostgreSQLOK) GetPayload() *AddPostgreSQLOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddPostgreSQLDefault(code int) *AddPostgreSQLDefault { } } -/*AddPostgreSQLDefault handles this case with default header values. +/* AddPostgreSQLDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddPostgreSQLDefault) Code() int { func (o *AddPostgreSQLDefault) Error() string { return fmt.Sprintf("[POST /v1/management/PostgreSQL/Add][%d] AddPostgreSQL default %+v", o._statusCode, o.Payload) } - func (o *AddPostgreSQLDefault) GetPayload() *AddPostgreSQLDefaultBody { return o.Payload } @@ -189,11 +188,6 @@ type AddPostgreSQLBody struct { // Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // Enum: [AUTO PULL PUSH] - MetricsMode *string `json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` @@ -211,17 +205,22 @@ type AddPostgreSQLBody struct { // add node AddNode *AddPostgreSQLParamsBodyAddNode `json:"add_node,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // Enum: [AUTO PULL PUSH] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add postgre SQL body func (o *AddPostgreSQLBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -231,6 +230,25 @@ func (o *AddPostgreSQLBody) Validate(formats strfmt.Registry) error { return nil } +func (o *AddPostgreSQLBody) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") + } + return err + } + } + + return nil +} + var addPostgreSqlBodyTypeMetricsModePropEnum []interface{} func init() { @@ -264,7 +282,6 @@ func (o *AddPostgreSQLBody) validateMetricsModeEnum(path, location string, value } func (o *AddPostgreSQLBody) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required return nil } @@ -277,16 +294,28 @@ func (o *AddPostgreSQLBody) validateMetricsMode(formats strfmt.Registry) error { return nil } -func (o *AddPostgreSQLBody) validateAddNode(formats strfmt.Registry) error { +// ContextValidate validate this add postgre SQL body based on the context it is used +func (o *AddPostgreSQLBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.AddNode) { // not required - return nil + if err := o.contextValidateAddNode(ctx, formats); err != nil { + res = append(res, err) } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddPostgreSQLBody) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { + if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { + if err := o.AddNode.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") } return err } @@ -328,7 +357,7 @@ type AddPostgreSQLDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddPostgreSQLDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add postgre SQL default body @@ -346,7 +375,6 @@ func (o *AddPostgreSQLDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddPostgreSQLDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -360,6 +388,42 @@ func (o *AddPostgreSQLDefaultBody) validateDetails(formats strfmt.Registry) erro if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddPostgreSQL default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddPostgreSQL default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add postgre SQL default body based on the context it is used +func (o *AddPostgreSQLDefaultBody) 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 *AddPostgreSQLDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddPostgreSQL default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddPostgreSQL default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -388,6 +452,47 @@ func (o *AddPostgreSQLDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddPostgreSQLDefaultBodyDetailsItems0 add postgre SQL default body details items0 +swagger:model AddPostgreSQLDefaultBodyDetailsItems0 +*/ +type AddPostgreSQLDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add postgre SQL default body details items0 +func (o *AddPostgreSQLDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add postgre SQL default body details items0 based on context it is used +func (o *AddPostgreSQLDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddPostgreSQLDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddPostgreSQLDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddPostgreSQLDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddPostgreSQLOKBody add postgre SQL OK body swagger:model AddPostgreSQLOKBody */ @@ -433,7 +538,6 @@ func (o *AddPostgreSQLOKBody) Validate(formats strfmt.Registry) error { } func (o *AddPostgreSQLOKBody) validatePostgresExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresExporter) { // not required return nil } @@ -442,6 +546,8 @@ func (o *AddPostgreSQLOKBody) validatePostgresExporter(formats strfmt.Registry) if err := o.PostgresExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addPostgreSqlOk" + "." + "postgres_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgreSqlOk" + "." + "postgres_exporter") } return err } @@ -451,7 +557,6 @@ func (o *AddPostgreSQLOKBody) validatePostgresExporter(formats strfmt.Registry) } func (o *AddPostgreSQLOKBody) validateQANPostgresqlPgstatementsAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatementsAgent) { // not required return nil } @@ -460,6 +565,8 @@ func (o *AddPostgreSQLOKBody) validateQANPostgresqlPgstatementsAgent(formats str if err := o.QANPostgresqlPgstatementsAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addPostgreSqlOk" + "." + "qan_postgresql_pgstatements_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgreSqlOk" + "." + "qan_postgresql_pgstatements_agent") } return err } @@ -469,7 +576,6 @@ func (o *AddPostgreSQLOKBody) validateQANPostgresqlPgstatementsAgent(formats str } func (o *AddPostgreSQLOKBody) validateQANPostgresqlPgstatmonitorAgent(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatmonitorAgent) { // not required return nil } @@ -478,6 +584,8 @@ func (o *AddPostgreSQLOKBody) validateQANPostgresqlPgstatmonitorAgent(formats st if err := o.QANPostgresqlPgstatmonitorAgent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addPostgreSqlOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgreSqlOk" + "." + "qan_postgresql_pgstatmonitor_agent") } return err } @@ -487,7 +595,6 @@ func (o *AddPostgreSQLOKBody) validateQANPostgresqlPgstatmonitorAgent(formats st } func (o *AddPostgreSQLOKBody) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required return nil } @@ -496,6 +603,98 @@ func (o *AddPostgreSQLOKBody) validateService(formats strfmt.Registry) error { if err := o.Service.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addPostgreSqlOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgreSqlOk" + "." + "service") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add postgre SQL OK body based on the context it is used +func (o *AddPostgreSQLOKBody) 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 *AddPostgreSQLOKBody) contextValidatePostgresExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.PostgresExporter != nil { + if err := o.PostgresExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addPostgreSqlOk" + "." + "postgres_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgreSqlOk" + "." + "postgres_exporter") + } + return err + } + } + + return nil +} + +func (o *AddPostgreSQLOKBody) contextValidateQANPostgresqlPgstatementsAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANPostgresqlPgstatementsAgent != nil { + if err := o.QANPostgresqlPgstatementsAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addPostgreSqlOk" + "." + "qan_postgresql_pgstatements_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgreSqlOk" + "." + "qan_postgresql_pgstatements_agent") + } + return err + } + } + + return nil +} + +func (o *AddPostgreSQLOKBody) contextValidateQANPostgresqlPgstatmonitorAgent(ctx context.Context, formats strfmt.Registry) error { + + if o.QANPostgresqlPgstatmonitorAgent != nil { + if err := o.QANPostgresqlPgstatmonitorAgent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addPostgreSqlOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgreSqlOk" + "." + "qan_postgresql_pgstatmonitor_agent") + } + return err + } + } + + return nil +} + +func (o *AddPostgreSQLOKBody) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + + if o.Service != nil { + if err := o.Service.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addPostgreSqlOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addPostgreSqlOk" + "." + "service") } return err } @@ -557,6 +756,9 @@ type AddPostgreSQLOKBodyPostgresExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -567,9 +769,6 @@ type AddPostgreSQLOKBodyPostgresExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this add postgre SQL OK body postgres exporter @@ -631,7 +830,6 @@ func (o *AddPostgreSQLOKBodyPostgresExporter) validateStatusEnum(path, location } func (o *AddPostgreSQLOKBodyPostgresExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -644,6 +842,11 @@ func (o *AddPostgreSQLOKBodyPostgresExporter) validateStatus(formats strfmt.Regi return nil } +// ContextValidate validates this add postgre SQL OK body postgres exporter based on context it is used +func (o *AddPostgreSQLOKBodyPostgresExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddPostgreSQLOKBodyPostgresExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -762,7 +965,6 @@ func (o *AddPostgreSQLOKBodyQANPostgresqlPgstatementsAgent) validateStatusEnum(p } func (o *AddPostgreSQLOKBodyQANPostgresqlPgstatementsAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -775,6 +977,11 @@ func (o *AddPostgreSQLOKBodyQANPostgresqlPgstatementsAgent) validateStatus(forma return nil } +// ContextValidate validates this add postgre SQL OK body QAN postgresql pgstatements agent based on context it is used +func (o *AddPostgreSQLOKBodyQANPostgresqlPgstatementsAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddPostgreSQLOKBodyQANPostgresqlPgstatementsAgent) MarshalBinary() ([]byte, error) { if o == nil { @@ -896,7 +1103,6 @@ func (o *AddPostgreSQLOKBodyQANPostgresqlPgstatmonitorAgent) validateStatusEnum( } func (o *AddPostgreSQLOKBodyQANPostgresqlPgstatmonitorAgent) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -909,6 +1115,11 @@ func (o *AddPostgreSQLOKBodyQANPostgresqlPgstatmonitorAgent) validateStatus(form return nil } +// ContextValidate validates this add postgre SQL OK body QAN postgresql pgstatmonitor agent based on context it is used +func (o *AddPostgreSQLOKBodyQANPostgresqlPgstatmonitorAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddPostgreSQLOKBodyQANPostgresqlPgstatmonitorAgent) MarshalBinary() ([]byte, error) { if o == nil { @@ -974,6 +1185,11 @@ func (o *AddPostgreSQLOKBodyService) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add postgre SQL OK body service based on context it is used +func (o *AddPostgreSQLOKBodyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddPostgreSQLOKBodyService) MarshalBinary() ([]byte, error) { if o == nil { @@ -997,10 +1213,6 @@ swagger:model AddPostgreSQLParamsBodyAddNode */ type AddPostgreSQLParamsBodyAddNode struct { - // NodeType describes supported Node types. - // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] - NodeType *string `json:"node_type,omitempty"` - // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -1027,6 +1239,10 @@ type AddPostgreSQLParamsBodyAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add postgre SQL params body add node @@ -1085,7 +1301,6 @@ func (o *AddPostgreSQLParamsBodyAddNode) validateNodeTypeEnum(path, location str } func (o *AddPostgreSQLParamsBodyAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required return nil } @@ -1098,44 +1313,13 @@ func (o *AddPostgreSQLParamsBodyAddNode) validateNodeType(formats strfmt.Registr return nil } -// MarshalBinary interface implementation -func (o *AddPostgreSQLParamsBodyAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddPostgreSQLParamsBodyAddNode) UnmarshalBinary(b []byte) error { - var res AddPostgreSQLParamsBodyAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add postgre SQL params body add node based on context it is used +func (o *AddPostgreSQLParamsBodyAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddPostgreSQLParamsBodyAddNode) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1143,8 +1327,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddPostgreSQLParamsBodyAddNode) UnmarshalBinary(b []byte) error { + var res AddPostgreSQLParamsBodyAddNode if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/postgre_sql/postgre_sql_client.go b/api/managementpb/json/client/postgre_sql/postgre_sql_client.go index 1a989e23a3..57e99fd901 100644 --- a/api/managementpb/json/client/postgre_sql/postgre_sql_client.go +++ b/api/managementpb/json/client/postgre_sql/postgre_sql_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddPostgreSQL(params *AddPostgreSQLParams) (*AddPostgreSQLOK, error) + AddPostgreSQL(params *AddPostgreSQLParams, opts ...ClientOption) (*AddPostgreSQLOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { Adds PostgreSQL Service and starts postgres exporter. It automatically adds a service to inventory, which is running on provided "node_id", then adds "postgres_exporter" with provided "pmm_agent_id" and other parameters. */ -func (a *Client) AddPostgreSQL(params *AddPostgreSQLParams) (*AddPostgreSQLOK, error) { +func (a *Client) AddPostgreSQL(params *AddPostgreSQLParams, opts ...ClientOption) (*AddPostgreSQLOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddPostgreSQLParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddPostgreSQL", Method: "POST", PathPattern: "/v1/management/PostgreSQL/Add", @@ -52,7 +54,12 @@ func (a *Client) AddPostgreSQL(params *AddPostgreSQLParams) (*AddPostgreSQLOK, e Reader: &AddPostgreSQLReader{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 } diff --git a/api/managementpb/json/client/proxy_sql/add_proxy_sql_parameters.go b/api/managementpb/json/client/proxy_sql/add_proxy_sql_parameters.go index 2b25b13253..8bd5ea199b 100644 --- a/api/managementpb/json/client/proxy_sql/add_proxy_sql_parameters.go +++ b/api/managementpb/json/client/proxy_sql/add_proxy_sql_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddProxySQLParams creates a new AddProxySQLParams object -// with the default values initialized. +// NewAddProxySQLParams creates a new AddProxySQLParams 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 NewAddProxySQLParams() *AddProxySQLParams { - var () return &AddProxySQLParams{ - timeout: cr.DefaultTimeout, } } // NewAddProxySQLParamsWithTimeout creates a new AddProxySQLParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddProxySQLParamsWithTimeout(timeout time.Duration) *AddProxySQLParams { - var () return &AddProxySQLParams{ - timeout: timeout, } } // NewAddProxySQLParamsWithContext creates a new AddProxySQLParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddProxySQLParamsWithContext(ctx context.Context) *AddProxySQLParams { - var () return &AddProxySQLParams{ - Context: ctx, } } // NewAddProxySQLParamsWithHTTPClient creates a new AddProxySQLParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddProxySQLParamsWithHTTPClient(client *http.Client) *AddProxySQLParams { - var () return &AddProxySQLParams{ HTTPClient: client, } } -/*AddProxySQLParams contains all the parameters to send to the API endpoint -for the add proxy SQL operation typically these are written to a http.Request +/* AddProxySQLParams contains all the parameters to send to the API endpoint + for the add proxy SQL operation. + + Typically these are written to a http.Request. */ type AddProxySQLParams struct { - /*Body*/ + // Body. Body AddProxySQLBody timeout time.Duration @@ -68,6 +67,21 @@ type AddProxySQLParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add proxy SQL params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddProxySQLParams) WithDefaults() *AddProxySQLParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add proxy SQL params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddProxySQLParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add proxy SQL params func (o *AddProxySQLParams) WithTimeout(timeout time.Duration) *AddProxySQLParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddProxySQLParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/proxy_sql/add_proxy_sql_responses.go b/api/managementpb/json/client/proxy_sql/add_proxy_sql_responses.go index 7cc47325a6..7f2e95275e 100644 --- a/api/managementpb/json/client/proxy_sql/add_proxy_sql_responses.go +++ b/api/managementpb/json/client/proxy_sql/add_proxy_sql_responses.go @@ -6,6 +6,7 @@ package proxy_sql // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddProxySQLOK() *AddProxySQLOK { return &AddProxySQLOK{} } -/*AddProxySQLOK handles this case with default header values. +/* AddProxySQLOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddProxySQLOK struct { func (o *AddProxySQLOK) Error() string { return fmt.Sprintf("[POST /v1/management/ProxySQL/Add][%d] addProxySqlOk %+v", 200, o.Payload) } - func (o *AddProxySQLOK) GetPayload() *AddProxySQLOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddProxySQLDefault(code int) *AddProxySQLDefault { } } -/*AddProxySQLDefault handles this case with default header values. +/* AddProxySQLDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddProxySQLDefault) Code() int { func (o *AddProxySQLDefault) Error() string { return fmt.Sprintf("[POST /v1/management/ProxySQL/Add][%d] AddProxySQL default %+v", o._statusCode, o.Payload) } - func (o *AddProxySQLDefault) GetPayload() *AddProxySQLDefaultBody { return o.Payload } @@ -177,11 +176,6 @@ type AddProxySQLBody struct { // Skip TLS certificate and hostname validation. TLSSkipVerify bool `json:"tls_skip_verify,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // Enum: [AUTO PULL PUSH] - MetricsMode *string `json:"metrics_mode,omitempty"` - // List of collector names to disable in this exporter. DisableCollectors []string `json:"disable_collectors"` @@ -190,17 +184,22 @@ type AddProxySQLBody struct { // add node AddNode *AddProxySQLParamsBodyAddNode `json:"add_node,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // Enum: [AUTO PULL PUSH] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add proxy SQL body func (o *AddProxySQLBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateMetricsMode(formats); err != nil { + if err := o.validateAddNode(formats); err != nil { res = append(res, err) } - if err := o.validateAddNode(formats); err != nil { + if err := o.validateMetricsMode(formats); err != nil { res = append(res, err) } @@ -210,6 +209,25 @@ func (o *AddProxySQLBody) Validate(formats strfmt.Registry) error { return nil } +func (o *AddProxySQLBody) validateAddNode(formats strfmt.Registry) error { + if swag.IsZero(o.AddNode) { // not required + return nil + } + + if o.AddNode != nil { + if err := o.AddNode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") + } + return err + } + } + + return nil +} + var addProxySqlBodyTypeMetricsModePropEnum []interface{} func init() { @@ -243,7 +261,6 @@ func (o *AddProxySQLBody) validateMetricsModeEnum(path, location string, value s } func (o *AddProxySQLBody) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required return nil } @@ -256,16 +273,28 @@ func (o *AddProxySQLBody) validateMetricsMode(formats strfmt.Registry) error { return nil } -func (o *AddProxySQLBody) validateAddNode(formats strfmt.Registry) error { +// ContextValidate validate this add proxy SQL body based on the context it is used +func (o *AddProxySQLBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error - if swag.IsZero(o.AddNode) { // not required - return nil + if err := o.contextValidateAddNode(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) } + return nil +} + +func (o *AddProxySQLBody) contextValidateAddNode(ctx context.Context, formats strfmt.Registry) error { if o.AddNode != nil { - if err := o.AddNode.Validate(formats); err != nil { + if err := o.AddNode.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "add_node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "add_node") } return err } @@ -307,7 +336,7 @@ type AddProxySQLDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddProxySQLDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add proxy SQL default body @@ -325,7 +354,6 @@ func (o *AddProxySQLDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddProxySQLDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -339,6 +367,42 @@ func (o *AddProxySQLDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddProxySQL default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddProxySQL default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add proxy SQL default body based on the context it is used +func (o *AddProxySQLDefaultBody) 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 *AddProxySQLDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddProxySQL default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddProxySQL default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -367,6 +431,47 @@ func (o *AddProxySQLDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddProxySQLDefaultBodyDetailsItems0 add proxy SQL default body details items0 +swagger:model AddProxySQLDefaultBodyDetailsItems0 +*/ +type AddProxySQLDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add proxy SQL default body details items0 +func (o *AddProxySQLDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add proxy SQL default body details items0 based on context it is used +func (o *AddProxySQLDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddProxySQLDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddProxySQLDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddProxySQLDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddProxySQLOKBody add proxy SQL OK body swagger:model AddProxySQLOKBody */ @@ -398,7 +503,6 @@ func (o *AddProxySQLOKBody) Validate(formats strfmt.Registry) error { } func (o *AddProxySQLOKBody) validateProxysqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.ProxysqlExporter) { // not required return nil } @@ -407,6 +511,8 @@ func (o *AddProxySQLOKBody) validateProxysqlExporter(formats strfmt.Registry) er if err := o.ProxysqlExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addProxySqlOk" + "." + "proxysql_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addProxySqlOk" + "." + "proxysql_exporter") } return err } @@ -416,7 +522,6 @@ func (o *AddProxySQLOKBody) validateProxysqlExporter(formats strfmt.Registry) er } func (o *AddProxySQLOKBody) validateService(formats strfmt.Registry) error { - if swag.IsZero(o.Service) { // not required return nil } @@ -425,6 +530,58 @@ func (o *AddProxySQLOKBody) validateService(formats strfmt.Registry) error { if err := o.Service.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addProxySqlOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addProxySqlOk" + "." + "service") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add proxy SQL OK body based on the context it is used +func (o *AddProxySQLOKBody) 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 *AddProxySQLOKBody) contextValidateProxysqlExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.ProxysqlExporter != nil { + if err := o.ProxysqlExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addProxySqlOk" + "." + "proxysql_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addProxySqlOk" + "." + "proxysql_exporter") + } + return err + } + } + + return nil +} + +func (o *AddProxySQLOKBody) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + + if o.Service != nil { + if err := o.Service.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addProxySqlOk" + "." + "service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addProxySqlOk" + "." + "service") } return err } @@ -486,6 +643,9 @@ type AddProxySQLOKBodyProxysqlExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -496,9 +656,6 @@ type AddProxySQLOKBodyProxysqlExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this add proxy SQL OK body proxysql exporter @@ -560,7 +717,6 @@ func (o *AddProxySQLOKBodyProxysqlExporter) validateStatusEnum(path, location st } func (o *AddProxySQLOKBodyProxysqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -573,6 +729,11 @@ func (o *AddProxySQLOKBodyProxysqlExporter) validateStatus(formats strfmt.Regist return nil } +// ContextValidate validates this add proxy SQL OK body proxysql exporter based on context it is used +func (o *AddProxySQLOKBodyProxysqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddProxySQLOKBodyProxysqlExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -635,6 +796,11 @@ func (o *AddProxySQLOKBodyService) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add proxy SQL OK body service based on context it is used +func (o *AddProxySQLOKBodyService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddProxySQLOKBodyService) MarshalBinary() ([]byte, error) { if o == nil { @@ -658,10 +824,6 @@ swagger:model AddProxySQLParamsBodyAddNode */ type AddProxySQLParamsBodyAddNode struct { - // NodeType describes supported Node types. - // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] - NodeType *string `json:"node_type,omitempty"` - // Unique across all Nodes user-defined name. NodeName string `json:"node_name,omitempty"` @@ -688,6 +850,10 @@ type AddProxySQLParamsBodyAddNode struct { // Custom user-assigned labels for Node. CustomLabels map[string]string `json:"custom_labels,omitempty"` + + // NodeType describes supported Node types. + // Enum: [NODE_TYPE_INVALID GENERIC_NODE CONTAINER_NODE REMOTE_NODE REMOTE_RDS_NODE REMOTE_AZURE_DATABASE_NODE] + NodeType *string `json:"node_type,omitempty"` } // Validate validates this add proxy SQL params body add node @@ -746,7 +912,6 @@ func (o *AddProxySQLParamsBodyAddNode) validateNodeTypeEnum(path, location strin } func (o *AddProxySQLParamsBodyAddNode) validateNodeType(formats strfmt.Registry) error { - if swag.IsZero(o.NodeType) { // not required return nil } @@ -759,44 +924,13 @@ func (o *AddProxySQLParamsBodyAddNode) validateNodeType(formats strfmt.Registry) return nil } -// MarshalBinary interface implementation -func (o *AddProxySQLParamsBodyAddNode) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddProxySQLParamsBodyAddNode) UnmarshalBinary(b []byte) error { - var res AddProxySQLParamsBodyAddNode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add proxy SQL params body add node based on context it is used +func (o *AddProxySQLParamsBodyAddNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddProxySQLParamsBodyAddNode) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -804,8 +938,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddProxySQLParamsBodyAddNode) UnmarshalBinary(b []byte) error { + var res AddProxySQLParamsBodyAddNode if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/proxy_sql/proxy_sql_client.go b/api/managementpb/json/client/proxy_sql/proxy_sql_client.go index 9314ebf55b..657dc3e1d2 100644 --- a/api/managementpb/json/client/proxy_sql/proxy_sql_client.go +++ b/api/managementpb/json/client/proxy_sql/proxy_sql_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddProxySQL(params *AddProxySQLParams) (*AddProxySQLOK, error) + AddProxySQL(params *AddProxySQLParams, opts ...ClientOption) (*AddProxySQLOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { Adds ProxySQL Service and starts several Agents. It automatically adds a service to inventory, which is running on provided "node_id", then adds "proxysql_exporter" with provided "pmm_agent_id" and other parameters. */ -func (a *Client) AddProxySQL(params *AddProxySQLParams) (*AddProxySQLOK, error) { +func (a *Client) AddProxySQL(params *AddProxySQLParams, opts ...ClientOption) (*AddProxySQLOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddProxySQLParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddProxySQL", Method: "POST", PathPattern: "/v1/management/ProxySQL/Add", @@ -52,7 +54,12 @@ func (a *Client) AddProxySQL(params *AddProxySQLParams) (*AddProxySQLOK, error) Reader: &AddProxySQLReader{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 } diff --git a/api/managementpb/json/client/rds/add_rds_parameters.go b/api/managementpb/json/client/rds/add_rds_parameters.go index 2ea3caba4c..95c6fade48 100644 --- a/api/managementpb/json/client/rds/add_rds_parameters.go +++ b/api/managementpb/json/client/rds/add_rds_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAddRDSParams creates a new AddRDSParams object -// with the default values initialized. +// NewAddRDSParams creates a new AddRDSParams 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 NewAddRDSParams() *AddRDSParams { - var () return &AddRDSParams{ - timeout: cr.DefaultTimeout, } } // NewAddRDSParamsWithTimeout creates a new AddRDSParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAddRDSParamsWithTimeout(timeout time.Duration) *AddRDSParams { - var () return &AddRDSParams{ - timeout: timeout, } } // NewAddRDSParamsWithContext creates a new AddRDSParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAddRDSParamsWithContext(ctx context.Context) *AddRDSParams { - var () return &AddRDSParams{ - Context: ctx, } } // NewAddRDSParamsWithHTTPClient creates a new AddRDSParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAddRDSParamsWithHTTPClient(client *http.Client) *AddRDSParams { - var () return &AddRDSParams{ HTTPClient: client, } } -/*AddRDSParams contains all the parameters to send to the API endpoint -for the add RDS operation typically these are written to a http.Request +/* AddRDSParams contains all the parameters to send to the API endpoint + for the add RDS operation. + + Typically these are written to a http.Request. */ type AddRDSParams struct { - /*Body*/ + // Body. Body AddRDSBody timeout time.Duration @@ -68,6 +67,21 @@ type AddRDSParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the add RDS params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRDSParams) WithDefaults() *AddRDSParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add RDS params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRDSParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the add RDS params func (o *AddRDSParams) WithTimeout(timeout time.Duration) *AddRDSParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AddRDSParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/rds/add_rds_responses.go b/api/managementpb/json/client/rds/add_rds_responses.go index 3fb5e1f9c2..27f7dab1d4 100644 --- a/api/managementpb/json/client/rds/add_rds_responses.go +++ b/api/managementpb/json/client/rds/add_rds_responses.go @@ -6,6 +6,7 @@ package rds // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewAddRDSOK() *AddRDSOK { return &AddRDSOK{} } -/*AddRDSOK handles this case with default header values. +/* AddRDSOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type AddRDSOK struct { func (o *AddRDSOK) Error() string { return fmt.Sprintf("[POST /v1/management/RDS/Add][%d] addRdsOk %+v", 200, o.Payload) } - func (o *AddRDSOK) GetPayload() *AddRDSOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewAddRDSDefault(code int) *AddRDSDefault { } } -/*AddRDSDefault handles this case with default header values. +/* AddRDSDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *AddRDSDefault) Code() int { func (o *AddRDSDefault) Error() string { return fmt.Sprintf("[POST /v1/management/RDS/Add][%d] AddRDS default %+v", o._statusCode, o.Payload) } - func (o *AddRDSDefault) GetPayload() *AddRDSDefaultBody { return o.Payload } @@ -142,10 +141,6 @@ type AddRDSBody struct { // Access port. Port int64 `json:"port,omitempty"` - // DiscoverRDSEngine describes supported RDS instance engines. - // Enum: [DISCOVER_RDS_ENGINE_INVALID DISCOVER_RDS_MYSQL DISCOVER_RDS_POSTGRESQL] - Engine *string `json:"engine,omitempty"` - // Unique across all Nodes user-defined name. Defaults to AWS instance ID. NodeName string `json:"node_name,omitempty"` @@ -205,16 +200,20 @@ type AddRDSBody struct { // Disable enhanced metrics. DisableEnhancedMetrics bool `json:"disable_enhanced_metrics,omitempty"` - // MetricsMode defines desired metrics mode for agent, - // it can be pull, push or auto mode chosen by server. - // Enum: [AUTO PULL 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"` + + // DiscoverRDSEngine describes supported RDS instance engines. + // Enum: [DISCOVER_RDS_ENGINE_INVALID DISCOVER_RDS_MYSQL DISCOVER_RDS_POSTGRESQL] + Engine *string `json:"engine,omitempty"` + + // MetricsMode defines desired metrics mode for agent, + // it can be pull, push or auto mode chosen by server. + // Enum: [AUTO PULL PUSH] + MetricsMode *string `json:"metrics_mode,omitempty"` } // Validate validates this add RDS body @@ -268,7 +267,6 @@ func (o *AddRDSBody) validateEngineEnum(path, location string, value string) err } func (o *AddRDSBody) validateEngine(formats strfmt.Registry) error { - if swag.IsZero(o.Engine) { // not required return nil } @@ -314,7 +312,6 @@ func (o *AddRDSBody) validateMetricsModeEnum(path, location string, value string } func (o *AddRDSBody) validateMetricsMode(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsMode) { // not required return nil } @@ -327,6 +324,11 @@ func (o *AddRDSBody) validateMetricsMode(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add RDS body based on context it is used +func (o *AddRDSBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRDSBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -360,7 +362,7 @@ type AddRDSDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AddRDSDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this add RDS default body @@ -378,7 +380,6 @@ func (o *AddRDSDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AddRDSDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -392,6 +393,42 @@ func (o *AddRDSDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AddRDS default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddRDS default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add RDS default body based on the context it is used +func (o *AddRDSDefaultBody) 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 *AddRDSDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddRDS default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddRDS default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -420,6 +457,47 @@ func (o *AddRDSDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*AddRDSDefaultBodyDetailsItems0 add RDS default body details items0 +swagger:model AddRDSDefaultBodyDetailsItems0 +*/ +type AddRDSDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this add RDS default body details items0 +func (o *AddRDSDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add RDS default body details items0 based on context it is used +func (o *AddRDSDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddRDSDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddRDSDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddRDSDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*AddRDSOKBody add RDS OK body swagger:model AddRDSOKBody */ @@ -496,7 +574,6 @@ func (o *AddRDSOKBody) Validate(formats strfmt.Registry) error { } func (o *AddRDSOKBody) validateMysql(formats strfmt.Registry) error { - if swag.IsZero(o.Mysql) { // not required return nil } @@ -505,6 +582,8 @@ func (o *AddRDSOKBody) validateMysql(formats strfmt.Registry) error { if err := o.Mysql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRdsOk" + "." + "mysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "mysql") } return err } @@ -514,7 +593,6 @@ func (o *AddRDSOKBody) validateMysql(formats strfmt.Registry) error { } func (o *AddRDSOKBody) validateMysqldExporter(formats strfmt.Registry) error { - if swag.IsZero(o.MysqldExporter) { // not required return nil } @@ -523,6 +601,8 @@ func (o *AddRDSOKBody) validateMysqldExporter(formats strfmt.Registry) error { if err := o.MysqldExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRdsOk" + "." + "mysqld_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "mysqld_exporter") } return err } @@ -532,7 +612,6 @@ func (o *AddRDSOKBody) validateMysqldExporter(formats strfmt.Registry) error { } func (o *AddRDSOKBody) validateNode(formats strfmt.Registry) error { - if swag.IsZero(o.Node) { // not required return nil } @@ -541,6 +620,8 @@ func (o *AddRDSOKBody) validateNode(formats strfmt.Registry) error { if err := o.Node.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRdsOk" + "." + "node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "node") } return err } @@ -550,7 +631,6 @@ func (o *AddRDSOKBody) validateNode(formats strfmt.Registry) error { } func (o *AddRDSOKBody) validatePostgresql(formats strfmt.Registry) error { - if swag.IsZero(o.Postgresql) { // not required return nil } @@ -559,6 +639,8 @@ func (o *AddRDSOKBody) validatePostgresql(formats strfmt.Registry) error { if err := o.Postgresql.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRdsOk" + "." + "postgresql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "postgresql") } return err } @@ -568,7 +650,6 @@ func (o *AddRDSOKBody) validatePostgresql(formats strfmt.Registry) error { } func (o *AddRDSOKBody) validatePostgresqlExporter(formats strfmt.Registry) error { - if swag.IsZero(o.PostgresqlExporter) { // not required return nil } @@ -577,6 +658,8 @@ func (o *AddRDSOKBody) validatePostgresqlExporter(formats strfmt.Registry) error if err := o.PostgresqlExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRdsOk" + "." + "postgresql_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "postgresql_exporter") } return err } @@ -586,7 +669,6 @@ func (o *AddRDSOKBody) validatePostgresqlExporter(formats strfmt.Registry) error } func (o *AddRDSOKBody) validateQANMysqlPerfschema(formats strfmt.Registry) error { - if swag.IsZero(o.QANMysqlPerfschema) { // not required return nil } @@ -595,6 +677,8 @@ func (o *AddRDSOKBody) validateQANMysqlPerfschema(formats strfmt.Registry) error if err := o.QANMysqlPerfschema.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRdsOk" + "." + "qan_mysql_perfschema") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "qan_mysql_perfschema") } return err } @@ -604,7 +688,6 @@ func (o *AddRDSOKBody) validateQANMysqlPerfschema(formats strfmt.Registry) error } func (o *AddRDSOKBody) validateQANPostgresqlPgstatements(formats strfmt.Registry) error { - if swag.IsZero(o.QANPostgresqlPgstatements) { // not required return nil } @@ -613,6 +696,8 @@ func (o *AddRDSOKBody) validateQANPostgresqlPgstatements(formats strfmt.Registry if err := o.QANPostgresqlPgstatements.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRdsOk" + "." + "qan_postgresql_pgstatements") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "qan_postgresql_pgstatements") } return err } @@ -622,7 +707,6 @@ func (o *AddRDSOKBody) validateQANPostgresqlPgstatements(formats strfmt.Registry } func (o *AddRDSOKBody) validateRDSExporter(formats strfmt.Registry) error { - if swag.IsZero(o.RDSExporter) { // not required return nil } @@ -631,6 +715,178 @@ func (o *AddRDSOKBody) validateRDSExporter(formats strfmt.Registry) error { if err := o.RDSExporter.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addRdsOk" + "." + "rds_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "rds_exporter") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add RDS OK body based on the context it is used +func (o *AddRDSOKBody) 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 *AddRDSOKBody) contextValidateMysql(ctx context.Context, formats strfmt.Registry) error { + + if o.Mysql != nil { + if err := o.Mysql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRdsOk" + "." + "mysql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "mysql") + } + return err + } + } + + return nil +} + +func (o *AddRDSOKBody) contextValidateMysqldExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.MysqldExporter != nil { + if err := o.MysqldExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRdsOk" + "." + "mysqld_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "mysqld_exporter") + } + return err + } + } + + return nil +} + +func (o *AddRDSOKBody) contextValidateNode(ctx context.Context, formats strfmt.Registry) error { + + if o.Node != nil { + if err := o.Node.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRdsOk" + "." + "node") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "node") + } + return err + } + } + + return nil +} + +func (o *AddRDSOKBody) contextValidatePostgresql(ctx context.Context, formats strfmt.Registry) error { + + if o.Postgresql != nil { + if err := o.Postgresql.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRdsOk" + "." + "postgresql") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "postgresql") + } + return err + } + } + + return nil +} + +func (o *AddRDSOKBody) contextValidatePostgresqlExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.PostgresqlExporter != nil { + if err := o.PostgresqlExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRdsOk" + "." + "postgresql_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "postgresql_exporter") + } + return err + } + } + + return nil +} + +func (o *AddRDSOKBody) contextValidateQANMysqlPerfschema(ctx context.Context, formats strfmt.Registry) error { + + if o.QANMysqlPerfschema != nil { + if err := o.QANMysqlPerfschema.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRdsOk" + "." + "qan_mysql_perfschema") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "qan_mysql_perfschema") + } + return err + } + } + + return nil +} + +func (o *AddRDSOKBody) contextValidateQANPostgresqlPgstatements(ctx context.Context, formats strfmt.Registry) error { + + if o.QANPostgresqlPgstatements != nil { + if err := o.QANPostgresqlPgstatements.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRdsOk" + "." + "qan_postgresql_pgstatements") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "qan_postgresql_pgstatements") + } + return err + } + } + + return nil +} + +func (o *AddRDSOKBody) contextValidateRDSExporter(ctx context.Context, formats strfmt.Registry) error { + + if o.RDSExporter != nil { + if err := o.RDSExporter.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addRdsOk" + "." + "rds_exporter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addRdsOk" + "." + "rds_exporter") } return err } @@ -701,6 +957,11 @@ func (o *AddRDSOKBodyMysql) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add RDS OK body mysql based on context it is used +func (o *AddRDSOKBodyMysql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRDSOKBodyMysql) MarshalBinary() ([]byte, error) { if o == nil { @@ -768,6 +1029,12 @@ type AddRDSOKBodyMysqldExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // 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"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -778,12 +1045,6 @@ type AddRDSOKBodyMysqldExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE 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"` } // Validate validates this add RDS OK body mysqld exporter @@ -845,7 +1106,6 @@ func (o *AddRDSOKBodyMysqldExporter) validateStatusEnum(path, location string, v } func (o *AddRDSOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -858,6 +1118,11 @@ func (o *AddRDSOKBodyMysqldExporter) validateStatus(formats strfmt.Registry) err return nil } +// ContextValidate validates this add RDS OK body mysqld exporter based on context it is used +func (o *AddRDSOKBodyMysqldExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRDSOKBodyMysqldExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -908,6 +1173,11 @@ func (o *AddRDSOKBodyNode) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add RDS OK body node based on context it is used +func (o *AddRDSOKBodyNode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRDSOKBodyNode) MarshalBinary() ([]byte, error) { if o == nil { @@ -973,6 +1243,11 @@ func (o *AddRDSOKBodyPostgresql) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this add RDS OK body postgresql based on context it is used +func (o *AddRDSOKBodyPostgresql) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRDSOKBodyPostgresql) MarshalBinary() ([]byte, error) { if o == nil { @@ -1026,6 +1301,9 @@ type AddRDSOKBodyPostgresqlExporter struct { // List of disabled collector names. DisabledCollectors []string `json:"disabled_collectors"` + // Listen port for scraping metrics. + ListenPort int64 `json:"listen_port,omitempty"` + // AgentStatus represents actual Agent status. // // - STARTING: Agent is starting. @@ -1036,9 +1314,6 @@ type AddRDSOKBodyPostgresqlExporter struct { // - UNKNOWN: Agent is not connected, we don't know anything about it's state. // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] Status *string `json:"status,omitempty"` - - // Listen port for scraping metrics. - ListenPort int64 `json:"listen_port,omitempty"` } // Validate validates this add RDS OK body postgresql exporter @@ -1100,7 +1375,6 @@ func (o *AddRDSOKBodyPostgresqlExporter) validateStatusEnum(path, location strin } func (o *AddRDSOKBodyPostgresqlExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1113,6 +1387,11 @@ func (o *AddRDSOKBodyPostgresqlExporter) validateStatus(formats strfmt.Registry) return nil } +// ContextValidate validates this add RDS OK body postgresql exporter based on context it is used +func (o *AddRDSOKBodyPostgresqlExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRDSOKBodyPostgresqlExporter) MarshalBinary() ([]byte, error) { if o == nil { @@ -1243,7 +1522,6 @@ func (o *AddRDSOKBodyQANMysqlPerfschema) validateStatusEnum(path, location strin } func (o *AddRDSOKBodyQANMysqlPerfschema) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1256,6 +1534,11 @@ func (o *AddRDSOKBodyQANMysqlPerfschema) validateStatus(formats strfmt.Registry) return nil } +// ContextValidate validates this add RDS OK body QAN mysql perfschema based on context it is used +func (o *AddRDSOKBodyQANMysqlPerfschema) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRDSOKBodyQANMysqlPerfschema) MarshalBinary() ([]byte, error) { if o == nil { @@ -1374,7 +1657,6 @@ func (o *AddRDSOKBodyQANPostgresqlPgstatements) validateStatusEnum(path, locatio } func (o *AddRDSOKBodyQANPostgresqlPgstatements) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1387,6 +1669,11 @@ func (o *AddRDSOKBodyQANPostgresqlPgstatements) validateStatus(formats strfmt.Re return nil } +// ContextValidate validates this add RDS OK body QAN postgresql pgstatements based on context it is used +func (o *AddRDSOKBodyQANPostgresqlPgstatements) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AddRDSOKBodyQANPostgresqlPgstatements) MarshalBinary() ([]byte, error) { if o == nil { @@ -1428,17 +1715,6 @@ type AddRDSOKBodyRDSExporter struct { // Custom user-assigned labels. CustomLabels map[string]string `json:"custom_labels,omitempty"` - // AgentStatus represents actual Agent status. - // - // - STARTING: Agent is starting. - // - RUNNING: Agent is running. - // - WAITING: Agent encountered error and will be restarted automatically soon. - // - STOPPING: Agent is stopping. - // - DONE: Agent finished. - // - UNKNOWN: Agent is not connected, we don't know anything about it's state. - // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] - Status *string `json:"status,omitempty"` - // Listen port for scraping metrics (the same for several configurations). ListenPort int64 `json:"listen_port,omitempty"` @@ -1450,6 +1726,17 @@ type AddRDSOKBodyRDSExporter struct { // True if exporter uses push metrics mode. PushMetricsEnabled bool `json:"push_metrics_enabled,omitempty"` + + // AgentStatus represents actual Agent status. + // + // - STARTING: Agent is starting. + // - RUNNING: Agent is running. + // - WAITING: Agent encountered error and will be restarted automatically soon. + // - STOPPING: Agent is stopping. + // - DONE: Agent finished. + // - UNKNOWN: Agent is not connected, we don't know anything about it's state. + // Enum: [AGENT_STATUS_INVALID STARTING RUNNING WAITING STOPPING DONE UNKNOWN] + Status *string `json:"status,omitempty"` } // Validate validates this add RDS OK body RDS exporter @@ -1511,7 +1798,6 @@ func (o *AddRDSOKBodyRDSExporter) validateStatusEnum(path, location string, valu } func (o *AddRDSOKBodyRDSExporter) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required return nil } @@ -1524,44 +1810,13 @@ func (o *AddRDSOKBodyRDSExporter) validateStatus(formats strfmt.Registry) error return nil } -// MarshalBinary interface implementation -func (o *AddRDSOKBodyRDSExporter) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *AddRDSOKBodyRDSExporter) UnmarshalBinary(b []byte) error { - var res AddRDSOKBodyRDSExporter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// ContextValidate validates this add RDS OK body RDS exporter based on context it is used +func (o *AddRDSOKBodyRDSExporter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AddRDSOKBodyRDSExporter) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -1569,8 +1824,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AddRDSOKBodyRDSExporter) UnmarshalBinary(b []byte) error { + var res AddRDSOKBodyRDSExporter if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/rds/discover_rds_parameters.go b/api/managementpb/json/client/rds/discover_rds_parameters.go index bda04cac04..265e3660c1 100644 --- a/api/managementpb/json/client/rds/discover_rds_parameters.go +++ b/api/managementpb/json/client/rds/discover_rds_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDiscoverRDSParams creates a new DiscoverRDSParams object -// with the default values initialized. +// 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 { - var () return &DiscoverRDSParams{ - timeout: cr.DefaultTimeout, } } // NewDiscoverRDSParamsWithTimeout creates a new DiscoverRDSParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDiscoverRDSParamsWithTimeout(timeout time.Duration) *DiscoverRDSParams { - var () return &DiscoverRDSParams{ - timeout: timeout, } } // NewDiscoverRDSParamsWithContext creates a new DiscoverRDSParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDiscoverRDSParamsWithContext(ctx context.Context) *DiscoverRDSParams { - var () return &DiscoverRDSParams{ - Context: ctx, } } // NewDiscoverRDSParamsWithHTTPClient creates a new DiscoverRDSParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDiscoverRDSParamsWithHTTPClient(client *http.Client) *DiscoverRDSParams { - var () 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 +/* 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. Body DiscoverRDSBody timeout time.Duration @@ -68,6 +67,21 @@ type DiscoverRDSParams struct { 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) @@ -119,7 +133,6 @@ func (o *DiscoverRDSParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/rds/discover_rds_responses.go b/api/managementpb/json/client/rds/discover_rds_responses.go index 07bf9a9dac..91d2097e0a 100644 --- a/api/managementpb/json/client/rds/discover_rds_responses.go +++ b/api/managementpb/json/client/rds/discover_rds_responses.go @@ -6,6 +6,7 @@ package rds // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewDiscoverRDSOK() *DiscoverRDSOK { return &DiscoverRDSOK{} } -/*DiscoverRDSOK handles this case with default header values. +/* DiscoverRDSOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type DiscoverRDSOK struct { func (o *DiscoverRDSOK) Error() string { return fmt.Sprintf("[POST /v1/management/RDS/Discover][%d] discoverRdsOk %+v", 200, o.Payload) } - func (o *DiscoverRDSOK) GetPayload() *DiscoverRDSOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewDiscoverRDSDefault(code int) *DiscoverRDSDefault { } } -/*DiscoverRDSDefault handles this case with default header values. +/* DiscoverRDSDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *DiscoverRDSDefault) Code() int { func (o *DiscoverRDSDefault) Error() string { return fmt.Sprintf("[POST /v1/management/RDS/Discover][%d] DiscoverRDS default %+v", o._statusCode, o.Payload) } - func (o *DiscoverRDSDefault) GetPayload() *DiscoverRDSDefaultBody { return o.Payload } @@ -136,6 +135,11 @@ 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 { @@ -169,7 +173,7 @@ type DiscoverRDSDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*DiscoverRDSDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this discover RDS default body @@ -187,7 +191,6 @@ func (o *DiscoverRDSDefaultBody) Validate(formats strfmt.Registry) error { } func (o *DiscoverRDSDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -201,6 +204,42 @@ func (o *DiscoverRDSDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("DiscoverRDS default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -229,13 +268,54 @@ func (o *DiscoverRDSDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*DiscoverRDSDefaultBodyDetailsItems0 discover RDS default body details items0 +swagger:model DiscoverRDSDefaultBodyDetailsItems0 +*/ +type DiscoverRDSDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 []*RDSInstancesItems0 `json:"rds_instances"` + RDSInstances []*DiscoverRDSOKBodyRDSInstancesItems0 `json:"rds_instances"` } // Validate validates this discover RDS OK body @@ -253,7 +333,6 @@ func (o *DiscoverRDSOKBody) Validate(formats strfmt.Registry) error { } func (o *DiscoverRDSOKBody) validateRDSInstances(formats strfmt.Registry) error { - if swag.IsZero(o.RDSInstances) { // not required return nil } @@ -267,6 +346,42 @@ func (o *DiscoverRDSOKBody) validateRDSInstances(formats strfmt.Registry) error if err := o.RDSInstances[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.RDSInstances[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("discoverRdsOk" + "." + "rds_instances" + "." + strconv.Itoa(i)) } return err } @@ -295,10 +410,10 @@ func (o *DiscoverRDSOKBody) UnmarshalBinary(b []byte) error { return nil } -/*RDSInstancesItems0 DiscoverRDSInstance models an unique RDS instance for the list of instances returned by Discovery. -swagger:model RDSInstancesItems0 +/*DiscoverRDSOKBodyRDSInstancesItems0 DiscoverRDSInstance models an unique RDS instance for the list of instances returned by Discovery. +swagger:model DiscoverRDSOKBodyRDSInstancesItems0 */ -type RDSInstancesItems0 struct { +type DiscoverRDSOKBodyRDSInstancesItems0 struct { // AWS region. Region string `json:"region,omitempty"` @@ -318,16 +433,16 @@ type RDSInstancesItems0 struct { // Access port. Port int64 `json:"port,omitempty"` + // Engine version. + EngineVersion string `json:"engine_version,omitempty"` + // DiscoverRDSEngine describes supported RDS instance engines. // Enum: [DISCOVER_RDS_ENGINE_INVALID DISCOVER_RDS_MYSQL DISCOVER_RDS_POSTGRESQL] Engine *string `json:"engine,omitempty"` - - // Engine version. - EngineVersion string `json:"engine_version,omitempty"` } -// Validate validates this RDS instances items0 -func (o *RDSInstancesItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -340,7 +455,7 @@ func (o *RDSInstancesItems0) Validate(formats strfmt.Registry) error { return nil } -var rdsInstancesItems0TypeEnginePropEnum []interface{} +var discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum []interface{} func init() { var res []string @@ -348,32 +463,31 @@ func init() { panic(err) } for _, v := range res { - rdsInstancesItems0TypeEnginePropEnum = append(rdsInstancesItems0TypeEnginePropEnum, v) + discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum = append(discoverRdsOkBodyRdsInstancesItems0TypeEnginePropEnum, v) } } const ( - // RDSInstancesItems0EngineDISCOVERRDSENGINEINVALID captures enum value "DISCOVER_RDS_ENGINE_INVALID" - RDSInstancesItems0EngineDISCOVERRDSENGINEINVALID string = "DISCOVER_RDS_ENGINE_INVALID" + // DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSENGINEINVALID captures enum value "DISCOVER_RDS_ENGINE_INVALID" + DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSENGINEINVALID string = "DISCOVER_RDS_ENGINE_INVALID" - // RDSInstancesItems0EngineDISCOVERRDSMYSQL captures enum value "DISCOVER_RDS_MYSQL" - RDSInstancesItems0EngineDISCOVERRDSMYSQL string = "DISCOVER_RDS_MYSQL" + // DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSMYSQL captures enum value "DISCOVER_RDS_MYSQL" + DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSMYSQL string = "DISCOVER_RDS_MYSQL" - // RDSInstancesItems0EngineDISCOVERRDSPOSTGRESQL captures enum value "DISCOVER_RDS_POSTGRESQL" - RDSInstancesItems0EngineDISCOVERRDSPOSTGRESQL string = "DISCOVER_RDS_POSTGRESQL" + // DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSPOSTGRESQL captures enum value "DISCOVER_RDS_POSTGRESQL" + DiscoverRDSOKBodyRDSInstancesItems0EngineDISCOVERRDSPOSTGRESQL string = "DISCOVER_RDS_POSTGRESQL" ) // prop value enum -func (o *RDSInstancesItems0) validateEngineEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, rdsInstancesItems0TypeEnginePropEnum, true); err != nil { +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 *RDSInstancesItems0) validateEngine(formats strfmt.Registry) error { - +func (o *DiscoverRDSOKBodyRDSInstancesItems0) validateEngine(formats strfmt.Registry) error { if swag.IsZero(o.Engine) { // not required return nil } @@ -386,8 +500,13 @@ func (o *RDSInstancesItems0) validateEngine(formats strfmt.Registry) error { 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 *RDSInstancesItems0) MarshalBinary() ([]byte, error) { +func (o *DiscoverRDSOKBodyRDSInstancesItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -395,8 +514,8 @@ func (o *RDSInstancesItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *RDSInstancesItems0) UnmarshalBinary(b []byte) error { - var res RDSInstancesItems0 +func (o *DiscoverRDSOKBodyRDSInstancesItems0) UnmarshalBinary(b []byte) error { + var res DiscoverRDSOKBodyRDSInstancesItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/rds/rds_client.go b/api/managementpb/json/client/rds/rds_client.go index 330cc35271..59c417d0ec 100644 --- a/api/managementpb/json/client/rds/rds_client.go +++ b/api/managementpb/json/client/rds/rds_client.go @@ -23,11 +23,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AddRDS(params *AddRDSParams) (*AddRDSOK, error) + AddRDS(params *AddRDSParams, opts ...ClientOption) (*AddRDSOK, error) - DiscoverRDS(params *DiscoverRDSParams) (*DiscoverRDSOK, error) + DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (*DiscoverRDSOK, error) SetTransport(transport runtime.ClientTransport) } @@ -37,13 +40,12 @@ type ClientService interface { Adds RDS instance. */ -func (a *Client) AddRDS(params *AddRDSParams) (*AddRDSOK, error) { +func (a *Client) AddRDS(params *AddRDSParams, opts ...ClientOption) (*AddRDSOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAddRDSParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AddRDS", Method: "POST", PathPattern: "/v1/management/RDS/Add", @@ -54,7 +56,12 @@ func (a *Client) AddRDS(params *AddRDSParams) (*AddRDSOK, error) { Reader: &AddRDSReader{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 } @@ -72,13 +79,12 @@ func (a *Client) AddRDS(params *AddRDSParams) (*AddRDSOK, error) { Discovers RDS instances. */ -func (a *Client) DiscoverRDS(params *DiscoverRDSParams) (*DiscoverRDSOK, error) { +func (a *Client) DiscoverRDS(params *DiscoverRDSParams, opts ...ClientOption) (*DiscoverRDSOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDiscoverRDSParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "DiscoverRDS", Method: "POST", PathPattern: "/v1/management/RDS/Discover", @@ -89,7 +95,12 @@ func (a *Client) DiscoverRDS(params *DiscoverRDSParams) (*DiscoverRDSOK, error) 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 } diff --git a/api/managementpb/json/client/security_checks/change_security_checks_parameters.go b/api/managementpb/json/client/security_checks/change_security_checks_parameters.go index b4edc8f882..8699f8dbc7 100644 --- a/api/managementpb/json/client/security_checks/change_security_checks_parameters.go +++ b/api/managementpb/json/client/security_checks/change_security_checks_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeSecurityChecksParams creates a new ChangeSecurityChecksParams object -// with the default values initialized. +// NewChangeSecurityChecksParams creates a new ChangeSecurityChecksParams 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 NewChangeSecurityChecksParams() *ChangeSecurityChecksParams { - var () return &ChangeSecurityChecksParams{ - timeout: cr.DefaultTimeout, } } // NewChangeSecurityChecksParamsWithTimeout creates a new ChangeSecurityChecksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeSecurityChecksParamsWithTimeout(timeout time.Duration) *ChangeSecurityChecksParams { - var () return &ChangeSecurityChecksParams{ - timeout: timeout, } } // NewChangeSecurityChecksParamsWithContext creates a new ChangeSecurityChecksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeSecurityChecksParamsWithContext(ctx context.Context) *ChangeSecurityChecksParams { - var () return &ChangeSecurityChecksParams{ - Context: ctx, } } // NewChangeSecurityChecksParamsWithHTTPClient creates a new ChangeSecurityChecksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeSecurityChecksParamsWithHTTPClient(client *http.Client) *ChangeSecurityChecksParams { - var () return &ChangeSecurityChecksParams{ HTTPClient: client, } } -/*ChangeSecurityChecksParams contains all the parameters to send to the API endpoint -for the change security checks operation typically these are written to a http.Request +/* ChangeSecurityChecksParams contains all the parameters to send to the API endpoint + for the change security checks operation. + + Typically these are written to a http.Request. */ type ChangeSecurityChecksParams struct { - /*Body*/ + // Body. Body ChangeSecurityChecksBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeSecurityChecksParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the change security checks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeSecurityChecksParams) WithDefaults() *ChangeSecurityChecksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the change security checks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ChangeSecurityChecksParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the change security checks params func (o *ChangeSecurityChecksParams) WithTimeout(timeout time.Duration) *ChangeSecurityChecksParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ChangeSecurityChecksParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/security_checks/change_security_checks_responses.go b/api/managementpb/json/client/security_checks/change_security_checks_responses.go index 4c8bcc4bfd..04b838d149 100644 --- a/api/managementpb/json/client/security_checks/change_security_checks_responses.go +++ b/api/managementpb/json/client/security_checks/change_security_checks_responses.go @@ -6,6 +6,7 @@ package security_checks // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewChangeSecurityChecksOK() *ChangeSecurityChecksOK { return &ChangeSecurityChecksOK{} } -/*ChangeSecurityChecksOK handles this case with default header values. +/* ChangeSecurityChecksOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ChangeSecurityChecksOK struct { func (o *ChangeSecurityChecksOK) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/Change][%d] changeSecurityChecksOk %+v", 200, o.Payload) } - func (o *ChangeSecurityChecksOK) GetPayload() interface{} { return o.Payload } @@ -82,7 +82,7 @@ func NewChangeSecurityChecksDefault(code int) *ChangeSecurityChecksDefault { } } -/*ChangeSecurityChecksDefault handles this case with default header values. +/* ChangeSecurityChecksDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *ChangeSecurityChecksDefault) Code() int { func (o *ChangeSecurityChecksDefault) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/Change][%d] ChangeSecurityChecks default %+v", o._statusCode, o.Payload) } - func (o *ChangeSecurityChecksDefault) GetPayload() *ChangeSecurityChecksDefaultBody { return o.Payload } @@ -123,7 +122,7 @@ swagger:model ChangeSecurityChecksBody type ChangeSecurityChecksBody struct { // params - Params []*ParamsItems0 `json:"params"` + Params []*ChangeSecurityChecksParamsBodyParamsItems0 `json:"params"` } // Validate validates this change security checks body @@ -141,7 +140,6 @@ func (o *ChangeSecurityChecksBody) Validate(formats strfmt.Registry) error { } func (o *ChangeSecurityChecksBody) validateParams(formats strfmt.Registry) error { - if swag.IsZero(o.Params) { // not required return nil } @@ -155,6 +153,42 @@ func (o *ChangeSecurityChecksBody) validateParams(formats strfmt.Registry) error if err := o.Params[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change security checks body based on the context it is used +func (o *ChangeSecurityChecksBody) 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 *ChangeSecurityChecksBody) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Params); i++ { + + if o.Params[i] != nil { + if err := o.Params[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "params" + "." + strconv.Itoa(i)) } return err } @@ -198,7 +232,7 @@ type ChangeSecurityChecksDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeSecurityChecksDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change security checks default body @@ -216,7 +250,6 @@ func (o *ChangeSecurityChecksDefaultBody) Validate(formats strfmt.Registry) erro } func (o *ChangeSecurityChecksDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -230,6 +263,42 @@ func (o *ChangeSecurityChecksDefaultBody) validateDetails(formats strfmt.Registr if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this change security checks default body based on the context it is used +func (o *ChangeSecurityChecksDefaultBody) 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 *ChangeSecurityChecksDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -258,10 +327,10 @@ func (o *ChangeSecurityChecksDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*ChangeSecurityChecksDefaultBodyDetailsItems0 change security checks default body details items0 +swagger:model ChangeSecurityChecksDefaultBodyDetailsItems0 */ -type DetailsItems0 struct { +type ChangeSecurityChecksDefaultBodyDetailsItems0 struct { // type url TypeURL string `json:"type_url,omitempty"` @@ -271,13 +340,18 @@ type DetailsItems0 struct { Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this change security checks default body details items0 +func (o *ChangeSecurityChecksDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this change security checks default body details items0 based on context it is used +func (o *ChangeSecurityChecksDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *ChangeSecurityChecksDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -285,8 +359,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *ChangeSecurityChecksDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ChangeSecurityChecksDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -294,10 +368,10 @@ func (o *DetailsItems0) UnmarshalBinary(b []byte) error { return nil } -/*ParamsItems0 ChangeSecurityCheckParams specifies a single check parameters. -swagger:model ParamsItems0 +/*ChangeSecurityChecksParamsBodyParamsItems0 ChangeSecurityCheckParams specifies a single check parameters. +swagger:model ChangeSecurityChecksParamsBodyParamsItems0 */ -type ParamsItems0 struct { +type ChangeSecurityChecksParamsBodyParamsItems0 struct { // The name of the check to change. Name string `json:"name,omitempty"` @@ -313,8 +387,8 @@ type ParamsItems0 struct { Interval *string `json:"interval,omitempty"` } -// Validate validates this params items0 -func (o *ParamsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this change security checks params body params items0 +func (o *ChangeSecurityChecksParamsBodyParamsItems0) Validate(formats strfmt.Registry) error { var res []error if err := o.validateInterval(formats); err != nil { @@ -327,7 +401,7 @@ func (o *ParamsItems0) Validate(formats strfmt.Registry) error { return nil } -var paramsItems0TypeIntervalPropEnum []interface{} +var changeSecurityChecksParamsBodyParamsItems0TypeIntervalPropEnum []interface{} func init() { var res []string @@ -335,35 +409,34 @@ func init() { panic(err) } for _, v := range res { - paramsItems0TypeIntervalPropEnum = append(paramsItems0TypeIntervalPropEnum, v) + changeSecurityChecksParamsBodyParamsItems0TypeIntervalPropEnum = append(changeSecurityChecksParamsBodyParamsItems0TypeIntervalPropEnum, v) } } const ( - // ParamsItems0IntervalSECURITYCHECKINTERVALINVALID captures enum value "SECURITY_CHECK_INTERVAL_INVALID" - ParamsItems0IntervalSECURITYCHECKINTERVALINVALID string = "SECURITY_CHECK_INTERVAL_INVALID" + // ChangeSecurityChecksParamsBodyParamsItems0IntervalSECURITYCHECKINTERVALINVALID captures enum value "SECURITY_CHECK_INTERVAL_INVALID" + ChangeSecurityChecksParamsBodyParamsItems0IntervalSECURITYCHECKINTERVALINVALID string = "SECURITY_CHECK_INTERVAL_INVALID" - // ParamsItems0IntervalSTANDARD captures enum value "STANDARD" - ParamsItems0IntervalSTANDARD string = "STANDARD" + // ChangeSecurityChecksParamsBodyParamsItems0IntervalSTANDARD captures enum value "STANDARD" + ChangeSecurityChecksParamsBodyParamsItems0IntervalSTANDARD string = "STANDARD" - // ParamsItems0IntervalFREQUENT captures enum value "FREQUENT" - ParamsItems0IntervalFREQUENT string = "FREQUENT" + // ChangeSecurityChecksParamsBodyParamsItems0IntervalFREQUENT captures enum value "FREQUENT" + ChangeSecurityChecksParamsBodyParamsItems0IntervalFREQUENT string = "FREQUENT" - // ParamsItems0IntervalRARE captures enum value "RARE" - ParamsItems0IntervalRARE string = "RARE" + // ChangeSecurityChecksParamsBodyParamsItems0IntervalRARE captures enum value "RARE" + ChangeSecurityChecksParamsBodyParamsItems0IntervalRARE string = "RARE" ) // prop value enum -func (o *ParamsItems0) validateIntervalEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, paramsItems0TypeIntervalPropEnum, true); err != nil { +func (o *ChangeSecurityChecksParamsBodyParamsItems0) validateIntervalEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, changeSecurityChecksParamsBodyParamsItems0TypeIntervalPropEnum, true); err != nil { return err } return nil } -func (o *ParamsItems0) validateInterval(formats strfmt.Registry) error { - +func (o *ChangeSecurityChecksParamsBodyParamsItems0) validateInterval(formats strfmt.Registry) error { if swag.IsZero(o.Interval) { // not required return nil } @@ -376,8 +449,13 @@ func (o *ParamsItems0) validateInterval(formats strfmt.Registry) error { return nil } +// ContextValidate validates this change security checks params body params items0 based on context it is used +func (o *ChangeSecurityChecksParamsBodyParamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation -func (o *ParamsItems0) MarshalBinary() ([]byte, error) { +func (o *ChangeSecurityChecksParamsBodyParamsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -385,8 +463,8 @@ func (o *ParamsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ParamsItems0) UnmarshalBinary(b []byte) error { - var res ParamsItems0 +func (o *ChangeSecurityChecksParamsBodyParamsItems0) UnmarshalBinary(b []byte) error { + var res ChangeSecurityChecksParamsBodyParamsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/security_checks/get_failed_checks_parameters.go b/api/managementpb/json/client/security_checks/get_failed_checks_parameters.go index 8fb1bf6194..4151087fdd 100644 --- a/api/managementpb/json/client/security_checks/get_failed_checks_parameters.go +++ b/api/managementpb/json/client/security_checks/get_failed_checks_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetFailedChecksParams creates a new GetFailedChecksParams object -// with the default values initialized. +// 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 { - var () return &GetFailedChecksParams{ - timeout: cr.DefaultTimeout, } } // NewGetFailedChecksParamsWithTimeout creates a new GetFailedChecksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetFailedChecksParamsWithTimeout(timeout time.Duration) *GetFailedChecksParams { - var () return &GetFailedChecksParams{ - timeout: timeout, } } // NewGetFailedChecksParamsWithContext creates a new GetFailedChecksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetFailedChecksParamsWithContext(ctx context.Context) *GetFailedChecksParams { - var () return &GetFailedChecksParams{ - Context: ctx, } } // NewGetFailedChecksParamsWithHTTPClient creates a new GetFailedChecksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetFailedChecksParamsWithHTTPClient(client *http.Client) *GetFailedChecksParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body GetFailedChecksBody timeout time.Duration @@ -68,6 +67,21 @@ type GetFailedChecksParams struct { 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) @@ -119,7 +133,6 @@ func (o *GetFailedChecksParams) WriteToRequest(r runtime.ClientRequest, reg strf return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/security_checks/get_failed_checks_responses.go b/api/managementpb/json/client/security_checks/get_failed_checks_responses.go index d174969333..945bf9cda3 100644 --- a/api/managementpb/json/client/security_checks/get_failed_checks_responses.go +++ b/api/managementpb/json/client/security_checks/get_failed_checks_responses.go @@ -6,6 +6,7 @@ package security_checks // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewGetFailedChecksOK() *GetFailedChecksOK { return &GetFailedChecksOK{} } -/*GetFailedChecksOK handles this case with default header values. +/* GetFailedChecksOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type GetFailedChecksOK struct { func (o *GetFailedChecksOK) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/FailedChecks][%d] getFailedChecksOk %+v", 200, o.Payload) } - func (o *GetFailedChecksOK) GetPayload() *GetFailedChecksOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewGetFailedChecksDefault(code int) *GetFailedChecksDefault { } } -/*GetFailedChecksDefault handles this case with default header values. +/* GetFailedChecksDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *GetFailedChecksDefault) Code() int { func (o *GetFailedChecksDefault) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/FailedChecks][%d] GetFailedChecks default %+v", o._statusCode, o.Payload) } - func (o *GetFailedChecksDefault) GetPayload() *GetFailedChecksDefaultBody { return o.Payload } @@ -146,7 +145,6 @@ func (o *GetFailedChecksBody) Validate(formats strfmt.Registry) error { } func (o *GetFailedChecksBody) validatePageParams(formats strfmt.Registry) error { - if swag.IsZero(o.PageParams) { // not required return nil } @@ -155,6 +153,38 @@ func (o *GetFailedChecksBody) validatePageParams(formats strfmt.Registry) error if err := o.PageParams.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "page_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "page_params") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get failed checks body based on the context it is used +func (o *GetFailedChecksBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePageParams(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetFailedChecksBody) contextValidatePageParams(ctx context.Context, formats strfmt.Registry) error { + + if o.PageParams != nil { + if err := o.PageParams.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "page_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "page_params") } return err } @@ -196,7 +226,7 @@ type GetFailedChecksDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetFailedChecksDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get failed checks default body @@ -214,7 +244,6 @@ func (o *GetFailedChecksDefaultBody) Validate(formats strfmt.Registry) error { } func (o *GetFailedChecksDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -228,6 +257,42 @@ func (o *GetFailedChecksDefaultBody) validateDetails(formats strfmt.Registry) er if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetFailedChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetFailedChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetFailedChecks default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -256,13 +321,54 @@ func (o *GetFailedChecksDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetFailedChecksDefaultBodyDetailsItems0 get failed checks default body details items0 +swagger:model GetFailedChecksDefaultBodyDetailsItems0 +*/ +type GetFailedChecksDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 { // results - Results []*ResultsItems0 `json:"results"` + Results []*GetFailedChecksOKBodyResultsItems0 `json:"results"` // page totals PageTotals *GetFailedChecksOKBodyPageTotals `json:"page_totals,omitempty"` @@ -287,7 +393,6 @@ func (o *GetFailedChecksOKBody) Validate(formats strfmt.Registry) error { } func (o *GetFailedChecksOKBody) validateResults(formats strfmt.Registry) error { - if swag.IsZero(o.Results) { // not required return nil } @@ -301,6 +406,8 @@ func (o *GetFailedChecksOKBody) validateResults(formats strfmt.Registry) error { if err := o.Results[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getFailedChecksOk" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getFailedChecksOk" + "." + "results" + "." + strconv.Itoa(i)) } return err } @@ -312,7 +419,6 @@ func (o *GetFailedChecksOKBody) validateResults(formats strfmt.Registry) error { } func (o *GetFailedChecksOKBody) validatePageTotals(formats strfmt.Registry) error { - if swag.IsZero(o.PageTotals) { // not required return nil } @@ -321,6 +427,62 @@ func (o *GetFailedChecksOKBody) validatePageTotals(formats strfmt.Registry) erro if err := o.PageTotals.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getFailedChecksOk" + "." + "page_totals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getFailedChecksOk" + "." + "page_totals") + } + 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 err := o.contextValidatePageTotals(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 err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getFailedChecksOk" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getFailedChecksOk" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (o *GetFailedChecksOKBody) contextValidatePageTotals(ctx context.Context, formats strfmt.Registry) error { + + if o.PageTotals != nil { + if err := o.PageTotals.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getFailedChecksOk" + "." + "page_totals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getFailedChecksOk" + "." + "page_totals") } return err } @@ -364,43 +526,13 @@ func (o *GetFailedChecksOKBodyPageTotals) Validate(formats strfmt.Registry) erro return nil } -// MarshalBinary interface implementation -func (o *GetFailedChecksOKBodyPageTotals) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetFailedChecksOKBodyPageTotals) UnmarshalBinary(b []byte) error { - var res GetFailedChecksOKBodyPageTotals - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*GetFailedChecksParamsBodyPageParams PageParams represents page request parameters for pagination. -swagger:model GetFailedChecksParamsBodyPageParams -*/ -type GetFailedChecksParamsBodyPageParams struct { - - // Maximum number of results per page. - PageSize int32 `json:"page_size,omitempty"` - - // Index of the requested page, starts from 0. - Index int32 `json:"index,omitempty"` -} - -// Validate validates this get failed checks params body page params -func (o *GetFailedChecksParamsBodyPageParams) Validate(formats strfmt.Registry) error { +// ContextValidate validates this get failed checks OK body page totals based on context it is used +func (o *GetFailedChecksOKBodyPageTotals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *GetFailedChecksParamsBodyPageParams) MarshalBinary() ([]byte, error) { +func (o *GetFailedChecksOKBodyPageTotals) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -408,8 +540,8 @@ func (o *GetFailedChecksParamsBodyPageParams) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *GetFailedChecksParamsBodyPageParams) UnmarshalBinary(b []byte) error { - var res GetFailedChecksParamsBodyPageParams +func (o *GetFailedChecksOKBodyPageTotals) UnmarshalBinary(b []byte) error { + var res GetFailedChecksOKBodyPageTotals if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -417,10 +549,10 @@ func (o *GetFailedChecksParamsBodyPageParams) UnmarshalBinary(b []byte) error { return nil } -/*ResultsItems0 CheckResult represents the check results for a given service. -swagger:model ResultsItems0 +/*GetFailedChecksOKBodyResultsItems0 CheckResult represents the check results for a given service. +swagger:model GetFailedChecksOKBodyResultsItems0 */ -type ResultsItems0 struct { +type GetFailedChecksOKBodyResultsItems0 struct { // summary Summary string `json:"summary,omitempty"` @@ -428,10 +560,6 @@ type ResultsItems0 struct { // description Description string `json:"description,omitempty"` - // Severity represents severity level of the check result or alert. - // Enum: [SEVERITY_INVALID 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"` @@ -452,10 +580,14 @@ type ResultsItems0 struct { // Silence status of the check result Silenced bool `json:"silenced,omitempty"` + + // Severity represents severity level of the check result or alert. + // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] + Severity *string `json:"severity,omitempty"` } -// Validate validates this results items0 -func (o *ResultsItems0) Validate(formats strfmt.Registry) error { +// 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 { @@ -468,7 +600,7 @@ func (o *ResultsItems0) Validate(formats strfmt.Registry) error { return nil } -var resultsItems0TypeSeverityPropEnum []interface{} +var getFailedChecksOkBodyResultsItems0TypeSeverityPropEnum []interface{} func init() { var res []string @@ -476,50 +608,49 @@ func init() { panic(err) } for _, v := range res { - resultsItems0TypeSeverityPropEnum = append(resultsItems0TypeSeverityPropEnum, v) + getFailedChecksOkBodyResultsItems0TypeSeverityPropEnum = append(getFailedChecksOkBodyResultsItems0TypeSeverityPropEnum, v) } } const ( - // ResultsItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" - ResultsItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" + // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" + GetFailedChecksOKBodyResultsItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" - // ResultsItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" - ResultsItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" + // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" + GetFailedChecksOKBodyResultsItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" - // ResultsItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" - ResultsItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" + // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" + GetFailedChecksOKBodyResultsItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" - // ResultsItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" - ResultsItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" + // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" + GetFailedChecksOKBodyResultsItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" - // ResultsItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" - ResultsItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" + // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" + GetFailedChecksOKBodyResultsItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" - // ResultsItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" - ResultsItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" + // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" + GetFailedChecksOKBodyResultsItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" - // ResultsItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" - ResultsItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" + // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" + GetFailedChecksOKBodyResultsItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" - // ResultsItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" - ResultsItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" + // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" + GetFailedChecksOKBodyResultsItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" - // ResultsItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" - ResultsItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" + // GetFailedChecksOKBodyResultsItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" + GetFailedChecksOKBodyResultsItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" ) // prop value enum -func (o *ResultsItems0) validateSeverityEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, resultsItems0TypeSeverityPropEnum, true); err != nil { +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 *ResultsItems0) validateSeverity(formats strfmt.Registry) error { - +func (o *GetFailedChecksOKBodyResultsItems0) validateSeverity(formats strfmt.Registry) error { if swag.IsZero(o.Severity) { // not required return nil } @@ -532,8 +663,13 @@ func (o *ResultsItems0) validateSeverity(formats strfmt.Registry) error { 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 *ResultsItems0) MarshalBinary() ([]byte, error) { +func (o *GetFailedChecksOKBodyResultsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -541,8 +677,48 @@ func (o *ResultsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ResultsItems0) UnmarshalBinary(b []byte) error { - var res ResultsItems0 +func (o *GetFailedChecksOKBodyResultsItems0) UnmarshalBinary(b []byte) error { + var res GetFailedChecksOKBodyResultsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetFailedChecksParamsBodyPageParams PageParams represents page request parameters for pagination. +swagger:model GetFailedChecksParamsBodyPageParams +*/ +type GetFailedChecksParamsBodyPageParams struct { + + // Maximum number of results per page. + PageSize int32 `json:"page_size,omitempty"` + + // Index of the requested page, starts from 0. + Index int32 `json:"index,omitempty"` +} + +// Validate validates this get failed checks params body page params +func (o *GetFailedChecksParamsBodyPageParams) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get failed checks params body page params based on context it is used +func (o *GetFailedChecksParamsBodyPageParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetFailedChecksParamsBodyPageParams) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetFailedChecksParamsBodyPageParams) UnmarshalBinary(b []byte) error { + var res GetFailedChecksParamsBodyPageParams if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/security_checks/get_security_check_results_parameters.go b/api/managementpb/json/client/security_checks/get_security_check_results_parameters.go index b3dbe333b6..d8356a883b 100644 --- a/api/managementpb/json/client/security_checks/get_security_check_results_parameters.go +++ b/api/managementpb/json/client/security_checks/get_security_check_results_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSecurityCheckResultsParams creates a new GetSecurityCheckResultsParams object -// with the default values initialized. +// NewGetSecurityCheckResultsParams creates a new GetSecurityCheckResultsParams 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 NewGetSecurityCheckResultsParams() *GetSecurityCheckResultsParams { - var () return &GetSecurityCheckResultsParams{ - timeout: cr.DefaultTimeout, } } // NewGetSecurityCheckResultsParamsWithTimeout creates a new GetSecurityCheckResultsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetSecurityCheckResultsParamsWithTimeout(timeout time.Duration) *GetSecurityCheckResultsParams { - var () return &GetSecurityCheckResultsParams{ - timeout: timeout, } } // NewGetSecurityCheckResultsParamsWithContext creates a new GetSecurityCheckResultsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetSecurityCheckResultsParamsWithContext(ctx context.Context) *GetSecurityCheckResultsParams { - var () return &GetSecurityCheckResultsParams{ - Context: ctx, } } // NewGetSecurityCheckResultsParamsWithHTTPClient creates a new GetSecurityCheckResultsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetSecurityCheckResultsParamsWithHTTPClient(client *http.Client) *GetSecurityCheckResultsParams { - var () return &GetSecurityCheckResultsParams{ HTTPClient: client, } } -/*GetSecurityCheckResultsParams contains all the parameters to send to the API endpoint -for the get security check results operation typically these are written to a http.Request +/* GetSecurityCheckResultsParams contains all the parameters to send to the API endpoint + for the get security check results operation. + + Typically these are written to a http.Request. */ type GetSecurityCheckResultsParams struct { - /*Body*/ + // Body. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type GetSecurityCheckResultsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get security check results params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSecurityCheckResultsParams) WithDefaults() *GetSecurityCheckResultsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get security check results params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSecurityCheckResultsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get security check results params func (o *GetSecurityCheckResultsParams) WithTimeout(timeout time.Duration) *GetSecurityCheckResultsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *GetSecurityCheckResultsParams) WriteToRequest(r runtime.ClientRequest, return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/managementpb/json/client/security_checks/get_security_check_results_responses.go b/api/managementpb/json/client/security_checks/get_security_check_results_responses.go index dcc55d81c3..02fb0ed0d2 100644 --- a/api/managementpb/json/client/security_checks/get_security_check_results_responses.go +++ b/api/managementpb/json/client/security_checks/get_security_check_results_responses.go @@ -6,6 +6,8 @@ package security_checks // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "encoding/json" "fmt" "io" "strconv" @@ -14,6 +16,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // GetSecurityCheckResultsReader is a Reader for the GetSecurityCheckResults structure. @@ -47,7 +50,7 @@ func NewGetSecurityCheckResultsOK() *GetSecurityCheckResultsOK { return &GetSecurityCheckResultsOK{} } -/*GetSecurityCheckResultsOK handles this case with default header values. +/* GetSecurityCheckResultsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +61,6 @@ type GetSecurityCheckResultsOK struct { func (o *GetSecurityCheckResultsOK) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/GetCheckResults][%d] getSecurityCheckResultsOk %+v", 200, o.Payload) } - func (o *GetSecurityCheckResultsOK) GetPayload() *GetSecurityCheckResultsOKBody { return o.Payload } @@ -82,7 +84,7 @@ func NewGetSecurityCheckResultsDefault(code int) *GetSecurityCheckResultsDefault } } -/*GetSecurityCheckResultsDefault handles this case with default header values. +/* GetSecurityCheckResultsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +102,6 @@ func (o *GetSecurityCheckResultsDefault) Code() int { func (o *GetSecurityCheckResultsDefault) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/GetCheckResults][%d] GetSecurityCheckResults default %+v", o._statusCode, o.Payload) } - func (o *GetSecurityCheckResultsDefault) GetPayload() *GetSecurityCheckResultsDefaultBody { return o.Payload } @@ -132,7 +133,7 @@ type GetSecurityCheckResultsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetSecurityCheckResultsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get security check results default body @@ -150,7 +151,6 @@ func (o *GetSecurityCheckResultsDefaultBody) Validate(formats strfmt.Registry) e } func (o *GetSecurityCheckResultsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -164,6 +164,42 @@ func (o *GetSecurityCheckResultsDefaultBody) validateDetails(formats strfmt.Regi if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetSecurityCheckResults default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetSecurityCheckResults default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get security check results default body based on the context it is used +func (o *GetSecurityCheckResultsDefaultBody) 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 *GetSecurityCheckResultsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetSecurityCheckResults default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetSecurityCheckResults default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -192,13 +228,54 @@ func (o *GetSecurityCheckResultsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetSecurityCheckResultsDefaultBodyDetailsItems0 get security check results default body details items0 +swagger:model GetSecurityCheckResultsDefaultBodyDetailsItems0 +*/ +type GetSecurityCheckResultsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this get security check results default body details items0 +func (o *GetSecurityCheckResultsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get security check results default body details items0 based on context it is used +func (o *GetSecurityCheckResultsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetSecurityCheckResultsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetSecurityCheckResultsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res GetSecurityCheckResultsDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*GetSecurityCheckResultsOKBody get security check results OK body swagger:model GetSecurityCheckResultsOKBody */ type GetSecurityCheckResultsOKBody struct { // results - Results []*ResultsItems0 `json:"results"` + Results []*GetSecurityCheckResultsOKBodyResultsItems0 `json:"results"` } // Validate validates this get security check results OK body @@ -216,7 +293,6 @@ func (o *GetSecurityCheckResultsOKBody) Validate(formats strfmt.Registry) error } func (o *GetSecurityCheckResultsOKBody) validateResults(formats strfmt.Registry) error { - if swag.IsZero(o.Results) { // not required return nil } @@ -230,6 +306,42 @@ func (o *GetSecurityCheckResultsOKBody) validateResults(formats strfmt.Registry) if err := o.Results[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSecurityCheckResultsOk" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSecurityCheckResultsOk" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get security check results OK body based on the context it is used +func (o *GetSecurityCheckResultsOKBody) 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 *GetSecurityCheckResultsOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getSecurityCheckResultsOk" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSecurityCheckResultsOk" + "." + "results" + "." + strconv.Itoa(i)) } return err } @@ -257,3 +369,128 @@ func (o *GetSecurityCheckResultsOKBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*GetSecurityCheckResultsOKBodyResultsItems0 SecurityCheckResult represents the check result returned from pmm-managed after running the check. +swagger:model GetSecurityCheckResultsOKBodyResultsItems0 +*/ +type GetSecurityCheckResultsOKBodyResultsItems0 struct { + + // summary + Summary string `json:"summary,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // labels + Labels map[string]string `json:"labels,omitempty"` + + // URL containing information on how to resolve an issue detected by an STT check. + ReadMoreURL string `json:"read_more_url,omitempty"` + + // Name of the monitored service on which the check ran. + ServiceName string `json:"service_name,omitempty"` + + // Severity represents severity level of the check result or alert. + // Enum: [SEVERITY_INVALID SEVERITY_EMERGENCY SEVERITY_ALERT SEVERITY_CRITICAL SEVERITY_ERROR SEVERITY_WARNING SEVERITY_NOTICE SEVERITY_INFO SEVERITY_DEBUG] + Severity *string `json:"severity,omitempty"` +} + +// Validate validates this get security check results OK body results items0 +func (o *GetSecurityCheckResultsOKBodyResultsItems0) 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 getSecurityCheckResultsOkBodyResultsItems0TypeSeverityPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SEVERITY_INVALID","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 { + getSecurityCheckResultsOkBodyResultsItems0TypeSeverityPropEnum = append(getSecurityCheckResultsOkBodyResultsItems0TypeSeverityPropEnum, v) + } +} + +const ( + + // GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYINVALID captures enum value "SEVERITY_INVALID" + GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYINVALID string = "SEVERITY_INVALID" + + // GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYEMERGENCY captures enum value "SEVERITY_EMERGENCY" + GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYEMERGENCY string = "SEVERITY_EMERGENCY" + + // GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYALERT captures enum value "SEVERITY_ALERT" + GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYALERT string = "SEVERITY_ALERT" + + // GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYCRITICAL captures enum value "SEVERITY_CRITICAL" + GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYCRITICAL string = "SEVERITY_CRITICAL" + + // GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYERROR captures enum value "SEVERITY_ERROR" + GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYERROR string = "SEVERITY_ERROR" + + // GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYWARNING captures enum value "SEVERITY_WARNING" + GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYWARNING string = "SEVERITY_WARNING" + + // GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYNOTICE captures enum value "SEVERITY_NOTICE" + GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYNOTICE string = "SEVERITY_NOTICE" + + // GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYINFO captures enum value "SEVERITY_INFO" + GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYINFO string = "SEVERITY_INFO" + + // GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYDEBUG captures enum value "SEVERITY_DEBUG" + GetSecurityCheckResultsOKBodyResultsItems0SeveritySEVERITYDEBUG string = "SEVERITY_DEBUG" +) + +// prop value enum +func (o *GetSecurityCheckResultsOKBodyResultsItems0) validateSeverityEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, getSecurityCheckResultsOkBodyResultsItems0TypeSeverityPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *GetSecurityCheckResultsOKBodyResultsItems0) 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 security check results OK body results items0 based on context it is used +func (o *GetSecurityCheckResultsOKBodyResultsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetSecurityCheckResultsOKBodyResultsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetSecurityCheckResultsOKBodyResultsItems0) UnmarshalBinary(b []byte) error { + var res GetSecurityCheckResultsOKBodyResultsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/json/client/security_checks/list_failed_services_parameters.go b/api/managementpb/json/client/security_checks/list_failed_services_parameters.go index 21d516c4e9..5f6406eefe 100644 --- a/api/managementpb/json/client/security_checks/list_failed_services_parameters.go +++ b/api/managementpb/json/client/security_checks/list_failed_services_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListFailedServicesParams creates a new ListFailedServicesParams object -// with the default values initialized. +// 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 { - var () return &ListFailedServicesParams{ - timeout: cr.DefaultTimeout, } } // NewListFailedServicesParamsWithTimeout creates a new ListFailedServicesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListFailedServicesParamsWithTimeout(timeout time.Duration) *ListFailedServicesParams { - var () return &ListFailedServicesParams{ - timeout: timeout, } } // NewListFailedServicesParamsWithContext creates a new ListFailedServicesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListFailedServicesParamsWithContext(ctx context.Context) *ListFailedServicesParams { - var () return &ListFailedServicesParams{ - Context: ctx, } } // NewListFailedServicesParamsWithHTTPClient creates a new ListFailedServicesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListFailedServicesParamsWithHTTPClient(client *http.Client) *ListFailedServicesParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type ListFailedServicesParams struct { 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) @@ -119,7 +133,6 @@ func (o *ListFailedServicesParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/managementpb/json/client/security_checks/list_failed_services_responses.go b/api/managementpb/json/client/security_checks/list_failed_services_responses.go index 69d2a63cde..2e0ce9f70c 100644 --- a/api/managementpb/json/client/security_checks/list_failed_services_responses.go +++ b/api/managementpb/json/client/security_checks/list_failed_services_responses.go @@ -6,6 +6,7 @@ package security_checks // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewListFailedServicesOK() *ListFailedServicesOK { return &ListFailedServicesOK{} } -/*ListFailedServicesOK handles this case with default header values. +/* ListFailedServicesOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ListFailedServicesOK struct { func (o *ListFailedServicesOK) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/ListFailedServices][%d] listFailedServicesOk %+v", 200, o.Payload) } - func (o *ListFailedServicesOK) GetPayload() *ListFailedServicesOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewListFailedServicesDefault(code int) *ListFailedServicesDefault { } } -/*ListFailedServicesDefault handles this case with default header values. +/* ListFailedServicesDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *ListFailedServicesDefault) Code() int { func (o *ListFailedServicesDefault) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/ListFailedServices][%d] ListFailedServices default %+v", o._statusCode, o.Payload) } - func (o *ListFailedServicesDefault) GetPayload() *ListFailedServicesDefaultBody { return o.Payload } @@ -132,7 +131,7 @@ type ListFailedServicesDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ListFailedServicesDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this list failed services default body @@ -150,7 +149,6 @@ func (o *ListFailedServicesDefaultBody) Validate(formats strfmt.Registry) error } func (o *ListFailedServicesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -164,6 +162,42 @@ func (o *ListFailedServicesDefaultBody) validateDetails(formats strfmt.Registry) if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ListFailedServices default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListFailedServices default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListFailedServices default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -192,13 +226,54 @@ func (o *ListFailedServicesDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ListFailedServicesDefaultBodyDetailsItems0 list failed services default body details items0 +swagger:model ListFailedServicesDefaultBodyDetailsItems0 +*/ +type ListFailedServicesDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 []*ResultItems0 `json:"result"` + Result []*ListFailedServicesOKBodyResultItems0 `json:"result"` } // Validate validates this list failed services OK body @@ -216,7 +291,6 @@ func (o *ListFailedServicesOKBody) Validate(formats strfmt.Registry) error { } func (o *ListFailedServicesOKBody) validateResult(formats strfmt.Registry) error { - if swag.IsZero(o.Result) { // not required return nil } @@ -230,6 +304,42 @@ func (o *ListFailedServicesOKBody) validateResult(formats strfmt.Registry) error if err := o.Result[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listFailedServicesOk" + "." + "result" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Result[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listFailedServicesOk" + "." + "result" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listFailedServicesOk" + "." + "result" + "." + strconv.Itoa(i)) } return err } @@ -258,10 +368,10 @@ func (o *ListFailedServicesOKBody) UnmarshalBinary(b []byte) error { return nil } -/*ResultItems0 CheckResultSummary is a summary of check results. -swagger:model ResultItems0 +/*ListFailedServicesOKBodyResultItems0 CheckResultSummary is a summary of check results. +swagger:model ListFailedServicesOKBodyResultItems0 */ -type ResultItems0 struct { +type ListFailedServicesOKBodyResultItems0 struct { // service name ServiceName string `json:"service_name,omitempty"` @@ -294,13 +404,18 @@ type ResultItems0 struct { DebugCount int64 `json:"debug_count,omitempty"` } -// Validate validates this result items0 -func (o *ResultItems0) Validate(formats strfmt.Registry) error { +// 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 *ResultItems0) MarshalBinary() ([]byte, error) { +func (o *ListFailedServicesOKBodyResultItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -308,8 +423,8 @@ func (o *ResultItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ResultItems0) UnmarshalBinary(b []byte) error { - var res ResultItems0 +func (o *ListFailedServicesOKBodyResultItems0) UnmarshalBinary(b []byte) error { + var res ListFailedServicesOKBodyResultItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/managementpb/json/client/security_checks/list_security_checks_parameters.go b/api/managementpb/json/client/security_checks/list_security_checks_parameters.go index a08565eb87..a209426fb0 100644 --- a/api/managementpb/json/client/security_checks/list_security_checks_parameters.go +++ b/api/managementpb/json/client/security_checks/list_security_checks_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListSecurityChecksParams creates a new ListSecurityChecksParams object -// with the default values initialized. +// NewListSecurityChecksParams creates a new ListSecurityChecksParams 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 NewListSecurityChecksParams() *ListSecurityChecksParams { - var () return &ListSecurityChecksParams{ - timeout: cr.DefaultTimeout, } } // NewListSecurityChecksParamsWithTimeout creates a new ListSecurityChecksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListSecurityChecksParamsWithTimeout(timeout time.Duration) *ListSecurityChecksParams { - var () return &ListSecurityChecksParams{ - timeout: timeout, } } // NewListSecurityChecksParamsWithContext creates a new ListSecurityChecksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListSecurityChecksParamsWithContext(ctx context.Context) *ListSecurityChecksParams { - var () return &ListSecurityChecksParams{ - Context: ctx, } } // NewListSecurityChecksParamsWithHTTPClient creates a new ListSecurityChecksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListSecurityChecksParamsWithHTTPClient(client *http.Client) *ListSecurityChecksParams { - var () return &ListSecurityChecksParams{ HTTPClient: client, } } -/*ListSecurityChecksParams contains all the parameters to send to the API endpoint -for the list security checks operation typically these are written to a http.Request +/* ListSecurityChecksParams contains all the parameters to send to the API endpoint + for the list security checks operation. + + Typically these are written to a http.Request. */ type ListSecurityChecksParams struct { - /*Body*/ + // Body. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type ListSecurityChecksParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list security checks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSecurityChecksParams) WithDefaults() *ListSecurityChecksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list security checks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSecurityChecksParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list security checks params func (o *ListSecurityChecksParams) WithTimeout(timeout time.Duration) *ListSecurityChecksParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ListSecurityChecksParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/managementpb/json/client/security_checks/list_security_checks_responses.go b/api/managementpb/json/client/security_checks/list_security_checks_responses.go index 70f74ca3df..fc43fd85cf 100644 --- a/api/managementpb/json/client/security_checks/list_security_checks_responses.go +++ b/api/managementpb/json/client/security_checks/list_security_checks_responses.go @@ -6,6 +6,7 @@ package security_checks // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewListSecurityChecksOK() *ListSecurityChecksOK { return &ListSecurityChecksOK{} } -/*ListSecurityChecksOK handles this case with default header values. +/* ListSecurityChecksOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type ListSecurityChecksOK struct { func (o *ListSecurityChecksOK) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/List][%d] listSecurityChecksOk %+v", 200, o.Payload) } - func (o *ListSecurityChecksOK) GetPayload() *ListSecurityChecksOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewListSecurityChecksDefault(code int) *ListSecurityChecksDefault { } } -/*ListSecurityChecksDefault handles this case with default header values. +/* ListSecurityChecksDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *ListSecurityChecksDefault) Code() int { func (o *ListSecurityChecksDefault) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/List][%d] ListSecurityChecks default %+v", o._statusCode, o.Payload) } - func (o *ListSecurityChecksDefault) GetPayload() *ListSecurityChecksDefaultBody { return o.Payload } @@ -119,33 +118,29 @@ func (o *ListSecurityChecksDefault) readResponse(response runtime.ClientResponse return nil } -/*ChecksItems0 SecurityCheck contains check name and status. -swagger:model ChecksItems0 +/*ListSecurityChecksDefaultBody list security checks default body +swagger:model ListSecurityChecksDefaultBody */ -type ChecksItems0 struct { - - // Machine-readable name (ID) that is used in expression. - Name string `json:"name,omitempty"` +type ListSecurityChecksDefaultBody struct { - // True if that check is disabled. - Disabled bool `json:"disabled,omitempty"` + // error + Error string `json:"error,omitempty"` - // Long human-readable description. - Description string `json:"description,omitempty"` + // code + Code int32 `json:"code,omitempty"` - // Short human-readable summary. - Summary string `json:"summary,omitempty"` + // message + Message string `json:"message,omitempty"` - // SecurityCheckInterval represents possible execution interval values for checks. - // Enum: [SECURITY_CHECK_INTERVAL_INVALID STANDARD FREQUENT RARE] - Interval *string `json:"interval,omitempty"` + // details + Details []*ListSecurityChecksDefaultBodyDetailsItems0 `json:"details"` } -// Validate validates this checks items0 -func (o *ChecksItems0) Validate(formats strfmt.Registry) error { +// Validate validates this list security checks default body +func (o *ListSecurityChecksDefaultBody) Validate(formats strfmt.Registry) error { var res []error - if err := o.validateInterval(formats); err != nil { + if err := o.validateDetails(formats); err != nil { res = append(res, err) } @@ -155,57 +150,68 @@ func (o *ChecksItems0) Validate(formats strfmt.Registry) error { return nil } -var checksItems0TypeIntervalPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SECURITY_CHECK_INTERVAL_INVALID","STANDARD","FREQUENT","RARE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - checksItems0TypeIntervalPropEnum = append(checksItems0TypeIntervalPropEnum, v) +func (o *ListSecurityChecksDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil } -} -const ( + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } - // ChecksItems0IntervalSECURITYCHECKINTERVALINVALID captures enum value "SECURITY_CHECK_INTERVAL_INVALID" - ChecksItems0IntervalSECURITYCHECKINTERVALINVALID string = "SECURITY_CHECK_INTERVAL_INVALID" + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } - // ChecksItems0IntervalSTANDARD captures enum value "STANDARD" - ChecksItems0IntervalSTANDARD string = "STANDARD" + } - // ChecksItems0IntervalFREQUENT captures enum value "FREQUENT" - ChecksItems0IntervalFREQUENT string = "FREQUENT" + return nil +} - // ChecksItems0IntervalRARE captures enum value "RARE" - ChecksItems0IntervalRARE string = "RARE" -) +// ContextValidate validate this list security checks default body based on the context it is used +func (o *ListSecurityChecksDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error -// prop value enum -func (o *ChecksItems0) validateIntervalEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, checksItems0TypeIntervalPropEnum, true); err != nil { - return err + if err := o.contextValidateDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) } return nil } -func (o *ChecksItems0) validateInterval(formats strfmt.Registry) error { +func (o *ListSecurityChecksDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(o.Interval) { // not required - return nil - } + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ListSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } - // value enum - if err := o.validateIntervalEnum("interval", "body", *o.Interval); err != nil { - return err } return nil } // MarshalBinary interface implementation -func (o *ChecksItems0) MarshalBinary() ([]byte, error) { +func (o *ListSecurityChecksDefaultBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -213,8 +219,8 @@ func (o *ChecksItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ChecksItems0) UnmarshalBinary(b []byte) error { - var res ChecksItems0 +func (o *ListSecurityChecksDefaultBody) UnmarshalBinary(b []byte) error { + var res ListSecurityChecksDefaultBody if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -222,65 +228,31 @@ func (o *ChecksItems0) UnmarshalBinary(b []byte) error { return nil } -/*ListSecurityChecksDefaultBody list security checks default body -swagger:model ListSecurityChecksDefaultBody +/*ListSecurityChecksDefaultBodyDetailsItems0 list security checks default body details items0 +swagger:model ListSecurityChecksDefaultBodyDetailsItems0 */ -type ListSecurityChecksDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` +type ListSecurityChecksDefaultBodyDetailsItems0 struct { - // message - Message string `json:"message,omitempty"` + // type url + TypeURL string `json:"type_url,omitempty"` - // details - Details []*DetailsItems0 `json:"details"` + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this list security checks default body -func (o *ListSecurityChecksDefaultBody) 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...) - } +// Validate validates this list security checks default body details items0 +func (o *ListSecurityChecksDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { return nil } -func (o *ListSecurityChecksDefaultBody) validateDetails(formats strfmt.Registry) error { - - if swag.IsZero(o.Details) { // not required - return nil - } - - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ListSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - +// ContextValidate validates this list security checks default body details items0 based on context it is used +func (o *ListSecurityChecksDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *ListSecurityChecksDefaultBody) MarshalBinary() ([]byte, error) { +func (o *ListSecurityChecksDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -288,8 +260,8 @@ func (o *ListSecurityChecksDefaultBody) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *ListSecurityChecksDefaultBody) UnmarshalBinary(b []byte) error { - var res ListSecurityChecksDefaultBody +func (o *ListSecurityChecksDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ListSecurityChecksDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } @@ -303,7 +275,7 @@ swagger:model ListSecurityChecksOKBody type ListSecurityChecksOKBody struct { // checks - Checks []*ChecksItems0 `json:"checks"` + Checks []*ListSecurityChecksOKBodyChecksItems0 `json:"checks"` } // Validate validates this list security checks OK body @@ -321,7 +293,6 @@ func (o *ListSecurityChecksOKBody) Validate(formats strfmt.Registry) error { } func (o *ListSecurityChecksOKBody) validateChecks(formats strfmt.Registry) error { - if swag.IsZero(o.Checks) { // not required return nil } @@ -335,6 +306,42 @@ func (o *ListSecurityChecksOKBody) validateChecks(formats strfmt.Registry) error if err := o.Checks[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("listSecurityChecksOk" + "." + "checks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listSecurityChecksOk" + "." + "checks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list security checks OK body based on the context it is used +func (o *ListSecurityChecksOKBody) 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 *ListSecurityChecksOKBody) contextValidateChecks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Checks); i++ { + + if o.Checks[i] != nil { + if err := o.Checks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listSecurityChecksOk" + "." + "checks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("listSecurityChecksOk" + "." + "checks" + "." + strconv.Itoa(i)) } return err } @@ -362,3 +369,110 @@ func (o *ListSecurityChecksOKBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*ListSecurityChecksOKBodyChecksItems0 SecurityCheck contains check name and status. +swagger:model ListSecurityChecksOKBodyChecksItems0 +*/ +type ListSecurityChecksOKBodyChecksItems0 struct { + + // Machine-readable name (ID) that is used in expression. + Name string `json:"name,omitempty"` + + // True if that check is disabled. + Disabled bool `json:"disabled,omitempty"` + + // Long human-readable description. + Description string `json:"description,omitempty"` + + // Short human-readable summary. + Summary string `json:"summary,omitempty"` + + // SecurityCheckInterval represents possible execution interval values for checks. + // Enum: [SECURITY_CHECK_INTERVAL_INVALID STANDARD FREQUENT RARE] + Interval *string `json:"interval,omitempty"` +} + +// Validate validates this list security checks OK body checks items0 +func (o *ListSecurityChecksOKBodyChecksItems0) 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 listSecurityChecksOkBodyChecksItems0TypeIntervalPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SECURITY_CHECK_INTERVAL_INVALID","STANDARD","FREQUENT","RARE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listSecurityChecksOkBodyChecksItems0TypeIntervalPropEnum = append(listSecurityChecksOkBodyChecksItems0TypeIntervalPropEnum, v) + } +} + +const ( + + // ListSecurityChecksOKBodyChecksItems0IntervalSECURITYCHECKINTERVALINVALID captures enum value "SECURITY_CHECK_INTERVAL_INVALID" + ListSecurityChecksOKBodyChecksItems0IntervalSECURITYCHECKINTERVALINVALID string = "SECURITY_CHECK_INTERVAL_INVALID" + + // ListSecurityChecksOKBodyChecksItems0IntervalSTANDARD captures enum value "STANDARD" + ListSecurityChecksOKBodyChecksItems0IntervalSTANDARD string = "STANDARD" + + // ListSecurityChecksOKBodyChecksItems0IntervalFREQUENT captures enum value "FREQUENT" + ListSecurityChecksOKBodyChecksItems0IntervalFREQUENT string = "FREQUENT" + + // ListSecurityChecksOKBodyChecksItems0IntervalRARE captures enum value "RARE" + ListSecurityChecksOKBodyChecksItems0IntervalRARE string = "RARE" +) + +// prop value enum +func (o *ListSecurityChecksOKBodyChecksItems0) validateIntervalEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listSecurityChecksOkBodyChecksItems0TypeIntervalPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *ListSecurityChecksOKBodyChecksItems0) 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 list security checks OK body checks items0 based on context it is used +func (o *ListSecurityChecksOKBodyChecksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ListSecurityChecksOKBodyChecksItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListSecurityChecksOKBodyChecksItems0) UnmarshalBinary(b []byte) error { + var res ListSecurityChecksOKBodyChecksItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/json/client/security_checks/security_checks_client.go b/api/managementpb/json/client/security_checks/security_checks_client.go index 70e0e052a1..37afd8aaee 100644 --- a/api/managementpb/json/client/security_checks/security_checks_client.go +++ b/api/managementpb/json/client/security_checks/security_checks_client.go @@ -23,21 +23,24 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - ChangeSecurityChecks(params *ChangeSecurityChecksParams) (*ChangeSecurityChecksOK, error) + ChangeSecurityChecks(params *ChangeSecurityChecksParams, opts ...ClientOption) (*ChangeSecurityChecksOK, error) - GetFailedChecks(params *GetFailedChecksParams) (*GetFailedChecksOK, error) + GetFailedChecks(params *GetFailedChecksParams, opts ...ClientOption) (*GetFailedChecksOK, error) - GetSecurityCheckResults(params *GetSecurityCheckResultsParams) (*GetSecurityCheckResultsOK, error) + GetSecurityCheckResults(params *GetSecurityCheckResultsParams, opts ...ClientOption) (*GetSecurityCheckResultsOK, error) - ListFailedServices(params *ListFailedServicesParams) (*ListFailedServicesOK, error) + ListFailedServices(params *ListFailedServicesParams, opts ...ClientOption) (*ListFailedServicesOK, error) - ListSecurityChecks(params *ListSecurityChecksParams) (*ListSecurityChecksOK, error) + ListSecurityChecks(params *ListSecurityChecksParams, opts ...ClientOption) (*ListSecurityChecksOK, error) - StartSecurityChecks(params *StartSecurityChecksParams) (*StartSecurityChecksOK, error) + StartSecurityChecks(params *StartSecurityChecksParams, opts ...ClientOption) (*StartSecurityChecksOK, error) - ToggleCheckAlert(params *ToggleCheckAlertParams) (*ToggleCheckAlertOK, error) + ToggleCheckAlert(params *ToggleCheckAlertParams, opts ...ClientOption) (*ToggleCheckAlertOK, error) SetTransport(transport runtime.ClientTransport) } @@ -47,13 +50,12 @@ type ClientService interface { Enables/disables Security Thread Tool checks or changes their interval by names. */ -func (a *Client) ChangeSecurityChecks(params *ChangeSecurityChecksParams) (*ChangeSecurityChecksOK, error) { +func (a *Client) ChangeSecurityChecks(params *ChangeSecurityChecksParams, opts ...ClientOption) (*ChangeSecurityChecksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeSecurityChecksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeSecurityChecks", Method: "POST", PathPattern: "/v1/management/SecurityChecks/Change", @@ -64,7 +66,12 @@ func (a *Client) ChangeSecurityChecks(params *ChangeSecurityChecksParams) (*Chan Reader: &ChangeSecurityChecksReader{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 } @@ -82,13 +89,12 @@ func (a *Client) ChangeSecurityChecks(params *ChangeSecurityChecksParams) (*Chan Returns the latest check results for a given service. */ -func (a *Client) GetFailedChecks(params *GetFailedChecksParams) (*GetFailedChecksOK, error) { +func (a *Client) GetFailedChecks(params *GetFailedChecksParams, opts ...ClientOption) (*GetFailedChecksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetFailedChecksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetFailedChecks", Method: "POST", PathPattern: "/v1/management/SecurityChecks/FailedChecks", @@ -99,7 +105,12 @@ func (a *Client) GetFailedChecks(params *GetFailedChecksParams) (*GetFailedCheck 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 } @@ -117,13 +128,12 @@ func (a *Client) GetFailedChecks(params *GetFailedChecksParams) (*GetFailedCheck Returns Security Thread Tool's latest checks results. */ -func (a *Client) GetSecurityCheckResults(params *GetSecurityCheckResultsParams) (*GetSecurityCheckResultsOK, error) { +func (a *Client) GetSecurityCheckResults(params *GetSecurityCheckResultsParams, opts ...ClientOption) (*GetSecurityCheckResultsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetSecurityCheckResultsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetSecurityCheckResults", Method: "POST", PathPattern: "/v1/management/SecurityChecks/GetCheckResults", @@ -134,7 +144,12 @@ func (a *Client) GetSecurityCheckResults(params *GetSecurityCheckResultsParams) Reader: &GetSecurityCheckResultsReader{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 } @@ -152,13 +167,12 @@ func (a *Client) GetSecurityCheckResults(params *GetSecurityCheckResultsParams) Returns a list of services with failed checks and a summary of check results. */ -func (a *Client) ListFailedServices(params *ListFailedServicesParams) (*ListFailedServicesOK, error) { +func (a *Client) ListFailedServices(params *ListFailedServicesParams, opts ...ClientOption) (*ListFailedServicesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListFailedServicesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListFailedServices", Method: "POST", PathPattern: "/v1/management/SecurityChecks/ListFailedServices", @@ -169,7 +183,12 @@ func (a *Client) ListFailedServices(params *ListFailedServicesParams) (*ListFail 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 } @@ -187,13 +206,12 @@ func (a *Client) ListFailedServices(params *ListFailedServicesParams) (*ListFail Returns a list of available Security Thread Tool checks. */ -func (a *Client) ListSecurityChecks(params *ListSecurityChecksParams) (*ListSecurityChecksOK, error) { +func (a *Client) ListSecurityChecks(params *ListSecurityChecksParams, opts ...ClientOption) (*ListSecurityChecksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListSecurityChecksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ListSecurityChecks", Method: "POST", PathPattern: "/v1/management/SecurityChecks/List", @@ -204,7 +222,12 @@ func (a *Client) ListSecurityChecks(params *ListSecurityChecksParams) (*ListSecu Reader: &ListSecurityChecksReader{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 } @@ -222,13 +245,12 @@ func (a *Client) ListSecurityChecks(params *ListSecurityChecksParams) (*ListSecu Executes Security Thread Tool checks and returns when all checks are executed. All available checks will be started if check names aren't specified. */ -func (a *Client) StartSecurityChecks(params *StartSecurityChecksParams) (*StartSecurityChecksOK, error) { +func (a *Client) StartSecurityChecks(params *StartSecurityChecksParams, opts ...ClientOption) (*StartSecurityChecksOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartSecurityChecksParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartSecurityChecks", Method: "POST", PathPattern: "/v1/management/SecurityChecks/Start", @@ -239,7 +261,12 @@ func (a *Client) StartSecurityChecks(params *StartSecurityChecksParams) (*StartS Reader: &StartSecurityChecksReader{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 } @@ -257,13 +284,12 @@ func (a *Client) StartSecurityChecks(params *StartSecurityChecksParams) (*StartS Silence/Unsilence alerts for a specific check result. */ -func (a *Client) ToggleCheckAlert(params *ToggleCheckAlertParams) (*ToggleCheckAlertOK, error) { +func (a *Client) ToggleCheckAlert(params *ToggleCheckAlertParams, opts ...ClientOption) (*ToggleCheckAlertOK, error) { // TODO: Validate the params before sending if params == nil { params = NewToggleCheckAlertParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ToggleCheckAlert", Method: "POST", PathPattern: "/v1/management/SecurityChecks/ToggleCheckAlert", @@ -274,7 +300,12 @@ func (a *Client) ToggleCheckAlert(params *ToggleCheckAlertParams) (*ToggleCheckA Reader: &ToggleCheckAlertReader{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 } diff --git a/api/managementpb/json/client/security_checks/start_security_checks_parameters.go b/api/managementpb/json/client/security_checks/start_security_checks_parameters.go index ce4a295a18..4934b7c510 100644 --- a/api/managementpb/json/client/security_checks/start_security_checks_parameters.go +++ b/api/managementpb/json/client/security_checks/start_security_checks_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartSecurityChecksParams creates a new StartSecurityChecksParams object -// with the default values initialized. +// NewStartSecurityChecksParams creates a new StartSecurityChecksParams 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 NewStartSecurityChecksParams() *StartSecurityChecksParams { - var () return &StartSecurityChecksParams{ - timeout: cr.DefaultTimeout, } } // NewStartSecurityChecksParamsWithTimeout creates a new StartSecurityChecksParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartSecurityChecksParamsWithTimeout(timeout time.Duration) *StartSecurityChecksParams { - var () return &StartSecurityChecksParams{ - timeout: timeout, } } // NewStartSecurityChecksParamsWithContext creates a new StartSecurityChecksParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartSecurityChecksParamsWithContext(ctx context.Context) *StartSecurityChecksParams { - var () return &StartSecurityChecksParams{ - Context: ctx, } } // NewStartSecurityChecksParamsWithHTTPClient creates a new StartSecurityChecksParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartSecurityChecksParamsWithHTTPClient(client *http.Client) *StartSecurityChecksParams { - var () return &StartSecurityChecksParams{ HTTPClient: client, } } -/*StartSecurityChecksParams contains all the parameters to send to the API endpoint -for the start security checks operation typically these are written to a http.Request +/* StartSecurityChecksParams contains all the parameters to send to the API endpoint + for the start security checks operation. + + Typically these are written to a http.Request. */ type StartSecurityChecksParams struct { - /*Body*/ + // Body. Body StartSecurityChecksBody timeout time.Duration @@ -68,6 +67,21 @@ type StartSecurityChecksParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the start security checks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartSecurityChecksParams) WithDefaults() *StartSecurityChecksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the start security checks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *StartSecurityChecksParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the start security checks params func (o *StartSecurityChecksParams) WithTimeout(timeout time.Duration) *StartSecurityChecksParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *StartSecurityChecksParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/security_checks/start_security_checks_responses.go b/api/managementpb/json/client/security_checks/start_security_checks_responses.go index a5ce19357b..e49770295c 100644 --- a/api/managementpb/json/client/security_checks/start_security_checks_responses.go +++ b/api/managementpb/json/client/security_checks/start_security_checks_responses.go @@ -6,6 +6,7 @@ package security_checks // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartSecurityChecksOK() *StartSecurityChecksOK { return &StartSecurityChecksOK{} } -/*StartSecurityChecksOK handles this case with default header values. +/* StartSecurityChecksOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartSecurityChecksOK struct { func (o *StartSecurityChecksOK) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/Start][%d] startSecurityChecksOk %+v", 200, o.Payload) } - func (o *StartSecurityChecksOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewStartSecurityChecksDefault(code int) *StartSecurityChecksDefault { } } -/*StartSecurityChecksDefault handles this case with default header values. +/* StartSecurityChecksDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *StartSecurityChecksDefault) Code() int { func (o *StartSecurityChecksDefault) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/Start][%d] StartSecurityChecks default %+v", o._statusCode, o.Payload) } - func (o *StartSecurityChecksDefault) GetPayload() *StartSecurityChecksDefaultBody { return o.Payload } @@ -129,6 +128,11 @@ func (o *StartSecurityChecksBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this start security checks body based on context it is used +func (o *StartSecurityChecksBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *StartSecurityChecksBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -162,7 +166,7 @@ type StartSecurityChecksDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartSecurityChecksDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start security checks default body @@ -180,7 +184,6 @@ func (o *StartSecurityChecksDefaultBody) Validate(formats strfmt.Registry) error } func (o *StartSecurityChecksDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -194,6 +197,42 @@ func (o *StartSecurityChecksDefaultBody) validateDetails(formats strfmt.Registry if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this start security checks default body based on the context it is used +func (o *StartSecurityChecksDefaultBody) 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 *StartSecurityChecksDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartSecurityChecks default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -221,3 +260,44 @@ func (o *StartSecurityChecksDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*StartSecurityChecksDefaultBodyDetailsItems0 start security checks default body details items0 +swagger:model StartSecurityChecksDefaultBodyDetailsItems0 +*/ +type StartSecurityChecksDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this start security checks default body details items0 +func (o *StartSecurityChecksDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this start security checks default body details items0 based on context it is used +func (o *StartSecurityChecksDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *StartSecurityChecksDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *StartSecurityChecksDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res StartSecurityChecksDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/json/client/security_checks/toggle_check_alert_parameters.go b/api/managementpb/json/client/security_checks/toggle_check_alert_parameters.go index 9ddbf0dec5..0e0f2b1c09 100644 --- a/api/managementpb/json/client/security_checks/toggle_check_alert_parameters.go +++ b/api/managementpb/json/client/security_checks/toggle_check_alert_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewToggleCheckAlertParams creates a new ToggleCheckAlertParams object -// with the default values initialized. +// NewToggleCheckAlertParams creates a new ToggleCheckAlertParams 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 NewToggleCheckAlertParams() *ToggleCheckAlertParams { - var () return &ToggleCheckAlertParams{ - timeout: cr.DefaultTimeout, } } // NewToggleCheckAlertParamsWithTimeout creates a new ToggleCheckAlertParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewToggleCheckAlertParamsWithTimeout(timeout time.Duration) *ToggleCheckAlertParams { - var () return &ToggleCheckAlertParams{ - timeout: timeout, } } // NewToggleCheckAlertParamsWithContext creates a new ToggleCheckAlertParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewToggleCheckAlertParamsWithContext(ctx context.Context) *ToggleCheckAlertParams { - var () return &ToggleCheckAlertParams{ - Context: ctx, } } // NewToggleCheckAlertParamsWithHTTPClient creates a new ToggleCheckAlertParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewToggleCheckAlertParamsWithHTTPClient(client *http.Client) *ToggleCheckAlertParams { - var () return &ToggleCheckAlertParams{ HTTPClient: client, } } -/*ToggleCheckAlertParams contains all the parameters to send to the API endpoint -for the toggle check alert operation typically these are written to a http.Request +/* ToggleCheckAlertParams contains all the parameters to send to the API endpoint + for the toggle check alert operation. + + Typically these are written to a http.Request. */ type ToggleCheckAlertParams struct { - /*Body*/ + // Body. Body ToggleCheckAlertBody timeout time.Duration @@ -68,6 +67,21 @@ type ToggleCheckAlertParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the toggle check alert params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleCheckAlertParams) WithDefaults() *ToggleCheckAlertParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the toggle check alert params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ToggleCheckAlertParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the toggle check alert params func (o *ToggleCheckAlertParams) WithTimeout(timeout time.Duration) *ToggleCheckAlertParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *ToggleCheckAlertParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/security_checks/toggle_check_alert_responses.go b/api/managementpb/json/client/security_checks/toggle_check_alert_responses.go index 5607c7dfd2..7163759679 100644 --- a/api/managementpb/json/client/security_checks/toggle_check_alert_responses.go +++ b/api/managementpb/json/client/security_checks/toggle_check_alert_responses.go @@ -6,6 +6,7 @@ package security_checks // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewToggleCheckAlertOK() *ToggleCheckAlertOK { return &ToggleCheckAlertOK{} } -/*ToggleCheckAlertOK handles this case with default header values. +/* ToggleCheckAlertOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ToggleCheckAlertOK struct { func (o *ToggleCheckAlertOK) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/ToggleCheckAlert][%d] toggleCheckAlertOk %+v", 200, o.Payload) } - func (o *ToggleCheckAlertOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewToggleCheckAlertDefault(code int) *ToggleCheckAlertDefault { } } -/*ToggleCheckAlertDefault handles this case with default header values. +/* ToggleCheckAlertDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *ToggleCheckAlertDefault) Code() int { func (o *ToggleCheckAlertDefault) Error() string { return fmt.Sprintf("[POST /v1/management/SecurityChecks/ToggleCheckAlert][%d] ToggleCheckAlert default %+v", o._statusCode, o.Payload) } - func (o *ToggleCheckAlertDefault) GetPayload() *ToggleCheckAlertDefaultBody { return o.Payload } @@ -132,6 +131,11 @@ func (o *ToggleCheckAlertBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this toggle check alert body based on context it is used +func (o *ToggleCheckAlertBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ToggleCheckAlertBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -165,7 +169,7 @@ type ToggleCheckAlertDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ToggleCheckAlertDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this toggle check alert default body @@ -183,7 +187,6 @@ func (o *ToggleCheckAlertDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ToggleCheckAlertDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -197,6 +200,42 @@ func (o *ToggleCheckAlertDefaultBody) validateDetails(formats strfmt.Registry) e if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ToggleCheckAlert default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ToggleCheckAlert default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this toggle check alert default body based on the context it is used +func (o *ToggleCheckAlertDefaultBody) 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 *ToggleCheckAlertDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ToggleCheckAlert default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ToggleCheckAlert default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -224,3 +263,44 @@ func (o *ToggleCheckAlertDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*ToggleCheckAlertDefaultBodyDetailsItems0 toggle check alert default body details items0 +swagger:model ToggleCheckAlertDefaultBodyDetailsItems0 +*/ +type ToggleCheckAlertDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this toggle check alert default body details items0 +func (o *ToggleCheckAlertDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this toggle check alert default body details items0 based on context it is used +func (o *ToggleCheckAlertDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ToggleCheckAlertDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ToggleCheckAlertDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res ToggleCheckAlertDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/json/client/service/remove_service_parameters.go b/api/managementpb/json/client/service/remove_service_parameters.go index 955a8763b9..4ce0c287c3 100644 --- a/api/managementpb/json/client/service/remove_service_parameters.go +++ b/api/managementpb/json/client/service/remove_service_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRemoveServiceParams creates a new RemoveServiceParams object -// with the default values initialized. +// 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 { - var () return &RemoveServiceParams{ - timeout: cr.DefaultTimeout, } } // NewRemoveServiceParamsWithTimeout creates a new RemoveServiceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRemoveServiceParamsWithTimeout(timeout time.Duration) *RemoveServiceParams { - var () return &RemoveServiceParams{ - timeout: timeout, } } // NewRemoveServiceParamsWithContext creates a new RemoveServiceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRemoveServiceParamsWithContext(ctx context.Context) *RemoveServiceParams { - var () return &RemoveServiceParams{ - Context: ctx, } } // NewRemoveServiceParamsWithHTTPClient creates a new RemoveServiceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRemoveServiceParamsWithHTTPClient(client *http.Client) *RemoveServiceParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body RemoveServiceBody timeout time.Duration @@ -68,6 +67,21 @@ type RemoveServiceParams struct { 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) @@ -119,7 +133,6 @@ func (o *RemoveServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/managementpb/json/client/service/remove_service_responses.go b/api/managementpb/json/client/service/remove_service_responses.go index 8dca008c18..5d954fb72b 100644 --- a/api/managementpb/json/client/service/remove_service_responses.go +++ b/api/managementpb/json/client/service/remove_service_responses.go @@ -6,6 +6,7 @@ package service // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewRemoveServiceOK() *RemoveServiceOK { return &RemoveServiceOK{} } -/*RemoveServiceOK handles this case with default header values. +/* RemoveServiceOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type RemoveServiceOK struct { func (o *RemoveServiceOK) Error() string { return fmt.Sprintf("[POST /v1/management/Service/Remove][%d] removeServiceOk %+v", 200, o.Payload) } - func (o *RemoveServiceOK) GetPayload() interface{} { return o.Payload } @@ -82,7 +82,7 @@ func NewRemoveServiceDefault(code int) *RemoveServiceDefault { } } -/*RemoveServiceDefault handles this case with default header values. +/* RemoveServiceDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *RemoveServiceDefault) Code() int { func (o *RemoveServiceDefault) Error() string { return fmt.Sprintf("[POST /v1/management/Service/Remove][%d] RemoveService default %+v", o._statusCode, o.Payload) } - func (o *RemoveServiceDefault) GetPayload() *RemoveServiceDefaultBody { return o.Payload } @@ -117,57 +116,21 @@ func (o *RemoveServiceDefault) readResponse(response runtime.ClientResponse, con return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*RemoveServiceBody remove service body swagger:model RemoveServiceBody */ type RemoveServiceBody struct { - // ServiceType describes supported Service types. - // Enum: [SERVICE_TYPE_INVALID MYSQL_SERVICE MONGODB_SERVICE POSTGRESQL_SERVICE PROXYSQL_SERVICE HAPROXY_SERVICE EXTERNAL_SERVICE] - ServiceType *string `json:"service_type,omitempty"` - // Service ID or Service Name is required. // Unique randomly generated instance identifier. ServiceID string `json:"service_id,omitempty"` // Unique across all Services user-defined name. ServiceName string `json:"service_name,omitempty"` + + // ServiceType describes supported Service types. + // Enum: [SERVICE_TYPE_INVALID MYSQL_SERVICE MONGODB_SERVICE POSTGRESQL_SERVICE PROXYSQL_SERVICE HAPROXY_SERVICE EXTERNAL_SERVICE] + ServiceType *string `json:"service_type,omitempty"` } // Validate validates this remove service body @@ -229,7 +192,6 @@ func (o *RemoveServiceBody) validateServiceTypeEnum(path, location string, value } func (o *RemoveServiceBody) validateServiceType(formats strfmt.Registry) error { - if swag.IsZero(o.ServiceType) { // not required return nil } @@ -242,6 +204,11 @@ func (o *RemoveServiceBody) validateServiceType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this remove service body based on context it is used +func (o *RemoveServiceBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *RemoveServiceBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -275,7 +242,7 @@ type RemoveServiceDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*RemoveServiceDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this remove service default body @@ -293,7 +260,6 @@ func (o *RemoveServiceDefaultBody) Validate(formats strfmt.Registry) error { } func (o *RemoveServiceDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -307,6 +273,42 @@ func (o *RemoveServiceDefaultBody) validateDetails(formats strfmt.Registry) erro if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("RemoveService default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -334,3 +336,44 @@ func (o *RemoveServiceDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*RemoveServiceDefaultBodyDetailsItems0 remove service default body details items0 +swagger:model RemoveServiceDefaultBodyDetailsItems0 +*/ +type RemoveServiceDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/managementpb/json/client/service/service_client.go b/api/managementpb/json/client/service/service_client.go index 3d83e8ec04..beb59e9834 100644 --- a/api/managementpb/json/client/service/service_client.go +++ b/api/managementpb/json/client/service/service_client.go @@ -23,9 +23,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - RemoveService(params *RemoveServiceParams) (*RemoveServiceOK, error) + RemoveService(params *RemoveServiceParams, opts ...ClientOption) (*RemoveServiceOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { Removes Service with Agents. */ -func (a *Client) RemoveService(params *RemoveServiceParams) (*RemoveServiceOK, error) { +func (a *Client) RemoveService(params *RemoveServiceParams, opts ...ClientOption) (*RemoveServiceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRemoveServiceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "RemoveService", Method: "POST", PathPattern: "/v1/management/Service/Remove", @@ -52,7 +54,12 @@ func (a *Client) RemoveService(params *RemoveServiceParams) (*RemoveServiceOK, e 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 } diff --git a/api/managementpb/json/managementpb.json b/api/managementpb/json/managementpb.json index a3c58f4892..506e07499c 100644 --- a/api/managementpb/json/managementpb.json +++ b/api/managementpb/json/managementpb.json @@ -1634,16 +1634,14 @@ "REMOTE_NODE", "REMOTE_RDS_NODE", "REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 + ] }, "region": { "description": "Node region.", "type": "string", "x-order": 7 } - }, - "x-order": 2 + } }, "address": { "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", @@ -1687,8 +1685,7 @@ "AUTO", "PULL", "PUSH" - ], - "x-order": 16 + ] }, "metrics_path": { "description": "Path under which metrics are exposed, used to generate URI.", @@ -1808,8 +1805,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 1 + } }, "service": { "description": "ExternalService represents a generic External service instance.", @@ -1858,8 +1854,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 0 + } } } } @@ -1980,16 +1975,14 @@ "REMOTE_NODE", "REMOTE_RDS_NODE", "REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 + ] }, "region": { "description": "Node region.", "type": "string", "x-order": 7 } - }, - "x-order": 2 + } }, "address": { "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", @@ -2028,8 +2021,7 @@ "AUTO", "PULL", "PUSH" - ], - "x-order": 14 + ] }, "metrics_path": { "description": "Path under which metrics are exposed, used to generate URI.", @@ -2144,8 +2136,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 1 + } }, "service": { "description": "HAProxyService represents a generic HAProxy service instance.", @@ -2189,8 +2180,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 0 + } } } } @@ -2311,16 +2301,14 @@ "REMOTE_NODE", "REMOTE_RDS_NODE", "REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 + ] }, "region": { "description": "Node region.", "type": "string", "x-order": 7 } - }, - "x-order": 2 + } }, "address": { "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", @@ -2387,8 +2375,7 @@ "AUTO", "PULL", "PUSH" - ], - "x-order": 21 + ] }, "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.", @@ -2571,8 +2558,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -2589,8 +2575,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 1 + } }, "qan_mongodb_profiler": { "description": "QANMongoDBProfilerAgent runs within pmm-agent and sends MongoDB Query Analytics data to the PMM Server.", @@ -2636,8 +2621,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -2654,8 +2638,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 2 + } }, "service": { "description": "MongoDBService represents a generic MongoDB instance.", @@ -2715,8 +2698,7 @@ "type": "string", "x-order": 5 } - }, - "x-order": 0 + } } } } @@ -2837,16 +2819,14 @@ "REMOTE_NODE", "REMOTE_RDS_NODE", "REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 + ] }, "region": { "description": "Node region.", "type": "string", "x-order": 7 } - }, - "x-order": 2 + } }, "address": { "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", @@ -2903,8 +2883,7 @@ "AUTO", "PULL", "PUSH" - ], - "x-order": 25 + ] }, "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.", @@ -3071,8 +3050,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 14 + ] }, "tablestats_group_disabled": { "description": "True if tablestats group collectors are currently disabled.", @@ -3115,8 +3093,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 1 + } }, "qan_mysql_perfschema": { "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", @@ -3167,8 +3144,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 12 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -3200,8 +3176,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 2 + } }, "qan_mysql_slowlog": { "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", @@ -3258,8 +3233,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 13 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -3291,8 +3265,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 3 + } }, "service": { "description": "MySQLService represents a generic MySQL instance.", @@ -3352,8 +3325,7 @@ "type": "string", "x-order": 5 } - }, - "x-order": 0 + } }, "table_count": { "description": "Actual table count at the moment of adding.", @@ -3476,8 +3448,7 @@ "AUTO", "PULL", "PUSH" - ], - "x-order": 12 + ] }, "node_model": { "description": "Node model.", @@ -3500,8 +3471,7 @@ "REMOTE_NODE", "REMOTE_RDS_NODE", "REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 + ] }, "region": { "description": "Node region.", @@ -3580,8 +3550,7 @@ "type": "string", "x-order": 7 } - }, - "x-order": 1 + } }, "generic_node": { "description": "GenericNode represents a bare metal server or virtual machine.", @@ -3635,8 +3604,7 @@ "type": "string", "x-order": 6 } - }, - "x-order": 0 + } }, "pmm_agent": { "description": "PMMAgent runs on Generic or Container Node.", @@ -3665,8 +3633,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 2 + } } } } @@ -3787,16 +3754,14 @@ "REMOTE_NODE", "REMOTE_RDS_NODE", "REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 + ] }, "region": { "description": "Node region.", "type": "string", "x-order": 7 } - }, - "x-order": 2 + } }, "address": { "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", @@ -3852,8 +3817,7 @@ "AUTO", "PULL", "PUSH" - ], - "x-order": 21 + ] }, "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.", @@ -4014,8 +3978,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -4032,8 +3995,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 1 + } }, "qan_postgresql_pgstatements_agent": { "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", @@ -4079,8 +4041,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -4097,8 +4058,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 2 + } }, "qan_postgresql_pgstatmonitor_agent": { "description": "QANPostgreSQLPgStatMonitorAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", @@ -4149,8 +4109,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 9 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -4167,8 +4126,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 3 + } }, "service": { "description": "PostgreSQLService represents a generic PostgreSQL instance.", @@ -4233,8 +4191,7 @@ "type": "string", "x-order": 6 } - }, - "x-order": 0 + } } } } @@ -4355,16 +4312,14 @@ "REMOTE_NODE", "REMOTE_RDS_NODE", "REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 + ] }, "region": { "description": "Node region.", "type": "string", "x-order": 7 } - }, - "x-order": 2 + } }, "address": { "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", @@ -4410,8 +4365,7 @@ "AUTO", "PULL", "PUSH" - ], - "x-order": 17 + ] }, "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.", @@ -4547,8 +4501,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -4565,8 +4518,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 1 + } }, "service": { "description": "ProxySQLService represents a generic ProxySQL instance.", @@ -4626,8 +4578,7 @@ "type": "string", "x-order": 5 } - }, - "x-order": 0 + } } } } @@ -4751,8 +4702,7 @@ "DISCOVER_RDS_ENGINE_INVALID", "DISCOVER_RDS_MYSQL", "DISCOVER_RDS_POSTGRESQL" - ], - "x-order": 6 + ] }, "environment": { "description": "Environment name.", @@ -4772,8 +4722,7 @@ "AUTO", "PULL", "PUSH" - ], - "x-order": 26 + ] }, "node_model": { "description": "AWS instance class.", @@ -4920,8 +4869,7 @@ "type": "string", "x-order": 5 } - }, - "x-order": 2 + } }, "mysqld_exporter": { "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", @@ -4986,8 +4934,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 14 + ] }, "tablestats_group_disabled": { "description": "True if tablestats group collectors are currently disabled.", @@ -5030,8 +4977,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 3 + } }, "node": { "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", @@ -5075,8 +5021,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 0 + } }, "postgresql": { "description": "PostgreSQLService represents a generic PostgreSQL instance.", @@ -5141,8 +5086,7 @@ "type": "string", "x-order": 6 } - }, - "x-order": 6 + } }, "postgresql_exporter": { "description": "PostgresExporter runs on Generic or Container Node and exposes PostgreSQL Service metrics.", @@ -5207,8 +5151,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 10 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -5225,8 +5168,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 7 + } }, "qan_mysql_perfschema": { "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", @@ -5277,8 +5219,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 12 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -5310,8 +5251,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 4 + } }, "qan_postgresql_pgstatements": { "description": "QANPostgreSQLPgStatementsAgent runs within pmm-agent and sends PostgreSQL Query Analytics data to the PMM Server.", @@ -5357,8 +5297,7 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 8 + ] }, "tls": { "description": "Use TLS for database connections.", @@ -5375,8 +5314,7 @@ "type": "string", "x-order": 4 } - }, - "x-order": 8 + } }, "rds_exporter": { "description": "RDSExporter runs on Generic or Container Node and exposes RemoteRDS Node metrics.", @@ -5448,11 +5386,9 @@ "STOPPING", "DONE", "UNKNOWN" - ], - "x-order": 6 + ] } - }, - "x-order": 1 + } }, "table_count": { "description": "Actual table count at the moment of adding.", @@ -5565,8 +5501,7 @@ "DISCOVER_RDS_ENGINE_INVALID", "DISCOVER_RDS_MYSQL", "DISCOVER_RDS_POSTGRESQL" - ], - "x-order": 6 + ] }, "engine_version": { "description": "Engine version.", @@ -5682,8 +5617,7 @@ "STANDARD", "FREQUENT", "RARE" - ], - "x-order": 3 + ] }, "name": { "description": "The name of the check to change.", @@ -5779,8 +5713,7 @@ "format": "int32", "x-order": 0 } - }, - "x-order": 1 + } }, "service_id": { "type": "string", @@ -5812,8 +5745,7 @@ "format": "int32", "x-order": 1 } - }, - "x-order": 1 + } }, "results": { "type": "array", @@ -5871,8 +5803,7 @@ "SEVERITY_NOTICE", "SEVERITY_INFO", "SEVERITY_DEBUG" - ], - "x-order": 2 + ] }, "silenced": { "type": "boolean", @@ -5997,8 +5928,7 @@ "SEVERITY_NOTICE", "SEVERITY_INFO", "SEVERITY_DEBUG" - ], - "x-order": 2 + ] }, "summary": { "type": "string", @@ -6102,8 +6032,7 @@ "STANDARD", "FREQUENT", "RARE" - ], - "x-order": 4 + ] }, "name": { "description": "Machine-readable name (ID) that is used in expression.", @@ -6493,8 +6422,7 @@ "PROXYSQL_SERVICE", "HAPROXY_SERVICE", "EXTERNAL_SERVICE" - ], - "x-order": 0 + ] } } } diff --git a/api/managementpb/metrics.pb.go b/api/managementpb/metrics.pb.go index a37039db81..7dd554d7c1 100644 --- a/api/managementpb/metrics.pb.go +++ b/api/managementpb/metrics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/metrics.proto diff --git a/api/managementpb/mongodb.pb.go b/api/managementpb/mongodb.pb.go index f9e582916a..ef34a2732c 100644 --- a/api/managementpb/mongodb.pb.go +++ b/api/managementpb/mongodb.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/mongodb.proto diff --git a/api/managementpb/mysql.pb.go b/api/managementpb/mysql.pb.go index 820e3859a2..21e28a1e5d 100644 --- a/api/managementpb/mysql.pb.go +++ b/api/managementpb/mysql.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/mysql.proto diff --git a/api/managementpb/node.pb.go b/api/managementpb/node.pb.go index b94e634b89..c938440e2f 100644 --- a/api/managementpb/node.pb.go +++ b/api/managementpb/node.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/node.proto diff --git a/api/managementpb/pagination.pb.go b/api/managementpb/pagination.pb.go index 12f8e9a5d2..1eef966876 100644 --- a/api/managementpb/pagination.pb.go +++ b/api/managementpb/pagination.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/pagination.proto diff --git a/api/managementpb/postgresql.pb.go b/api/managementpb/postgresql.pb.go index bb31f0f9ec..d267c8758e 100644 --- a/api/managementpb/postgresql.pb.go +++ b/api/managementpb/postgresql.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/postgresql.proto diff --git a/api/managementpb/proxysql.pb.go b/api/managementpb/proxysql.pb.go index 29a76c8d22..5462ed7049 100644 --- a/api/managementpb/proxysql.pb.go +++ b/api/managementpb/proxysql.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/proxysql.proto diff --git a/api/managementpb/rds.pb.go b/api/managementpb/rds.pb.go index b18d38e49c..0e36941705 100644 --- a/api/managementpb/rds.pb.go +++ b/api/managementpb/rds.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/rds.proto diff --git a/api/managementpb/service.pb.go b/api/managementpb/service.pb.go index 75d4619c30..0c18b44f3e 100644 --- a/api/managementpb/service.pb.go +++ b/api/managementpb/service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/service.proto diff --git a/api/managementpb/severity.pb.go b/api/managementpb/severity.pb.go index 4687d856c1..6730620d3f 100644 --- a/api/managementpb/severity.pb.go +++ b/api/managementpb/severity.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: managementpb/severity.proto diff --git a/api/platformpb/json/client/platform/connect_parameters.go b/api/platformpb/json/client/platform/connect_parameters.go deleted file mode 100644 index 169e8f48b9..0000000000 --- a/api/platformpb/json/client/platform/connect_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// 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 values initialized. -func NewConnectParams() *ConnectParams { - var () - return &ConnectParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewConnectParamsWithTimeout creates a new ConnectParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewConnectParamsWithTimeout(timeout time.Duration) *ConnectParams { - var () - return &ConnectParams{ - - timeout: timeout, - } -} - -// NewConnectParamsWithContext creates a new ConnectParams object -// with the default values initialized, and the ability to set a context for a request -func NewConnectParamsWithContext(ctx context.Context) *ConnectParams { - var () - return &ConnectParams{ - - Context: ctx, - } -} - -// NewConnectParamsWithHTTPClient creates a new ConnectParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewConnectParamsWithHTTPClient(client *http.Client) *ConnectParams { - var () - 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 -} - -// 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/platformpb/json/client/platform/connect_responses.go b/api/platformpb/json/client/platform/connect_responses.go deleted file mode 100644 index d4e6f0cfbe..0000000000 --- a/api/platformpb/json/client/platform/connect_responses.go +++ /dev/null @@ -1,268 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type ConnectOK struct { - Payload interface{} -} - -func (o *ConnectOK) Error() string { - return fmt.Sprintf("[POST /v1/Platform/Connect][%d] connectOk %+v", 200, o.Payload) -} - -func (o *ConnectOK) GetPayload() interface{} { - 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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type ConnectDefault struct { - _statusCode int - - Payload *ConnectDefaultBody -} - -// Code gets the status code for the connect default response -func (o *ConnectDefault) Code() int { - return o._statusCode -} - -func (o *ConnectDefault) Error() string { - return fmt.Sprintf("[POST /v1/Platform/Connect][%d] Connect default %+v", o._statusCode, o.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 && 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"` - - // Existing Percona Platform user's email. - Email string `json:"email,omitempty"` - - // Existing Percona Platform user's password. - Password string `json:"password,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 -} - -// 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 { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/platformpb/json/client/platform/disconnect_parameters.go b/api/platformpb/json/client/platform/disconnect_parameters.go deleted file mode 100644 index 2954222bd3..0000000000 --- a/api/platformpb/json/client/platform/disconnect_parameters.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// 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 values initialized. -func NewDisconnectParams() *DisconnectParams { - var () - return &DisconnectParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDisconnectParamsWithTimeout creates a new DisconnectParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDisconnectParamsWithTimeout(timeout time.Duration) *DisconnectParams { - var () - return &DisconnectParams{ - - timeout: timeout, - } -} - -// NewDisconnectParamsWithContext creates a new DisconnectParams object -// with the default values initialized, and the ability to set a context for a request -func NewDisconnectParamsWithContext(ctx context.Context) *DisconnectParams { - var () - return &DisconnectParams{ - - Context: ctx, - } -} - -// NewDisconnectParamsWithHTTPClient creates a new DisconnectParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDisconnectParamsWithHTTPClient(client *http.Client) *DisconnectParams { - var () - 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 interface{} - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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 interface{}) *DisconnectParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the disconnect params -func (o *DisconnectParams) SetBody(body interface{}) { - 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 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/platformpb/json/client/platform/disconnect_responses.go b/api/platformpb/json/client/platform/disconnect_responses.go deleted file mode 100644 index 8e212b6490..0000000000 --- a/api/platformpb/json/client/platform/disconnect_responses.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type DisconnectOK struct { - Payload interface{} -} - -func (o *DisconnectOK) Error() string { - return fmt.Sprintf("[POST /v1/Platform/Disconnect][%d] disconnectOk %+v", 200, o.Payload) -} - -func (o *DisconnectOK) GetPayload() interface{} { - 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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type DisconnectDefault struct { - _statusCode int - - Payload *DisconnectDefaultBody -} - -// Code gets the status code for the disconnect default response -func (o *DisconnectDefault) Code() int { - return o._statusCode -} - -func (o *DisconnectDefault) Error() string { - return fmt.Sprintf("[POST /v1/Platform/Disconnect][%d] Disconnect default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*DisconnectDefaultBody disconnect default body -swagger:model DisconnectDefaultBody -*/ -type DisconnectDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} diff --git a/api/platformpb/json/client/platform/platform_client.go b/api/platformpb/json/client/platform/platform_client.go deleted file mode 100644 index 968f26bf8c..0000000000 --- a/api/platformpb/json/client/platform/platform_client.go +++ /dev/null @@ -1,256 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// 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" - "github.com/go-openapi/strfmt" -) - -// New creates a new platform API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for platform API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - Connect(params *ConnectParams) (*ConnectOK, error) - - Disconnect(params *DisconnectParams) (*DisconnectOK, error) - - SearchOrganizationEntitlements(params *SearchOrganizationEntitlementsParams) (*SearchOrganizationEntitlementsOK, error) - - SearchOrganizationTickets(params *SearchOrganizationTicketsParams) (*SearchOrganizationTicketsOK, error) - - ServerInfo(params *ServerInfoParams) (*ServerInfoOK, error) - - UserStatus(params *UserStatusParams) (*UserStatusOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - Connect connects - - 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) (*ConnectOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewConnectParams() - } - - result, err := a.transport.Submit(&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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*ConnectOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ConnectDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - Disconnect disconnects - - Disconnect a PMM server from the organization created on Percona Portal. -*/ -func (a *Client) Disconnect(params *DisconnectParams) (*DisconnectOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDisconnectParams() - } - - result, err := a.transport.Submit(&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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*DisconnectOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*DisconnectDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - SearchOrganizationEntitlements searches organization entitlements - - SearchOrganizationEntitlements fetches details of the entitlement's available to the Portal organization that the PMM server is connected to. -*/ -func (a *Client) SearchOrganizationEntitlements(params *SearchOrganizationEntitlementsParams) (*SearchOrganizationEntitlementsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewSearchOrganizationEntitlementsParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "SearchOrganizationEntitlements", - Method: "POST", - PathPattern: "/v1/Platform/SearchOrganizationEntitlements", - 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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*SearchOrganizationEntitlementsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*SearchOrganizationEntitlementsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - SearchOrganizationTickets searches organization tickets - - SearchOrganizationTickets searches support tickets belonging to the Percona Portal Organization that the PMM server is connected to. -*/ -func (a *Client) SearchOrganizationTickets(params *SearchOrganizationTicketsParams) (*SearchOrganizationTicketsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewSearchOrganizationTicketsParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "SearchOrganizationTickets", - Method: "POST", - PathPattern: "/v1/Platform/SearchOrganizationTickets", - 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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*SearchOrganizationTicketsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*SearchOrganizationTicketsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - ServerInfo servers info - - ServerInfo returns PMM server ID and name. -*/ -func (a *Client) ServerInfo(params *ServerInfoParams) (*ServerInfoOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewServerInfoParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "ServerInfo", - Method: "POST", - PathPattern: "/v1/Platform/ServerInfo", - 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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*ServerInfoOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ServerInfoDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - UserStatus users status - - UserStatus returns a boolean indicating whether the current user is logged in with their Percona Account or not. -*/ -func (a *Client) UserStatus(params *UserStatusParams) (*UserStatusOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUserStatusParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "UserStatus", - Method: "POST", - PathPattern: "/v1/Platform/UserStatus", - 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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*UserStatusOK) - if ok { - return success, nil - } - // unexpected success response - 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/platformpb/json/client/platform/search_organization_entitlements_parameters.go b/api/platformpb/json/client/platform/search_organization_entitlements_parameters.go deleted file mode 100644 index 18075e41d2..0000000000 --- a/api/platformpb/json/client/platform/search_organization_entitlements_parameters.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// 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 values initialized. -func NewSearchOrganizationEntitlementsParams() *SearchOrganizationEntitlementsParams { - var () - return &SearchOrganizationEntitlementsParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewSearchOrganizationEntitlementsParamsWithTimeout creates a new SearchOrganizationEntitlementsParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewSearchOrganizationEntitlementsParamsWithTimeout(timeout time.Duration) *SearchOrganizationEntitlementsParams { - var () - return &SearchOrganizationEntitlementsParams{ - - timeout: timeout, - } -} - -// NewSearchOrganizationEntitlementsParamsWithContext creates a new SearchOrganizationEntitlementsParams object -// with the default values initialized, and the ability to set a context for a request -func NewSearchOrganizationEntitlementsParamsWithContext(ctx context.Context) *SearchOrganizationEntitlementsParams { - var () - return &SearchOrganizationEntitlementsParams{ - - Context: ctx, - } -} - -// NewSearchOrganizationEntitlementsParamsWithHTTPClient creates a new SearchOrganizationEntitlementsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewSearchOrganizationEntitlementsParamsWithHTTPClient(client *http.Client) *SearchOrganizationEntitlementsParams { - var () - 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 { - - /*Body*/ - Body interface{} - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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 -} - -// WithBody adds the body to the search organization entitlements params -func (o *SearchOrganizationEntitlementsParams) WithBody(body interface{}) *SearchOrganizationEntitlementsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the search organization entitlements params -func (o *SearchOrganizationEntitlementsParams) SetBody(body interface{}) { - o.Body = body -} - -// 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 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/platformpb/json/client/platform/search_organization_entitlements_responses.go b/api/platformpb/json/client/platform/search_organization_entitlements_responses.go deleted file mode 100644 index e1683db0c1..0000000000 --- a/api/platformpb/json/client/platform/search_organization_entitlements_responses.go +++ /dev/null @@ -1,422 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type SearchOrganizationEntitlementsOK struct { - Payload *SearchOrganizationEntitlementsOKBody -} - -func (o *SearchOrganizationEntitlementsOK) Error() string { - return fmt.Sprintf("[POST /v1/Platform/SearchOrganizationEntitlements][%d] searchOrganizationEntitlementsOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type SearchOrganizationEntitlementsDefault struct { - _statusCode int - - Payload *SearchOrganizationEntitlementsDefaultBody -} - -// 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 { - return fmt.Sprintf("[POST /v1/Platform/SearchOrganizationEntitlements][%d] SearchOrganizationEntitlements default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*EntitlementsItems0 OrganizationEntitlement contains information about Organization entitlement. -swagger:model EntitlementsItems0 -*/ -type EntitlementsItems0 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 *EntitlementsItems0Platform `json:"platform,omitempty"` -} - -// Validate validates this entitlements items0 -func (o *EntitlementsItems0) 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 *EntitlementsItems0) 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 *EntitlementsItems0) 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 *EntitlementsItems0) 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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("platform") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *EntitlementsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *EntitlementsItems0) UnmarshalBinary(b []byte) error { - var res EntitlementsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*EntitlementsItems0Platform Platform indicates platform specific entitlements. -swagger:model EntitlementsItems0Platform -*/ -type EntitlementsItems0Platform 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 entitlements items0 platform -func (o *EntitlementsItems0Platform) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *EntitlementsItems0Platform) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *EntitlementsItems0Platform) UnmarshalBinary(b []byte) error { - var res EntitlementsItems0Platform - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*SearchOrganizationEntitlementsDefaultBody search organization entitlements default body -swagger:model SearchOrganizationEntitlementsDefaultBody -*/ -type SearchOrganizationEntitlementsDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*SearchOrganizationEntitlementsOKBody search organization entitlements OK body -swagger:model SearchOrganizationEntitlementsOKBody -*/ -type SearchOrganizationEntitlementsOKBody struct { - - // entitlements - Entitlements []*EntitlementsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} diff --git a/api/platformpb/json/client/platform/search_organization_tickets_parameters.go b/api/platformpb/json/client/platform/search_organization_tickets_parameters.go deleted file mode 100644 index 0ea710a246..0000000000 --- a/api/platformpb/json/client/platform/search_organization_tickets_parameters.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// 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 values initialized. -func NewSearchOrganizationTicketsParams() *SearchOrganizationTicketsParams { - var () - return &SearchOrganizationTicketsParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewSearchOrganizationTicketsParamsWithTimeout creates a new SearchOrganizationTicketsParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewSearchOrganizationTicketsParamsWithTimeout(timeout time.Duration) *SearchOrganizationTicketsParams { - var () - return &SearchOrganizationTicketsParams{ - - timeout: timeout, - } -} - -// NewSearchOrganizationTicketsParamsWithContext creates a new SearchOrganizationTicketsParams object -// with the default values initialized, and the ability to set a context for a request -func NewSearchOrganizationTicketsParamsWithContext(ctx context.Context) *SearchOrganizationTicketsParams { - var () - return &SearchOrganizationTicketsParams{ - - Context: ctx, - } -} - -// NewSearchOrganizationTicketsParamsWithHTTPClient creates a new SearchOrganizationTicketsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewSearchOrganizationTicketsParamsWithHTTPClient(client *http.Client) *SearchOrganizationTicketsParams { - var () - 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 { - - /*Body*/ - Body interface{} - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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 -} - -// WithBody adds the body to the search organization tickets params -func (o *SearchOrganizationTicketsParams) WithBody(body interface{}) *SearchOrganizationTicketsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the search organization tickets params -func (o *SearchOrganizationTicketsParams) SetBody(body interface{}) { - o.Body = body -} - -// 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 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/platformpb/json/client/platform/search_organization_tickets_responses.go b/api/platformpb/json/client/platform/search_organization_tickets_responses.go deleted file mode 100644 index 875d85132e..0000000000 --- a/api/platformpb/json/client/platform/search_organization_tickets_responses.go +++ /dev/null @@ -1,339 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type SearchOrganizationTicketsOK struct { - Payload *SearchOrganizationTicketsOKBody -} - -func (o *SearchOrganizationTicketsOK) Error() string { - return fmt.Sprintf("[POST /v1/Platform/SearchOrganizationTickets][%d] searchOrganizationTicketsOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type SearchOrganizationTicketsDefault struct { - _statusCode int - - Payload *SearchOrganizationTicketsDefaultBody -} - -// 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 { - return fmt.Sprintf("[POST /v1/Platform/SearchOrganizationTickets][%d] SearchOrganizationTickets default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*SearchOrganizationTicketsDefaultBody search organization tickets default body -swagger:model SearchOrganizationTicketsDefaultBody -*/ -type SearchOrganizationTicketsDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*SearchOrganizationTicketsOKBody search organization tickets OK body -swagger:model SearchOrganizationTicketsOKBody -*/ -type SearchOrganizationTicketsOKBody struct { - - // Support tickets belonging to the Percona Portal Organization. - Tickets []*TicketsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*TicketsItems0 OrganizationTicket contains information about the support ticket. -swagger:model TicketsItems0 -*/ -type TicketsItems0 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 tickets items0 -func (o *TicketsItems0) 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 *TicketsItems0) 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 -} - -// MarshalBinary interface implementation -func (o *TicketsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TicketsItems0) UnmarshalBinary(b []byte) error { - var res TicketsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/platformpb/json/client/platform/server_info_parameters.go b/api/platformpb/json/client/platform/server_info_parameters.go deleted file mode 100644 index 42fc7b176f..0000000000 --- a/api/platformpb/json/client/platform/server_info_parameters.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// 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 values initialized. -func NewServerInfoParams() *ServerInfoParams { - var () - return &ServerInfoParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewServerInfoParamsWithTimeout creates a new ServerInfoParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewServerInfoParamsWithTimeout(timeout time.Duration) *ServerInfoParams { - var () - return &ServerInfoParams{ - - timeout: timeout, - } -} - -// NewServerInfoParamsWithContext creates a new ServerInfoParams object -// with the default values initialized, and the ability to set a context for a request -func NewServerInfoParamsWithContext(ctx context.Context) *ServerInfoParams { - var () - return &ServerInfoParams{ - - Context: ctx, - } -} - -// NewServerInfoParamsWithHTTPClient creates a new ServerInfoParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewServerInfoParamsWithHTTPClient(client *http.Client) *ServerInfoParams { - var () - 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 { - - /*Body*/ - Body interface{} - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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 -} - -// WithBody adds the body to the server info params -func (o *ServerInfoParams) WithBody(body interface{}) *ServerInfoParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the server info params -func (o *ServerInfoParams) SetBody(body interface{}) { - o.Body = body -} - -// 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 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/platformpb/json/client/platform/server_info_responses.go b/api/platformpb/json/client/platform/server_info_responses.go deleted file mode 100644 index 3fbe9e24e4..0000000000 --- a/api/platformpb/json/client/platform/server_info_responses.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type ServerInfoOK struct { - Payload *ServerInfoOKBody -} - -func (o *ServerInfoOK) Error() string { - return fmt.Sprintf("[POST /v1/Platform/ServerInfo][%d] serverInfoOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type ServerInfoDefault struct { - _statusCode int - - Payload *ServerInfoDefaultBody -} - -// Code gets the status code for the server info default response -func (o *ServerInfoDefault) Code() int { - return o._statusCode -} - -func (o *ServerInfoDefault) Error() string { - return fmt.Sprintf("[POST /v1/Platform/ServerInfo][%d] ServerInfo default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*ServerInfoDefaultBody server info default body -swagger:model ServerInfoDefaultBody -*/ -type ServerInfoDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*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"` -} - -// Validate validates this server info OK body -func (o *ServerInfoOKBody) Validate(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/platformpb/json/client/platform/user_status_parameters.go b/api/platformpb/json/client/platform/user_status_parameters.go deleted file mode 100644 index ab18951052..0000000000 --- a/api/platformpb/json/client/platform/user_status_parameters.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// 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 values initialized. -func NewUserStatusParams() *UserStatusParams { - var () - return &UserStatusParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewUserStatusParamsWithTimeout creates a new UserStatusParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewUserStatusParamsWithTimeout(timeout time.Duration) *UserStatusParams { - var () - return &UserStatusParams{ - - timeout: timeout, - } -} - -// NewUserStatusParamsWithContext creates a new UserStatusParams object -// with the default values initialized, and the ability to set a context for a request -func NewUserStatusParamsWithContext(ctx context.Context) *UserStatusParams { - var () - return &UserStatusParams{ - - Context: ctx, - } -} - -// NewUserStatusParamsWithHTTPClient creates a new UserStatusParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewUserStatusParamsWithHTTPClient(client *http.Client) *UserStatusParams { - var () - 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 { - - /*Body*/ - Body interface{} - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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 -} - -// WithBody adds the body to the user status params -func (o *UserStatusParams) WithBody(body interface{}) *UserStatusParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the user status params -func (o *UserStatusParams) SetBody(body interface{}) { - o.Body = body -} - -// 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 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/platformpb/json/client/platform/user_status_responses.go b/api/platformpb/json/client/platform/user_status_responses.go deleted file mode 100644 index 7b147164e0..0000000000 --- a/api/platformpb/json/client/platform/user_status_responses.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package platform - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type UserStatusOK struct { - Payload *UserStatusOKBody -} - -func (o *UserStatusOK) Error() string { - return fmt.Sprintf("[POST /v1/Platform/UserStatus][%d] userStatusOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type UserStatusDefault struct { - _statusCode int - - Payload *UserStatusDefaultBody -} - -// Code gets the status code for the user status default response -func (o *UserStatusDefault) Code() int { - return o._statusCode -} - -func (o *UserStatusDefault) Error() string { - return fmt.Sprintf("[POST /v1/Platform/UserStatus][%d] UserStatus default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*UserStatusDefaultBody user status default body -swagger:model UserStatusDefaultBody -*/ -type UserStatusDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*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 -} - -// 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/platformpb/json/client/pmm_platform_client.go b/api/platformpb/json/client/pmm_platform_client.go deleted file mode 100644 index e2566f81da..0000000000 --- a/api/platformpb/json/client/pmm_platform_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/platformpb/json/client/platform" -) - -// Default PMM platform 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 HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMPlatform { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM platform HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMPlatform { - // 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 client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMPlatform { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMPlatform) - cli.Transport = transport - cli.Platform = platform.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 -} - -// PMMPlatform is a client for PMM platform -type PMMPlatform struct { - Platform platform.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMPlatform) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.Platform.SetTransport(transport) -} diff --git a/api/platformpb/json/platformpb.json b/api/platformpb/json/platformpb.json deleted file mode 100644 index 4f73867c72..0000000000 --- a/api/platformpb/json/platformpb.json +++ /dev/null @@ -1,602 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM Platform API", - "version": "v0" - }, - "paths": { - "/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": [ - "Platform" - ], - "summary": "Connect", - "operationId": "Connect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "email": { - "description": "Existing Percona Platform user's email.", - "type": "string", - "x-order": 1 - }, - "password": { - "description": "Existing Percona Platform user's password.", - "type": "string", - "x-order": 2 - }, - "personal_access_token": { - "description": "Personal Access Token that the user obtains from Percona Portal.", - "type": "string", - "x-order": 3 - }, - "server_name": { - "description": "User defined human readable PMM Server Name.", - "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": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "error": { - "type": "string", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/Disconnect": { - "post": { - "description": "Disconnect a PMM server from the organization created on Percona Portal.", - "tags": [ - "Platform" - ], - "summary": "Disconnect", - "operationId": "Disconnect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "error": { - "type": "string", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/SearchOrganizationEntitlements": { - "post": { - "description": "SearchOrganizationEntitlements fetches details of the entitlement's available to the Portal organization that the PMM server is connected to.", - "tags": [ - "Platform" - ], - "summary": "SearchOrganizationEntitlements", - "operationId": "SearchOrganizationEntitlements", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "entitlements": { - "type": "array", - "items": { - "description": "OrganizationEntitlement contains information about Organization entitlement.", - "type": "object", - "properties": { - "end_date": { - "description": "Entitlement end date.\nNote: only date is used here but not time.", - "type": "string", - "format": "date-time", - "x-order": 9 - }, - "name": { - "description": "Entitlement name.", - "type": "string", - "x-order": 1 - }, - "number": { - "description": "Entitlement number.", - "type": "string", - "x-order": 0 - }, - "platform": { - "description": "Platform indicates platform specific entitlements.", - "type": "object", - "properties": { - "config_advisor": { - "description": "Flag indicates that config advisors are covered by this entitlement.", - "type": "string", - "x-order": 1 - }, - "security_advisor": { - "description": "Flag indicates that security advisors are covered by this entitlement.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 10 - }, - "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 - }, - "summary": { - "description": "Entitlement short summary.", - "type": "string", - "x-order": 2 - }, - "support_level": { - "description": "Support level covered by this entitlement.", - "type": "string", - "x-order": 6 - }, - "tier": { - "description": "Entitlement tier.", - "type": "string", - "x-order": 3 - }, - "total_units": { - "description": "Total units covered by this entitlement.", - "type": "string", - "x-order": 4 - }, - "unlimited_units": { - "description": "Flag indicates that unlimited units are covered.", - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "error": { - "type": "string", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/SearchOrganizationTickets": { - "post": { - "description": "SearchOrganizationTickets searches support tickets belonging to the Percona Portal Organization that the PMM server is connected to.", - "tags": [ - "Platform" - ], - "summary": "SearchOrganizationTickets", - "operationId": "SearchOrganizationTickets", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": { - "create_time": { - "description": "Ticket creation time.", - "type": "string", - "format": "date-time", - "x-order": 4 - }, - "department": { - "description": "Department.", - "type": "string", - "x-order": 5 - }, - "number": { - "description": "Ticket number.", - "type": "string", - "x-order": 0 - }, - "priority": { - "description": "Ticket priority.", - "type": "string", - "x-order": 2 - }, - "requester": { - "description": "Ticket requester.", - "type": "string", - "x-order": 6 - }, - "short_description": { - "description": "Ticket short description.", - "type": "string", - "x-order": 1 - }, - "state": { - "description": "Ticket state.", - "type": "string", - "x-order": 3 - }, - "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": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "error": { - "type": "string", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/ServerInfo": { - "post": { - "description": "ServerInfo returns PMM server ID and name.", - "tags": [ - "Platform" - ], - "summary": "ServerInfo", - "operationId": "ServerInfo", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pmm_server_id": { - "type": "string", - "x-order": 1 - }, - "pmm_server_name": { - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "error": { - "type": "string", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/Platform/UserStatus": { - "post": { - "description": "UserStatus returns a boolean indicating whether the current user is logged in with their Percona Account or not.", - "tags": [ - "Platform" - ], - "summary": "UserStatus", - "operationId": "UserStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - }, - "error": { - "type": "string", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 2 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/api/platformpb/platform.pb.go b/api/platformpb/platform.pb.go index 507704c282..324646ce7d 100644 --- a/api/platformpb/platform.pb.go +++ b/api/platformpb/platform.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: platformpb/platform.proto diff --git a/api/qanpb/collector.pb.go b/api/qanpb/collector.pb.go index e2d227157c..685393e23f 100644 --- a/api/qanpb/collector.pb.go +++ b/api/qanpb/collector.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: qanpb/collector.proto diff --git a/api/qanpb/filters.pb.go b/api/qanpb/filters.pb.go index f5bdebaa33..5abe5b5b2c 100644 --- a/api/qanpb/filters.pb.go +++ b/api/qanpb/filters.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: qanpb/filters.proto diff --git a/api/qanpb/json/client/filters/filters_client.go b/api/qanpb/json/client/filters/filters_client.go deleted file mode 100644 index 6c5b2f46c9..0000000000 --- a/api/qanpb/json/client/filters/filters_client.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package filters - -// 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" - "github.com/go-openapi/strfmt" -) - -// New creates a new filters API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for filters API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - Get(params *GetParams) (*GetOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - Get gets gets map of metrics names -*/ -func (a *Client) Get(params *GetParams) (*GetOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "Get", - Method: "POST", - PathPattern: "/v0/qan/Filters/Get", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/qanpb/json/client/filters/get_parameters.go b/api/qanpb/json/client/filters/get_parameters.go deleted file mode 100644 index 7675de889c..0000000000 --- a/api/qanpb/json/client/filters/get_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package filters - -// 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" -) - -// NewGetParams creates a new GetParams object -// with the default values initialized. -func NewGetParams() *GetParams { - var () - return &GetParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetParamsWithTimeout creates a new GetParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetParamsWithTimeout(timeout time.Duration) *GetParams { - var () - return &GetParams{ - - timeout: timeout, - } -} - -// NewGetParamsWithContext creates a new GetParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetParamsWithContext(ctx context.Context) *GetParams { - var () - return &GetParams{ - - Context: ctx, - } -} - -// NewGetParamsWithHTTPClient creates a new GetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetParamsWithHTTPClient(client *http.Client) *GetParams { - var () - return &GetParams{ - HTTPClient: client, - } -} - -/*GetParams contains all the parameters to send to the API endpoint -for the get operation typically these are written to a http.Request -*/ -type GetParams struct { - - /*Body*/ - Body GetBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the get params -func (o *GetParams) WithTimeout(timeout time.Duration) *GetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get params -func (o *GetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get params -func (o *GetParams) WithContext(ctx context.Context) *GetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get params -func (o *GetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get params -func (o *GetParams) WithHTTPClient(client *http.Client) *GetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get params -func (o *GetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get params -func (o *GetParams) WithBody(body GetBody) *GetParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get params -func (o *GetParams) SetBody(body GetBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/qanpb/json/client/filters/get_responses.go b/api/qanpb/json/client/filters/get_responses.go deleted file mode 100644 index 0ede17f404..0000000000 --- a/api/qanpb/json/client/filters/get_responses.go +++ /dev/null @@ -1,544 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package filters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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" -) - -// GetReader is a Reader for the Get structure. -type GetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetDefault(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 - } -} - -// NewGetOK creates a GetOK with default headers values -func NewGetOK() *GetOK { - return &GetOK{} -} - -/*GetOK handles this case with default header values. - -A successful response. -*/ -type GetOK struct { - Payload *GetOKBody -} - -func (o *GetOK) Error() string { - return fmt.Sprintf("[POST /v0/qan/Filters/Get][%d] getOk %+v", 200, o.Payload) -} - -func (o *GetOK) GetPayload() *GetOKBody { - return o.Payload -} - -func (o *GetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(GetOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetDefault creates a GetDefault with default headers values -func NewGetDefault(code int) *GetDefault { - return &GetDefault{ - _statusCode: code, - } -} - -/*GetDefault handles this case with default header values. - -An unexpected error response. -*/ -type GetDefault struct { - _statusCode int - - Payload *GetDefaultBody -} - -// Code gets the status code for the get default response -func (o *GetDefault) Code() int { - return o._statusCode -} - -func (o *GetDefault) Error() string { - return fmt.Sprintf("[POST /v0/qan/Filters/Get][%d] Get default %+v", o._statusCode, o.Payload) -} - -func (o *GetDefault) GetPayload() *GetDefaultBody { - return o.Payload -} - -func (o *GetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(GetDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*GetBody FiltersRequest contains period for which we need filters. -swagger:model GetBody -*/ -type GetBody 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 []*LabelsItems0 `json:"labels"` -} - -// Validate validates this get body -func (o *GetBody) 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 *GetBody) 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 *GetBody) 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 *GetBody) 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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetBody) UnmarshalBinary(b []byte) error { - var res GetBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*GetDefaultBody get default body -swagger:model GetDefaultBody -*/ -type GetDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `json:"details"` -} - -// Validate validates this get default body -func (o *GetDefaultBody) 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 *GetDefaultBody) validateDetails(formats strfmt.Registry) error { - - if swag.IsZero(o.Details) { // not required - return nil - } - - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Get default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDefaultBody) UnmarshalBinary(b []byte) error { - var res GetDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*GetOKBody FiltersReply 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 GetOKBody -*/ -type GetOKBody struct { - - // labels - Labels map[string]LabelsAnon `json:"labels,omitempty"` -} - -// Validate validates this get OK body -func (o *GetOKBody) 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 *GetOKBody) 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 { - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetOKBody) UnmarshalBinary(b []byte) error { - var res GetOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*LabelsAnon ListLabels is list of label's values: duplicates are impossible. -swagger:model LabelsAnon -*/ -type LabelsAnon struct { - - // name - Name []*LabelsAnonNameItems0 `json:"name"` -} - -// Validate validates this labels anon -func (o *LabelsAnon) 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 *LabelsAnon) 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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("name" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (o *LabelsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *LabelsAnon) UnmarshalBinary(b []byte) error { - var res LabelsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*LabelsAnonNameItems0 Values is label values and main metric percent and per second. -swagger:model LabelsAnonNameItems0 -*/ -type LabelsAnonNameItems0 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 labels anon name items0 -func (o *LabelsAnonNameItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *LabelsAnonNameItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *LabelsAnonNameItems0) UnmarshalBinary(b []byte) error { - var res LabelsAnonNameItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*LabelsItems0 MapFieldEntry allows to pass labels/dimensions in form like {"server": ["db1", "db2"...]}. -swagger:model LabelsItems0 -*/ -type LabelsItems0 struct { - - // key - Key string `json:"key,omitempty"` - - // value - Value []string `json:"value"` -} - -// Validate validates this labels items0 -func (o *LabelsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *LabelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *LabelsItems0) UnmarshalBinary(b []byte) error { - var res LabelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qanpb/json/client/metrics_names/get_metrics_names_parameters.go b/api/qanpb/json/client/metrics_names/get_metrics_names_parameters.go deleted file mode 100644 index 8316c16221..0000000000 --- a/api/qanpb/json/client/metrics_names/get_metrics_names_parameters.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package metrics_names - -// 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 values initialized. -func NewGetMetricsNamesParams() *GetMetricsNamesParams { - var () - return &GetMetricsNamesParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetMetricsNamesParamsWithTimeout creates a new GetMetricsNamesParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetMetricsNamesParamsWithTimeout(timeout time.Duration) *GetMetricsNamesParams { - var () - return &GetMetricsNamesParams{ - - timeout: timeout, - } -} - -// NewGetMetricsNamesParamsWithContext creates a new GetMetricsNamesParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetMetricsNamesParamsWithContext(ctx context.Context) *GetMetricsNamesParams { - var () - return &GetMetricsNamesParams{ - - Context: ctx, - } -} - -// NewGetMetricsNamesParamsWithHTTPClient creates a new GetMetricsNamesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetMetricsNamesParamsWithHTTPClient(client *http.Client) *GetMetricsNamesParams { - var () - 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*/ - Body interface{} - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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 interface{}) *GetMetricsNamesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get metrics names params -func (o *GetMetricsNamesParams) SetBody(body interface{}) { - 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/qanpb/json/client/metrics_names/get_metrics_names_responses.go b/api/qanpb/json/client/metrics_names/get_metrics_names_responses.go deleted file mode 100644 index 0f5246887c..0000000000 --- a/api/qanpb/json/client/metrics_names/get_metrics_names_responses.go +++ /dev/null @@ -1,263 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package metrics_names - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type GetMetricsNamesOK struct { - Payload *GetMetricsNamesOKBody -} - -func (o *GetMetricsNamesOK) Error() string { - return fmt.Sprintf("[POST /v0/qan/GetMetricsNames][%d] getMetricsNamesOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type GetMetricsNamesDefault struct { - _statusCode int - - Payload *GetMetricsNamesDefaultBody -} - -// 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 { - return fmt.Sprintf("[POST /v0/qan/GetMetricsNames][%d] GetMetricsNames default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*GetMetricsNamesDefaultBody get metrics names default body -swagger:model GetMetricsNamesDefaultBody -*/ -type GetMetricsNamesDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*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 -} - -// 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/qanpb/json/client/metrics_names/metrics_names_client.go b/api/qanpb/json/client/metrics_names/metrics_names_client.go deleted file mode 100644 index c803c2e229..0000000000 --- a/api/qanpb/json/client/metrics_names/metrics_names_client.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package metrics_names - -// 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" - "github.com/go-openapi/strfmt" -) - -// New creates a new metrics names API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for metrics names API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - GetMetricsNames(params *GetMetricsNamesParams) (*GetMetricsNamesOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetMetricsNames gets metrics names gets map of metrics names -*/ -func (a *Client) GetMetricsNames(params *GetMetricsNamesParams) (*GetMetricsNamesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetMetricsNamesParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "GetMetricsNames", - Method: "POST", - PathPattern: "/v0/qan/GetMetricsNames", - 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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetMetricsNamesOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetMetricsNamesDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/qanpb/json/client/object_details/get_histogram_parameters.go b/api/qanpb/json/client/object_details/get_histogram_parameters.go deleted file mode 100644 index 9508fbe366..0000000000 --- a/api/qanpb/json/client/object_details/get_histogram_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetHistogramParams creates a new GetHistogramParams object -// with the default values initialized. -func NewGetHistogramParams() *GetHistogramParams { - var () - return &GetHistogramParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetHistogramParamsWithTimeout creates a new GetHistogramParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetHistogramParamsWithTimeout(timeout time.Duration) *GetHistogramParams { - var () - return &GetHistogramParams{ - - timeout: timeout, - } -} - -// NewGetHistogramParamsWithContext creates a new GetHistogramParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetHistogramParamsWithContext(ctx context.Context) *GetHistogramParams { - var () - return &GetHistogramParams{ - - Context: ctx, - } -} - -// NewGetHistogramParamsWithHTTPClient creates a new GetHistogramParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetHistogramParamsWithHTTPClient(client *http.Client) *GetHistogramParams { - var () - 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*/ - Body GetHistogramBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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/qanpb/json/client/object_details/get_histogram_responses.go b/api/qanpb/json/client/object_details/get_histogram_responses.go deleted file mode 100644 index f324240bd0..0000000000 --- a/api/qanpb/json/client/object_details/get_histogram_responses.go +++ /dev/null @@ -1,477 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type GetHistogramOK struct { - Payload *GetHistogramOKBody -} - -func (o *GetHistogramOK) Error() string { - return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetHistogram][%d] getHistogramOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type GetHistogramDefault struct { - _statusCode int - - Payload *GetHistogramDefaultBody -} - -// Code gets the status code for the get histogram default response -func (o *GetHistogramDefault) Code() int { - return o._statusCode -} - -func (o *GetHistogramDefault) Error() string { - return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetHistogram][%d] GetHistogram default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*GetHistogramBody HistogramRequest 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 []*LabelsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*GetHistogramOKBody HistogramReply is histogram items as a list. -swagger:model GetHistogramOKBody -*/ -type GetHistogramOKBody struct { - - // histogram items - HistogramItems []*HistogramItemsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*HistogramItemsItems0 HistogramItem represents one item in histogram. -swagger:model HistogramItemsItems0 -*/ -type HistogramItemsItems0 struct { - - // range - Range string `json:"range,omitempty"` - - // frequency - Frequency int64 `json:"frequency,omitempty"` -} - -// Validate validates this histogram items items0 -func (o *HistogramItemsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *HistogramItemsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *HistogramItemsItems0) UnmarshalBinary(b []byte) error { - var res HistogramItemsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*LabelsItems0 MapFieldEntry allows to pass labels/dimensions in form like {"server": ["db1", "db2"...]}. -swagger:model LabelsItems0 -*/ -type LabelsItems0 struct { - - // key - Key string `json:"key,omitempty"` - - // value - Value []string `json:"value"` -} - -// Validate validates this labels items0 -func (o *LabelsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *LabelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *LabelsItems0) UnmarshalBinary(b []byte) error { - var res LabelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qanpb/json/client/object_details/get_labels_parameters.go b/api/qanpb/json/client/object_details/get_labels_parameters.go deleted file mode 100644 index 8beec1a889..0000000000 --- a/api/qanpb/json/client/object_details/get_labels_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetLabelsParams creates a new GetLabelsParams object -// with the default values initialized. -func NewGetLabelsParams() *GetLabelsParams { - var () - return &GetLabelsParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetLabelsParamsWithTimeout creates a new GetLabelsParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetLabelsParamsWithTimeout(timeout time.Duration) *GetLabelsParams { - var () - return &GetLabelsParams{ - - timeout: timeout, - } -} - -// NewGetLabelsParamsWithContext creates a new GetLabelsParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetLabelsParamsWithContext(ctx context.Context) *GetLabelsParams { - var () - return &GetLabelsParams{ - - Context: ctx, - } -} - -// NewGetLabelsParamsWithHTTPClient creates a new GetLabelsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetLabelsParamsWithHTTPClient(client *http.Client) *GetLabelsParams { - var () - 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*/ - Body GetLabelsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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/qanpb/json/client/object_details/get_labels_responses.go b/api/qanpb/json/client/object_details/get_labels_responses.go deleted file mode 100644 index d9ed537862..0000000000 --- a/api/qanpb/json/client/object_details/get_labels_responses.go +++ /dev/null @@ -1,372 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type GetLabelsOK struct { - Payload *GetLabelsOKBody -} - -func (o *GetLabelsOK) Error() string { - return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetLabels][%d] getLabelsOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type GetLabelsDefault struct { - _statusCode int - - Payload *GetLabelsDefaultBody -} - -// Code gets the status code for the get labels default response -func (o *GetLabelsDefault) Code() int { - return o._statusCode -} - -func (o *GetLabelsDefault) Error() string { - return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetLabels][%d] GetLabels default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*GetLabelsBody ObjectDetailsLabelsRequest 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 -} - -// 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 { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*GetLabelsOKBody ObjectDetailsLabelsReply is a map of labels names as keys and labels values as a list. -swagger:model GetLabelsOKBody -*/ -type GetLabelsOKBody struct { - - // labels - Labels map[string]LabelsAnon `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 { - 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 -} - -/*LabelsAnon ListLabelValues is list of label's values. -swagger:model LabelsAnon -*/ -type LabelsAnon struct { - - // values - Values []string `json:"values"` -} - -// Validate validates this labels anon -func (o *LabelsAnon) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *LabelsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *LabelsAnon) UnmarshalBinary(b []byte) error { - var res LabelsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qanpb/json/client/object_details/get_metrics_parameters.go b/api/qanpb/json/client/object_details/get_metrics_parameters.go deleted file mode 100644 index bdfbbcc357..0000000000 --- a/api/qanpb/json/client/object_details/get_metrics_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetMetricsParams creates a new GetMetricsParams object -// with the default values initialized. -func NewGetMetricsParams() *GetMetricsParams { - var () - return &GetMetricsParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetMetricsParamsWithTimeout creates a new GetMetricsParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetMetricsParamsWithTimeout(timeout time.Duration) *GetMetricsParams { - var () - return &GetMetricsParams{ - - timeout: timeout, - } -} - -// NewGetMetricsParamsWithContext creates a new GetMetricsParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetMetricsParamsWithContext(ctx context.Context) *GetMetricsParams { - var () - return &GetMetricsParams{ - - Context: ctx, - } -} - -// NewGetMetricsParamsWithHTTPClient creates a new GetMetricsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetMetricsParamsWithHTTPClient(client *http.Client) *GetMetricsParams { - var () - 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*/ - Body GetMetricsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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/qanpb/json/client/object_details/get_metrics_responses.go b/api/qanpb/json/client/object_details/get_metrics_responses.go deleted file mode 100644 index 39c06452e0..0000000000 --- a/api/qanpb/json/client/object_details/get_metrics_responses.go +++ /dev/null @@ -1,775 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type GetMetricsOK struct { - Payload *GetMetricsOKBody -} - -func (o *GetMetricsOK) Error() string { - return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetMetrics][%d] getMetricsOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type GetMetricsDefault struct { - _statusCode int - - Payload *GetMetricsDefaultBody -} - -// Code gets the status code for the get metrics default response -func (o *GetMetricsDefault) Code() int { - return o._statusCode -} - -func (o *GetMetricsDefault) Error() string { - return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetMetrics][%d] GetMetrics default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*GetMetricsBody MetricsRequest 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 []*LabelsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*GetMetricsOKBody MetricsReply defines metrics for specific value of dimension (ex.: host=hostname1 or queryid=1D410B4BE5060972. -swagger:model GetMetricsOKBody -*/ -type GetMetricsOKBody struct { - - // metrics - Metrics map[string]MetricsAnon `json:"metrics,omitempty"` - - // text metrics - TextMetrics map[string]string `json:"text_metrics,omitempty"` - - // sparkline - Sparkline []*SparklineItems0 `json:"sparkline"` - - // totals - Totals map[string]TotalsAnon `json:"totals,omitempty"` - - // fingerprint - Fingerprint string `json:"fingerprint,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 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 { - 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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 { - 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 -} - -/*MetricsAnon MetricValues is statistics of specific metric. -swagger:model MetricsAnon -*/ -type MetricsAnon 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 metrics anon -func (o *MetricsAnon) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *MetricsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *MetricsAnon) UnmarshalBinary(b []byte) error { - var res MetricsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*SparklineItems0 Point contains values that represents abscissa (time) and ordinate (volume etc.) -// of every point in a coordinate system of Sparklines. -swagger:model SparklineItems0 -*/ -type SparklineItems0 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"` - - // Boolean metrics: - // - *_sum_per_sec - how many times this matric was true. - // - // 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"` - - // MongoDB metrics. - // - // 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"` - - // PostgreSQL metrics. - // - // 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 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"` - - // pg_stat_monitor 0.9 metrics - // - // 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 sparkline items0 -func (o *SparklineItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SparklineItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SparklineItems0) UnmarshalBinary(b []byte) error { - var res SparklineItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*TotalsAnon MetricValues is statistics of specific metric. -swagger:model TotalsAnon -*/ -type TotalsAnon 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 totals anon -func (o *TotalsAnon) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *TotalsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *TotalsAnon) UnmarshalBinary(b []byte) error { - var res TotalsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qanpb/json/client/object_details/get_query_example_parameters.go b/api/qanpb/json/client/object_details/get_query_example_parameters.go deleted file mode 100644 index c442d7b28a..0000000000 --- a/api/qanpb/json/client/object_details/get_query_example_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetQueryExampleParams creates a new GetQueryExampleParams object -// with the default values initialized. -func NewGetQueryExampleParams() *GetQueryExampleParams { - var () - return &GetQueryExampleParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetQueryExampleParamsWithTimeout creates a new GetQueryExampleParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetQueryExampleParamsWithTimeout(timeout time.Duration) *GetQueryExampleParams { - var () - return &GetQueryExampleParams{ - - timeout: timeout, - } -} - -// NewGetQueryExampleParamsWithContext creates a new GetQueryExampleParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetQueryExampleParamsWithContext(ctx context.Context) *GetQueryExampleParams { - var () - return &GetQueryExampleParams{ - - Context: ctx, - } -} - -// NewGetQueryExampleParamsWithHTTPClient creates a new GetQueryExampleParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetQueryExampleParamsWithHTTPClient(client *http.Client) *GetQueryExampleParams { - var () - 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*/ - Body GetQueryExampleBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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/qanpb/json/client/object_details/get_query_example_responses.go b/api/qanpb/json/client/object_details/get_query_example_responses.go deleted file mode 100644 index c250a66b68..0000000000 --- a/api/qanpb/json/client/object_details/get_query_example_responses.go +++ /dev/null @@ -1,550 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// 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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type GetQueryExampleOK struct { - Payload *GetQueryExampleOKBody -} - -func (o *GetQueryExampleOK) Error() string { - return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetQueryExample][%d] getQueryExampleOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type GetQueryExampleDefault struct { - _statusCode int - - Payload *GetQueryExampleDefaultBody -} - -// 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 { - return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetQueryExample][%d] GetQueryExample default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*GetQueryExampleBody QueryExampleRequest 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 []*LabelsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*GetQueryExampleOKBody QueryExampleReply list of query examples. -swagger:model GetQueryExampleOKBody -*/ -type GetQueryExampleOKBody struct { - - // query examples - QueryExamples []*QueryExamplesItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*QueryExamplesItems0 QueryExample shows query examples and their metrics. -swagger:model QueryExamplesItems0 -*/ -type QueryExamplesItems0 struct { - - // example - Example string `json:"example,omitempty"` - - // ExampleFormat is format of query example: real or query without values. - // - // Deprecated: is not used, should not be used, should be removed. - // Enum: [EXAMPLE_FORMAT_INVALID EXAMPLE FINGERPRINT] - ExampleFormat *string `json:"example_format,omitempty"` - - // ExampleType is a type of query example selected for this query class in given period of time. - // Enum: [EXAMPLE_TYPE_INVALID RANDOM SLOWEST FASTEST WITH_ERROR] - ExampleType *string `json:"example_type,omitempty"` - - // is truncated - IsTruncated int64 `json:"is_truncated,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 query examples items0 -func (o *QueryExamplesItems0) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExampleFormat(formats); err != nil { - res = append(res, err) - } - - if err := o.validateExampleType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var queryExamplesItems0TypeExampleFormatPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["EXAMPLE_FORMAT_INVALID","EXAMPLE","FINGERPRINT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - queryExamplesItems0TypeExampleFormatPropEnum = append(queryExamplesItems0TypeExampleFormatPropEnum, v) - } -} - -const ( - - // QueryExamplesItems0ExampleFormatEXAMPLEFORMATINVALID captures enum value "EXAMPLE_FORMAT_INVALID" - QueryExamplesItems0ExampleFormatEXAMPLEFORMATINVALID string = "EXAMPLE_FORMAT_INVALID" - - // QueryExamplesItems0ExampleFormatEXAMPLE captures enum value "EXAMPLE" - QueryExamplesItems0ExampleFormatEXAMPLE string = "EXAMPLE" - - // QueryExamplesItems0ExampleFormatFINGERPRINT captures enum value "FINGERPRINT" - QueryExamplesItems0ExampleFormatFINGERPRINT string = "FINGERPRINT" -) - -// prop value enum -func (o *QueryExamplesItems0) validateExampleFormatEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, queryExamplesItems0TypeExampleFormatPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *QueryExamplesItems0) validateExampleFormat(formats strfmt.Registry) error { - - if swag.IsZero(o.ExampleFormat) { // not required - return nil - } - - // value enum - if err := o.validateExampleFormatEnum("example_format", "body", *o.ExampleFormat); err != nil { - return err - } - - return nil -} - -var queryExamplesItems0TypeExampleTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["EXAMPLE_TYPE_INVALID","RANDOM","SLOWEST","FASTEST","WITH_ERROR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - queryExamplesItems0TypeExampleTypePropEnum = append(queryExamplesItems0TypeExampleTypePropEnum, v) - } -} - -const ( - - // QueryExamplesItems0ExampleTypeEXAMPLETYPEINVALID captures enum value "EXAMPLE_TYPE_INVALID" - QueryExamplesItems0ExampleTypeEXAMPLETYPEINVALID string = "EXAMPLE_TYPE_INVALID" - - // QueryExamplesItems0ExampleTypeRANDOM captures enum value "RANDOM" - QueryExamplesItems0ExampleTypeRANDOM string = "RANDOM" - - // QueryExamplesItems0ExampleTypeSLOWEST captures enum value "SLOWEST" - QueryExamplesItems0ExampleTypeSLOWEST string = "SLOWEST" - - // QueryExamplesItems0ExampleTypeFASTEST captures enum value "FASTEST" - QueryExamplesItems0ExampleTypeFASTEST string = "FASTEST" - - // QueryExamplesItems0ExampleTypeWITHERROR captures enum value "WITH_ERROR" - QueryExamplesItems0ExampleTypeWITHERROR string = "WITH_ERROR" -) - -// prop value enum -func (o *QueryExamplesItems0) validateExampleTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, queryExamplesItems0TypeExampleTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *QueryExamplesItems0) 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 -} - -// MarshalBinary interface implementation -func (o *QueryExamplesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *QueryExamplesItems0) UnmarshalBinary(b []byte) error { - var res QueryExamplesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qanpb/json/client/object_details/get_query_plan_parameters.go b/api/qanpb/json/client/object_details/get_query_plan_parameters.go deleted file mode 100644 index caf848d076..0000000000 --- a/api/qanpb/json/client/object_details/get_query_plan_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetQueryPlanParams creates a new GetQueryPlanParams object -// with the default values initialized. -func NewGetQueryPlanParams() *GetQueryPlanParams { - var () - return &GetQueryPlanParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetQueryPlanParamsWithTimeout creates a new GetQueryPlanParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetQueryPlanParamsWithTimeout(timeout time.Duration) *GetQueryPlanParams { - var () - return &GetQueryPlanParams{ - - timeout: timeout, - } -} - -// NewGetQueryPlanParamsWithContext creates a new GetQueryPlanParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetQueryPlanParamsWithContext(ctx context.Context) *GetQueryPlanParams { - var () - return &GetQueryPlanParams{ - - Context: ctx, - } -} - -// NewGetQueryPlanParamsWithHTTPClient creates a new GetQueryPlanParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetQueryPlanParamsWithHTTPClient(client *http.Client) *GetQueryPlanParams { - var () - 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 { - - /*Body*/ - Body GetQueryPlanBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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 -} - -// WithBody adds the body to the get query plan params -func (o *GetQueryPlanParams) WithBody(body GetQueryPlanBody) *GetQueryPlanParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get query plan params -func (o *GetQueryPlanParams) SetBody(body GetQueryPlanBody) { - o.Body = body -} - -// 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 - - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/qanpb/json/client/object_details/get_query_plan_responses.go b/api/qanpb/json/client/object_details/get_query_plan_responses.go deleted file mode 100644 index d7411ff11a..0000000000 --- a/api/qanpb/json/client/object_details/get_query_plan_responses.go +++ /dev/null @@ -1,260 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type GetQueryPlanOK struct { - Payload *GetQueryPlanOKBody -} - -func (o *GetQueryPlanOK) Error() string { - return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetQueryPlan][%d] getQueryPlanOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type GetQueryPlanDefault struct { - _statusCode int - - Payload *GetQueryPlanDefaultBody -} - -// 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 { - return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetQueryPlan][%d] GetQueryPlan default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*GetQueryPlanBody QueryPlanRequest defines filtering by queryid. -swagger:model GetQueryPlanBody -*/ -type GetQueryPlanBody struct { - - // queryid - Queryid string `json:"queryid,omitempty"` -} - -// Validate validates this get query plan body -func (o *GetQueryPlanBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetQueryPlanBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetQueryPlanBody) UnmarshalBinary(b []byte) error { - var res GetQueryPlanBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*GetQueryPlanDefaultBody get query plan default body -swagger:model GetQueryPlanDefaultBody -*/ -type GetQueryPlanDefaultBody struct { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*GetQueryPlanOKBody QueryPlanReply 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 -} - -// 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/qanpb/json/client/object_details/object_details_client.go b/api/qanpb/json/client/object_details/object_details_client.go deleted file mode 100644 index e9cacf9b3e..0000000000 --- a/api/qanpb/json/client/object_details/object_details_client.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package object_details - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new object details API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for object details API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - GetHistogram(params *GetHistogramParams) (*GetHistogramOK, error) - - GetLabels(params *GetLabelsParams) (*GetLabelsOK, error) - - GetMetrics(params *GetMetricsParams) (*GetMetricsOK, error) - - GetQueryExample(params *GetQueryExampleParams) (*GetQueryExampleOK, error) - - GetQueryPlan(params *GetQueryPlanParams) (*GetQueryPlanOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetHistogram gets histogram gets histogram items for specific filtering -*/ -func (a *Client) GetHistogram(params *GetHistogramParams) (*GetHistogramOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetHistogramParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "GetHistogram", - Method: "POST", - PathPattern: "/v0/qan/ObjectDetails/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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetHistogramOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetHistogramDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - GetLabels gets labels gets list of labels for object details -*/ -func (a *Client) GetLabels(params *GetLabelsParams) (*GetLabelsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetLabelsParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "GetLabels", - Method: "POST", - PathPattern: "/v0/qan/ObjectDetails/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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetLabelsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetLabelsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - GetMetrics gets metrics gets map of metrics for specific filtering -*/ -func (a *Client) GetMetrics(params *GetMetricsParams) (*GetMetricsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetMetricsParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "GetMetrics", - Method: "POST", - PathPattern: "/v0/qan/ObjectDetails/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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetMetricsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetMetricsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - GetQueryExample gets query example gets list of query examples -*/ -func (a *Client) GetQueryExample(params *GetQueryExampleParams) (*GetQueryExampleOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetQueryExampleParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "GetQueryExample", - Method: "POST", - PathPattern: "/v0/qan/ObjectDetails/GetQueryExample", - 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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetQueryExampleOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetQueryExampleDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* - GetQueryPlan gets query plan gets query plan and plan id for specific filtering -*/ -func (a *Client) GetQueryPlan(params *GetQueryPlanParams) (*GetQueryPlanOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetQueryPlanParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "GetQueryPlan", - Method: "POST", - PathPattern: "/v0/qan/ObjectDetails/GetQueryPlan", - 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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetQueryPlanOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetQueryPlanDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/qanpb/json/client/pmm_qan_client.go b/api/qanpb/json/client/pmm_qan_client.go deleted file mode 100644 index aeec23e937..0000000000 --- a/api/qanpb/json/client/pmm_qan_client.go +++ /dev/null @@ -1,127 +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/qanpb/json/client/filters" - "github.com/percona/pmm/api/qanpb/json/client/metrics_names" - "github.com/percona/pmm/api/qanpb/json/client/object_details" - "github.com/percona/pmm/api/qanpb/json/client/profile" -) - -// Default PMM QAN 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 HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMQAN { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM QAN HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMQAN { - // 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 client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMQAN { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(PMMQAN) - cli.Transport = transport - cli.Filters = filters.New(transport, formats) - cli.MetricsNames = metrics_names.New(transport, formats) - cli.ObjectDetails = object_details.New(transport, formats) - cli.Profile = profile.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 -} - -// PMMQAN is a client for PMM QAN -type PMMQAN struct { - Filters filters.ClientService - - MetricsNames metrics_names.ClientService - - ObjectDetails object_details.ClientService - - Profile profile.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMQAN) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.Filters.SetTransport(transport) - c.MetricsNames.SetTransport(transport) - c.ObjectDetails.SetTransport(transport) - c.Profile.SetTransport(transport) -} diff --git a/api/qanpb/json/client/profile/get_report_parameters.go b/api/qanpb/json/client/profile/get_report_parameters.go deleted file mode 100644 index cfa9d6b788..0000000000 --- a/api/qanpb/json/client/profile/get_report_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package profile - -// 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 values initialized. -func NewGetReportParams() *GetReportParams { - var () - return &GetReportParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetReportParamsWithTimeout creates a new GetReportParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetReportParamsWithTimeout(timeout time.Duration) *GetReportParams { - var () - return &GetReportParams{ - - timeout: timeout, - } -} - -// NewGetReportParamsWithContext creates a new GetReportParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetReportParamsWithContext(ctx context.Context) *GetReportParams { - var () - return &GetReportParams{ - - Context: ctx, - } -} - -// NewGetReportParamsWithHTTPClient creates a new GetReportParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetReportParamsWithHTTPClient(client *http.Client) *GetReportParams { - var () - 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*/ - Body GetReportBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// 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/qanpb/json/client/profile/get_report_responses.go b/api/qanpb/json/client/profile/get_report_responses.go deleted file mode 100644 index c68b9972a0..0000000000 --- a/api/qanpb/json/client/profile/get_report_responses.go +++ /dev/null @@ -1,922 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package profile - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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) (interface{}, 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 handles this case with default header values. - -A successful response. -*/ -type GetReportOK struct { - Payload *GetReportOKBody -} - -func (o *GetReportOK) Error() string { - return fmt.Sprintf("[POST /v0/qan/GetReport][%d] getReportOk %+v", 200, o.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 && 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 handles this case with default header values. - -An unexpected error response. -*/ -type GetReportDefault struct { - _statusCode int - - Payload *GetReportDefaultBody -} - -// Code gets the status code for the get report default response -func (o *GetReportDefault) Code() int { - return o._statusCode -} - -func (o *GetReportDefault) Error() string { - return fmt.Sprintf("[POST /v0/qan/GetReport][%d] GetReport default %+v", o._statusCode, o.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 && err != io.EOF { - return err - } - - return nil -} - -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - 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 []*LabelsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 { - - // error - Error string `json:"error,omitempty"` - - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DetailsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*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 []*RowsItems0 `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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.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 -} - -/*LabelsItems0 ReportMapFieldEntry allows to pass labels/dimentions in form like {"server": ["db1", "db2"...]}. -swagger:model LabelsItems0 -*/ -type LabelsItems0 struct { - - // key - Key string `json:"key,omitempty"` - - // value - Value []string `json:"value"` -} - -// Validate validates this labels items0 -func (o *LabelsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *LabelsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *LabelsItems0) UnmarshalBinary(b []byte) error { - var res LabelsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*RowsItems0 Row define metrics for selected dimention. -swagger:model RowsItems0 -*/ -type RowsItems0 struct { - - // rank - Rank int64 `json:"rank,omitempty"` - - // dimension - Dimension string `json:"dimension,omitempty"` - - // database - Database string `json:"database,omitempty"` - - // metrics - Metrics map[string]RowsItems0MetricsAnon `json:"metrics,omitempty"` - - // sparkline - Sparkline []*RowsItems0SparklineItems0 `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 rows items0 -func (o *RowsItems0) 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 *RowsItems0) 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 { - return err - } - } - - } - - return nil -} - -func (o *RowsItems0) 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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sparkline" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RowsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RowsItems0) UnmarshalBinary(b []byte) error { - var res RowsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*RowsItems0MetricsAnon Metric cell. -swagger:model RowsItems0MetricsAnon -*/ -type RowsItems0MetricsAnon struct { - - // stats - Stats *RowsItems0MetricsAnonStats `json:"stats,omitempty"` -} - -// Validate validates this rows items0 metrics anon -func (o *RowsItems0MetricsAnon) 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 *RowsItems0MetricsAnon) 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 { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("stats") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RowsItems0MetricsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RowsItems0MetricsAnon) UnmarshalBinary(b []byte) error { - var res RowsItems0MetricsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*RowsItems0MetricsAnonStats Stat is statistics of specific metric. -swagger:model RowsItems0MetricsAnonStats -*/ -type RowsItems0MetricsAnonStats 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 rows items0 metrics anon stats -func (o *RowsItems0MetricsAnonStats) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RowsItems0MetricsAnonStats) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RowsItems0MetricsAnonStats) UnmarshalBinary(b []byte) error { - var res RowsItems0MetricsAnonStats - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*RowsItems0SparklineItems0 Point contains values that represents abscissa (time) and ordinate (volume etc.) -// of every point in a coordinate system of Sparklines. -swagger:model RowsItems0SparklineItems0 -*/ -type RowsItems0SparklineItems0 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"` - - // Boolean metrics: - // - *_sum_per_sec - how many times this matric was true. - // - // 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"` - - // MongoDB metrics. - // - // 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"` - - // PostgreSQL metrics. - // - // 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 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"` - - // pg_stat_monitor 0.9 metrics - // - // 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 rows items0 sparkline items0 -func (o *RowsItems0SparklineItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *RowsItems0SparklineItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RowsItems0SparklineItems0) UnmarshalBinary(b []byte) error { - var res RowsItems0SparklineItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/qanpb/json/client/profile/profile_client.go b/api/qanpb/json/client/profile/profile_client.go deleted file mode 100644 index f691d86375..0000000000 --- a/api/qanpb/json/client/profile/profile_client.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package profile - -// 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" - "github.com/go-openapi/strfmt" -) - -// New creates a new profile API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for profile API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - GetReport(params *GetReportParams) (*GetReportOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetReport gets report returns list of metrics group by queryid or other dimentions -*/ -func (a *Client) GetReport(params *GetReportParams) (*GetReportOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetReportParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "GetReport", - Method: "POST", - PathPattern: "/v0/qan/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, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetReportOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetReportDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/api/qanpb/json/qanpb.json b/api/qanpb/json/qanpb.json index 7c91867ee9..1332941ef1 100644 --- a/api/qanpb/json/qanpb.json +++ b/api/qanpb/json/qanpb.json @@ -407,8 +407,7 @@ "format": "float", "x-order": 7 } - }, - "x-order": 0 + } } } }, @@ -1809,8 +1808,7 @@ "EXAMPLE_FORMAT_INVALID", "EXAMPLE", "FINGERPRINT" - ], - "x-order": 1 + ] }, "example_metrics": { "type": "string", @@ -1826,8 +1824,7 @@ "SLOWEST", "FASTEST", "WITH_ERROR" - ], - "x-order": 2 + ] }, "is_truncated": { "type": "integer", diff --git a/api/qanpb/metrics_names.pb.go b/api/qanpb/metrics_names.pb.go index 4384b8d87b..3c8c1e75f9 100644 --- a/api/qanpb/metrics_names.pb.go +++ b/api/qanpb/metrics_names.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: qanpb/metrics_names.proto diff --git a/api/qanpb/object_details.pb.go b/api/qanpb/object_details.pb.go index 2e21d46259..d29096e8c1 100644 --- a/api/qanpb/object_details.pb.go +++ b/api/qanpb/object_details.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: qanpb/object_details.proto diff --git a/api/qanpb/profile.pb.go b/api/qanpb/profile.pb.go index 2d0d814aa6..ca0954da48 100644 --- a/api/qanpb/profile.pb.go +++ b/api/qanpb/profile.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: qanpb/profile.proto diff --git a/api/qanpb/qan.pb.go b/api/qanpb/qan.pb.go index db22bc73ea..b2fab9bb74 100644 --- a/api/qanpb/qan.pb.go +++ b/api/qanpb/qan.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: qanpb/qan.proto diff --git a/api/serverpb/json/client/pmm_server_client.go b/api/serverpb/json/client/pmm_server_api_client.go similarity index 80% rename from api/serverpb/json/client/pmm_server_client.go rename to api/serverpb/json/client/pmm_server_api_client.go index 1b79847253..cf82cc5495 100644 --- a/api/serverpb/json/client/pmm_server_client.go +++ b/api/serverpb/json/client/pmm_server_api_client.go @@ -10,10 +10,10 @@ import ( httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - "github.com/percona/pmm/api/serverpb/json/client/server" + serverops "github.com/percona/pmm/api/serverpb/json/client/server" ) -// Default PMM server HTTP client. +// Default PMM server API HTTP client. var Default = NewHTTPClient(nil) const ( @@ -28,14 +28,14 @@ const ( // DefaultSchemes are the default schemes found in Meta (info) section of spec file var DefaultSchemes = []string{"http", "https"} -// NewHTTPClient creates a new PMM server HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMServer { +// 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 HTTP client, +// NewHTTPClientWithConfig creates a new PMM server API HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMServer { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMServerAPI { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -46,16 +46,16 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMM return New(transport, formats) } -// New creates a new PMM server client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMServer { +// 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(PMMServer) + cli := new(PMMServerAPI) cli.Transport = transport - cli.Server = server.New(transport, formats) + cli.Server = serverops.New(transport, formats) return cli } @@ -98,15 +98,15 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// PMMServer is a client for PMM server -type PMMServer struct { - Server server.ClientService +// PMMServerAPI is a client for PMM server API +type PMMServerAPI struct { + Server serverops.ClientService Transport runtime.ClientTransport } // SetTransport changes the transport on the client and all its subresources -func (c *PMMServer) SetTransport(transport runtime.ClientTransport) { +func (c *PMMServerAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Server.SetTransport(transport) } diff --git a/api/serverpb/json/client/server/aws_instance_check_parameters.go b/api/serverpb/json/client/server/aws_instance_check_parameters.go index e2561a37b4..48ce84d0eb 100644 --- a/api/serverpb/json/client/server/aws_instance_check_parameters.go +++ b/api/serverpb/json/client/server/aws_instance_check_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAWSInstanceCheckParams creates a new AWSInstanceCheckParams object -// with the default values initialized. +// NewAWSInstanceCheckParams creates a new AWSInstanceCheckParams 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 NewAWSInstanceCheckParams() *AWSInstanceCheckParams { - var () return &AWSInstanceCheckParams{ - timeout: cr.DefaultTimeout, } } // NewAWSInstanceCheckParamsWithTimeout creates a new AWSInstanceCheckParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAWSInstanceCheckParamsWithTimeout(timeout time.Duration) *AWSInstanceCheckParams { - var () return &AWSInstanceCheckParams{ - timeout: timeout, } } // NewAWSInstanceCheckParamsWithContext creates a new AWSInstanceCheckParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAWSInstanceCheckParamsWithContext(ctx context.Context) *AWSInstanceCheckParams { - var () return &AWSInstanceCheckParams{ - Context: ctx, } } // NewAWSInstanceCheckParamsWithHTTPClient creates a new AWSInstanceCheckParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAWSInstanceCheckParamsWithHTTPClient(client *http.Client) *AWSInstanceCheckParams { - var () return &AWSInstanceCheckParams{ HTTPClient: client, } } -/*AWSInstanceCheckParams contains all the parameters to send to the API endpoint -for the AWS instance check operation typically these are written to a http.Request +/* AWSInstanceCheckParams contains all the parameters to send to the API endpoint + for the AWS instance check operation. + + Typically these are written to a http.Request. */ type AWSInstanceCheckParams struct { - /*Body*/ + // Body. Body AWSInstanceCheckBody timeout time.Duration @@ -68,6 +67,21 @@ type AWSInstanceCheckParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the AWS instance check params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AWSInstanceCheckParams) WithDefaults() *AWSInstanceCheckParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the AWS instance check params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AWSInstanceCheckParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the AWS instance check params func (o *AWSInstanceCheckParams) WithTimeout(timeout time.Duration) *AWSInstanceCheckParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *AWSInstanceCheckParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/serverpb/json/client/server/aws_instance_check_responses.go b/api/serverpb/json/client/server/aws_instance_check_responses.go index 9cc4c9852a..2e826f10f2 100644 --- a/api/serverpb/json/client/server/aws_instance_check_responses.go +++ b/api/serverpb/json/client/server/aws_instance_check_responses.go @@ -6,6 +6,7 @@ package server // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewAWSInstanceCheckOK() *AWSInstanceCheckOK { return &AWSInstanceCheckOK{} } -/*AWSInstanceCheckOK handles this case with default header values. +/* AWSInstanceCheckOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type AWSInstanceCheckOK struct { func (o *AWSInstanceCheckOK) Error() string { return fmt.Sprintf("[POST /v1/AWSInstanceCheck][%d] awsInstanceCheckOk %+v", 200, o.Payload) } - func (o *AWSInstanceCheckOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewAWSInstanceCheckDefault(code int) *AWSInstanceCheckDefault { } } -/*AWSInstanceCheckDefault handles this case with default header values. +/* AWSInstanceCheckDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *AWSInstanceCheckDefault) Code() int { func (o *AWSInstanceCheckDefault) Error() string { return fmt.Sprintf("[POST /v1/AWSInstanceCheck][%d] AWSInstanceCheck default %+v", o._statusCode, o.Payload) } - func (o *AWSInstanceCheckDefault) GetPayload() *AWSInstanceCheckDefaultBody { return o.Payload } @@ -129,6 +128,11 @@ func (o *AWSInstanceCheckBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this AWS instance check body based on context it is used +func (o *AWSInstanceCheckBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *AWSInstanceCheckBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -162,7 +166,7 @@ type AWSInstanceCheckDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*AWSInstanceCheckDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this AWS instance check default body @@ -180,7 +184,6 @@ func (o *AWSInstanceCheckDefaultBody) Validate(formats strfmt.Registry) error { } func (o *AWSInstanceCheckDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -194,6 +197,42 @@ func (o *AWSInstanceCheckDefaultBody) validateDetails(formats strfmt.Registry) e if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("AWSInstanceCheck default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AWSInstanceCheck default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this AWS instance check default body based on the context it is used +func (o *AWSInstanceCheckDefaultBody) 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 *AWSInstanceCheckDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AWSInstanceCheck default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AWSInstanceCheck default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -222,10 +261,10 @@ func (o *AWSInstanceCheckDefaultBody) UnmarshalBinary(b []byte) error { return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 +/*AWSInstanceCheckDefaultBodyDetailsItems0 AWS instance check default body details items0 +swagger:model AWSInstanceCheckDefaultBodyDetailsItems0 */ -type DetailsItems0 struct { +type AWSInstanceCheckDefaultBodyDetailsItems0 struct { // type url TypeURL string `json:"type_url,omitempty"` @@ -235,13 +274,18 @@ type DetailsItems0 struct { Value strfmt.Base64 `json:"value,omitempty"` } -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { +// Validate validates this AWS instance check default body details items0 +func (o *AWSInstanceCheckDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this AWS instance check default body details items0 based on context it is used +func (o *AWSInstanceCheckDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { +func (o *AWSInstanceCheckDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } @@ -249,8 +293,8 @@ func (o *DetailsItems0) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 +func (o *AWSInstanceCheckDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AWSInstanceCheckDefaultBodyDetailsItems0 if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/api/serverpb/json/client/server/change_settings_parameters.go b/api/serverpb/json/client/server/change_settings_parameters.go index 5bade25c96..b41ed20af3 100644 --- a/api/serverpb/json/client/server/change_settings_parameters.go +++ b/api/serverpb/json/client/server/change_settings_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewChangeSettingsParams creates a new ChangeSettingsParams object -// with the default values initialized. +// 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 { - var () return &ChangeSettingsParams{ - timeout: cr.DefaultTimeout, } } // NewChangeSettingsParamsWithTimeout creates a new ChangeSettingsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewChangeSettingsParamsWithTimeout(timeout time.Duration) *ChangeSettingsParams { - var () return &ChangeSettingsParams{ - timeout: timeout, } } // NewChangeSettingsParamsWithContext creates a new ChangeSettingsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewChangeSettingsParamsWithContext(ctx context.Context) *ChangeSettingsParams { - var () return &ChangeSettingsParams{ - Context: ctx, } } // NewChangeSettingsParamsWithHTTPClient creates a new ChangeSettingsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewChangeSettingsParamsWithHTTPClient(client *http.Client) *ChangeSettingsParams { - var () 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 +/* 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. Body ChangeSettingsBody timeout time.Duration @@ -68,6 +67,21 @@ type ChangeSettingsParams struct { 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) @@ -119,7 +133,6 @@ func (o *ChangeSettingsParams) WriteToRequest(r runtime.ClientRequest, reg strfm return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/serverpb/json/client/server/change_settings_responses.go b/api/serverpb/json/client/server/change_settings_responses.go index e566fc7ca9..a60416250b 100644 --- a/api/serverpb/json/client/server/change_settings_responses.go +++ b/api/serverpb/json/client/server/change_settings_responses.go @@ -6,6 +6,7 @@ package server // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewChangeSettingsOK() *ChangeSettingsOK { return &ChangeSettingsOK{} } -/*ChangeSettingsOK handles this case with default header values. +/* ChangeSettingsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ChangeSettingsOK struct { func (o *ChangeSettingsOK) Error() string { return fmt.Sprintf("[POST /v1/Settings/Change][%d] changeSettingsOk %+v", 200, o.Payload) } - func (o *ChangeSettingsOK) GetPayload() *ChangeSettingsOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewChangeSettingsDefault(code int) *ChangeSettingsDefault { } } -/*ChangeSettingsDefault handles this case with default header values. +/* ChangeSettingsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *ChangeSettingsDefault) Code() int { func (o *ChangeSettingsDefault) Error() string { return fmt.Sprintf("[POST /v1/Settings/Change][%d] ChangeSettings default %+v", o._statusCode, o.Payload) } - func (o *ChangeSettingsDefault) GetPayload() *ChangeSettingsDefaultBody { return o.Payload } @@ -237,7 +236,6 @@ func (o *ChangeSettingsBody) Validate(formats strfmt.Registry) error { } func (o *ChangeSettingsBody) validateEmailAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.EmailAlertingSettings) { // not required return nil } @@ -246,6 +244,8 @@ func (o *ChangeSettingsBody) validateEmailAlertingSettings(formats strfmt.Regist if err := o.EmailAlertingSettings.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "email_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "email_alerting_settings") } return err } @@ -255,7 +255,6 @@ func (o *ChangeSettingsBody) validateEmailAlertingSettings(formats strfmt.Regist } func (o *ChangeSettingsBody) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required return nil } @@ -264,6 +263,8 @@ func (o *ChangeSettingsBody) validateMetricsResolutions(formats strfmt.Registry) if err := o.MetricsResolutions.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "metrics_resolutions") } return err } @@ -273,7 +274,6 @@ func (o *ChangeSettingsBody) validateMetricsResolutions(formats strfmt.Registry) } func (o *ChangeSettingsBody) validateSlackAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.SlackAlertingSettings) { // not required return nil } @@ -282,6 +282,8 @@ func (o *ChangeSettingsBody) validateSlackAlertingSettings(formats strfmt.Regist if err := o.SlackAlertingSettings.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "slack_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "slack_alerting_settings") } return err } @@ -291,7 +293,6 @@ func (o *ChangeSettingsBody) validateSlackAlertingSettings(formats strfmt.Regist } func (o *ChangeSettingsBody) validateSttCheckIntervals(formats strfmt.Registry) error { - if swag.IsZero(o.SttCheckIntervals) { // not required return nil } @@ -300,6 +301,98 @@ func (o *ChangeSettingsBody) validateSttCheckIntervals(formats strfmt.Registry) if err := o.SttCheckIntervals.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "stt_check_intervals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "stt_check_intervals") + } + 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.contextValidateEmailAlertingSettings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSlackAlertingSettings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSttCheckIntervals(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeSettingsBody) contextValidateEmailAlertingSettings(ctx context.Context, formats strfmt.Registry) error { + + if o.EmailAlertingSettings != nil { + if err := o.EmailAlertingSettings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "email_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "email_alerting_settings") + } + return err + } + } + + return nil +} + +func (o *ChangeSettingsBody) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "metrics_resolutions") + } + return err + } + } + + return nil +} + +func (o *ChangeSettingsBody) contextValidateSlackAlertingSettings(ctx context.Context, formats strfmt.Registry) error { + + if o.SlackAlertingSettings != nil { + if err := o.SlackAlertingSettings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "slack_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "slack_alerting_settings") + } + return err + } + } + + return nil +} + +func (o *ChangeSettingsBody) contextValidateSttCheckIntervals(ctx context.Context, formats strfmt.Registry) error { + + if o.SttCheckIntervals != nil { + if err := o.SttCheckIntervals.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "stt_check_intervals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "stt_check_intervals") } return err } @@ -341,7 +434,7 @@ type ChangeSettingsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ChangeSettingsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this change settings default body @@ -359,7 +452,6 @@ func (o *ChangeSettingsDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ChangeSettingsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -373,6 +465,42 @@ func (o *ChangeSettingsDefaultBody) validateDetails(formats strfmt.Registry) err if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ChangeSettings default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeSettings default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ChangeSettings default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -401,6 +529,47 @@ func (o *ChangeSettingsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*ChangeSettingsDefaultBodyDetailsItems0 change settings default body details items0 +swagger:model ChangeSettingsDefaultBodyDetailsItems0 +*/ +type ChangeSettingsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -425,7 +594,6 @@ func (o *ChangeSettingsOKBody) Validate(formats strfmt.Registry) error { } func (o *ChangeSettingsOKBody) validateSettings(formats strfmt.Registry) error { - if swag.IsZero(o.Settings) { // not required return nil } @@ -434,6 +602,38 @@ func (o *ChangeSettingsOKBody) validateSettings(formats strfmt.Registry) error { if err := o.Settings.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeSettingsOk" + "." + "settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Settings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeSettingsOk" + "." + "settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeSettingsOk" + "." + "settings") } return err } @@ -550,7 +750,6 @@ func (o *ChangeSettingsOKBodySettings) Validate(formats strfmt.Registry) error { } func (o *ChangeSettingsOKBodySettings) validateEmailAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.EmailAlertingSettings) { // not required return nil } @@ -559,6 +758,8 @@ func (o *ChangeSettingsOKBodySettings) validateEmailAlertingSettings(formats str if err := o.EmailAlertingSettings.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "email_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "email_alerting_settings") } return err } @@ -568,7 +769,6 @@ func (o *ChangeSettingsOKBodySettings) validateEmailAlertingSettings(formats str } func (o *ChangeSettingsOKBodySettings) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required return nil } @@ -577,6 +777,8 @@ func (o *ChangeSettingsOKBodySettings) validateMetricsResolutions(formats strfmt if err := o.MetricsResolutions.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "metrics_resolutions") } return err } @@ -586,7 +788,6 @@ func (o *ChangeSettingsOKBodySettings) validateMetricsResolutions(formats strfmt } func (o *ChangeSettingsOKBodySettings) validateSlackAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.SlackAlertingSettings) { // not required return nil } @@ -595,6 +796,8 @@ func (o *ChangeSettingsOKBodySettings) validateSlackAlertingSettings(formats str if err := o.SlackAlertingSettings.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") } return err } @@ -604,7 +807,6 @@ func (o *ChangeSettingsOKBodySettings) validateSlackAlertingSettings(formats str } func (o *ChangeSettingsOKBodySettings) validateSttCheckIntervals(formats strfmt.Registry) error { - if swag.IsZero(o.SttCheckIntervals) { // not required return nil } @@ -613,6 +815,98 @@ func (o *ChangeSettingsOKBodySettings) validateSttCheckIntervals(formats strfmt. if err := o.SttCheckIntervals.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "stt_check_intervals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "stt_check_intervals") + } + 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.contextValidateEmailAlertingSettings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSlackAlertingSettings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSttCheckIntervals(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeSettingsOKBodySettings) contextValidateEmailAlertingSettings(ctx context.Context, formats strfmt.Registry) error { + + if o.EmailAlertingSettings != nil { + if err := o.EmailAlertingSettings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "email_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "email_alerting_settings") + } + return err + } + } + + return nil +} + +func (o *ChangeSettingsOKBodySettings) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "metrics_resolutions") + } + return err + } + } + + return nil +} + +func (o *ChangeSettingsOKBodySettings) contextValidateSlackAlertingSettings(ctx context.Context, formats strfmt.Registry) error { + + if o.SlackAlertingSettings != nil { + if err := o.SlackAlertingSettings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") + } + return err + } + } + + return nil +} + +func (o *ChangeSettingsOKBodySettings) contextValidateSttCheckIntervals(ctx context.Context, formats strfmt.Registry) error { + + if o.SttCheckIntervals != nil { + if err := o.SttCheckIntervals.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("changeSettingsOk" + "." + "settings" + "." + "stt_check_intervals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("changeSettingsOk" + "." + "settings" + "." + "stt_check_intervals") } return err } @@ -674,6 +968,11 @@ func (o *ChangeSettingsOKBodySettingsEmailAlertingSettings) Validate(formats str return nil } +// ContextValidate validates this change settings OK body settings email alerting settings based on context it is used +func (o *ChangeSettingsOKBodySettingsEmailAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeSettingsOKBodySettingsEmailAlertingSettings) MarshalBinary() ([]byte, error) { if o == nil { @@ -712,6 +1011,11 @@ func (o *ChangeSettingsOKBodySettingsMetricsResolutions) Validate(formats strfmt 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 { @@ -744,6 +1048,11 @@ func (o *ChangeSettingsOKBodySettingsSlackAlertingSettings) Validate(formats str return nil } +// ContextValidate validates this change settings OK body settings slack alerting settings based on context it is used +func (o *ChangeSettingsOKBodySettingsSlackAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeSettingsOKBodySettingsSlackAlertingSettings) MarshalBinary() ([]byte, error) { if o == nil { @@ -782,6 +1091,11 @@ func (o *ChangeSettingsOKBodySettingsSttCheckIntervals) Validate(formats strfmt. return nil } +// ContextValidate validates this change settings OK body settings stt check intervals based on context it is used +func (o *ChangeSettingsOKBodySettingsSttCheckIntervals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeSettingsOKBodySettingsSttCheckIntervals) MarshalBinary() ([]byte, error) { if o == nil { @@ -835,6 +1149,11 @@ func (o *ChangeSettingsParamsBodyEmailAlertingSettings) Validate(formats strfmt. return nil } +// ContextValidate validates this change settings params body email alerting settings based on context it is used +func (o *ChangeSettingsParamsBodyEmailAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeSettingsParamsBodyEmailAlertingSettings) MarshalBinary() ([]byte, error) { if o == nil { @@ -873,6 +1192,11 @@ func (o *ChangeSettingsParamsBodyMetricsResolutions) Validate(formats strfmt.Reg 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 { @@ -905,6 +1229,11 @@ func (o *ChangeSettingsParamsBodySlackAlertingSettings) Validate(formats strfmt. return nil } +// ContextValidate validates this change settings params body slack alerting settings based on context it is used +func (o *ChangeSettingsParamsBodySlackAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeSettingsParamsBodySlackAlertingSettings) MarshalBinary() ([]byte, error) { if o == nil { @@ -943,6 +1272,11 @@ func (o *ChangeSettingsParamsBodySttCheckIntervals) Validate(formats strfmt.Regi return nil } +// ContextValidate validates this change settings params body stt check intervals based on context it is used +func (o *ChangeSettingsParamsBodySttCheckIntervals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *ChangeSettingsParamsBodySttCheckIntervals) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/serverpb/json/client/server/check_updates_parameters.go b/api/serverpb/json/client/server/check_updates_parameters.go index 0746d3c96d..3e0587b901 100644 --- a/api/serverpb/json/client/server/check_updates_parameters.go +++ b/api/serverpb/json/client/server/check_updates_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewCheckUpdatesParams creates a new CheckUpdatesParams object -// with the default values initialized. +// 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 { - var () return &CheckUpdatesParams{ - timeout: cr.DefaultTimeout, } } // NewCheckUpdatesParamsWithTimeout creates a new CheckUpdatesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCheckUpdatesParamsWithTimeout(timeout time.Duration) *CheckUpdatesParams { - var () return &CheckUpdatesParams{ - timeout: timeout, } } // NewCheckUpdatesParamsWithContext creates a new CheckUpdatesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCheckUpdatesParamsWithContext(ctx context.Context) *CheckUpdatesParams { - var () return &CheckUpdatesParams{ - Context: ctx, } } // NewCheckUpdatesParamsWithHTTPClient creates a new CheckUpdatesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCheckUpdatesParamsWithHTTPClient(client *http.Client) *CheckUpdatesParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body CheckUpdatesBody timeout time.Duration @@ -68,6 +67,21 @@ type CheckUpdatesParams struct { 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) @@ -119,7 +133,6 @@ func (o *CheckUpdatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/serverpb/json/client/server/check_updates_responses.go b/api/serverpb/json/client/server/check_updates_responses.go index 548e0483f8..0bc99a01df 100644 --- a/api/serverpb/json/client/server/check_updates_responses.go +++ b/api/serverpb/json/client/server/check_updates_responses.go @@ -6,6 +6,7 @@ package server // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -48,7 +49,7 @@ func NewCheckUpdatesOK() *CheckUpdatesOK { return &CheckUpdatesOK{} } -/*CheckUpdatesOK handles this case with default header values. +/* CheckUpdatesOK describes a response with status code 200, with default header values. A successful response. */ @@ -59,7 +60,6 @@ type CheckUpdatesOK struct { func (o *CheckUpdatesOK) Error() string { return fmt.Sprintf("[POST /v1/Updates/Check][%d] checkUpdatesOk %+v", 200, o.Payload) } - func (o *CheckUpdatesOK) GetPayload() *CheckUpdatesOKBody { return o.Payload } @@ -83,7 +83,7 @@ func NewCheckUpdatesDefault(code int) *CheckUpdatesDefault { } } -/*CheckUpdatesDefault handles this case with default header values. +/* CheckUpdatesDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -101,7 +101,6 @@ func (o *CheckUpdatesDefault) Code() int { func (o *CheckUpdatesDefault) Error() string { return fmt.Sprintf("[POST /v1/Updates/Check][%d] CheckUpdates default %+v", o._statusCode, o.Payload) } - func (o *CheckUpdatesDefault) GetPayload() *CheckUpdatesDefaultBody { return o.Payload } @@ -135,6 +134,11 @@ func (o *CheckUpdatesBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this check updates body based on context it is used +func (o *CheckUpdatesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *CheckUpdatesBody) MarshalBinary() ([]byte, error) { if o == nil { @@ -168,7 +172,7 @@ type CheckUpdatesDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*CheckUpdatesDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this check updates default body @@ -186,7 +190,6 @@ func (o *CheckUpdatesDefaultBody) Validate(formats strfmt.Registry) error { } func (o *CheckUpdatesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -200,6 +203,42 @@ func (o *CheckUpdatesDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("CheckUpdates default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CheckUpdates default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CheckUpdates default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -228,6 +267,47 @@ func (o *CheckUpdatesDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*CheckUpdatesDefaultBodyDetailsItems0 check updates default body details items0 +swagger:model CheckUpdatesDefaultBodyDetailsItems0 +*/ +type CheckUpdatesDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -273,7 +353,6 @@ func (o *CheckUpdatesOKBody) Validate(formats strfmt.Registry) error { } func (o *CheckUpdatesOKBody) validateLastCheck(formats strfmt.Registry) error { - if swag.IsZero(o.LastCheck) { // not required return nil } @@ -286,7 +365,6 @@ func (o *CheckUpdatesOKBody) validateLastCheck(formats strfmt.Registry) error { } func (o *CheckUpdatesOKBody) validateInstalled(formats strfmt.Registry) error { - if swag.IsZero(o.Installed) { // not required return nil } @@ -295,6 +373,8 @@ func (o *CheckUpdatesOKBody) validateInstalled(formats strfmt.Registry) error { if err := o.Installed.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("checkUpdatesOk" + "." + "installed") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("checkUpdatesOk" + "." + "installed") } return err } @@ -304,7 +384,6 @@ func (o *CheckUpdatesOKBody) validateInstalled(formats strfmt.Registry) error { } func (o *CheckUpdatesOKBody) validateLatest(formats strfmt.Registry) error { - if swag.IsZero(o.Latest) { // not required return nil } @@ -313,6 +392,58 @@ func (o *CheckUpdatesOKBody) validateLatest(formats strfmt.Registry) error { if err := o.Latest.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("checkUpdatesOk" + "." + "latest") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Installed.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checkUpdatesOk" + "." + "installed") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Latest.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checkUpdatesOk" + "." + "latest") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("checkUpdatesOk" + "." + "latest") } return err } @@ -370,7 +501,6 @@ func (o *CheckUpdatesOKBodyInstalled) Validate(formats strfmt.Registry) error { } func (o *CheckUpdatesOKBodyInstalled) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.Timestamp) { // not required return nil } @@ -382,6 +512,11 @@ func (o *CheckUpdatesOKBodyInstalled) validateTimestamp(formats strfmt.Registry) 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 { @@ -431,7 +566,6 @@ func (o *CheckUpdatesOKBodyLatest) Validate(formats strfmt.Registry) error { } func (o *CheckUpdatesOKBodyLatest) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.Timestamp) { // not required return nil } @@ -443,6 +577,11 @@ func (o *CheckUpdatesOKBodyLatest) validateTimestamp(formats strfmt.Registry) er 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 { diff --git a/api/serverpb/json/client/server/get_settings_parameters.go b/api/serverpb/json/client/server/get_settings_parameters.go index 2b6cbd2b08..d284809d43 100644 --- a/api/serverpb/json/client/server/get_settings_parameters.go +++ b/api/serverpb/json/client/server/get_settings_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSettingsParams creates a new GetSettingsParams object -// with the default values initialized. +// 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 { - var () return &GetSettingsParams{ - timeout: cr.DefaultTimeout, } } // NewGetSettingsParamsWithTimeout creates a new GetSettingsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetSettingsParamsWithTimeout(timeout time.Duration) *GetSettingsParams { - var () return &GetSettingsParams{ - timeout: timeout, } } // NewGetSettingsParamsWithContext creates a new GetSettingsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetSettingsParamsWithContext(ctx context.Context) *GetSettingsParams { - var () return &GetSettingsParams{ - Context: ctx, } } // NewGetSettingsParamsWithHTTPClient creates a new GetSettingsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetSettingsParamsWithHTTPClient(client *http.Client) *GetSettingsParams { - var () 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 +/* 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 { - /*Body*/ + // Body. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type GetSettingsParams struct { 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) @@ -119,7 +133,6 @@ func (o *GetSettingsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/serverpb/json/client/server/get_settings_responses.go b/api/serverpb/json/client/server/get_settings_responses.go index 05ff72a384..8fc5437631 100644 --- a/api/serverpb/json/client/server/get_settings_responses.go +++ b/api/serverpb/json/client/server/get_settings_responses.go @@ -6,6 +6,7 @@ package server // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewGetSettingsOK() *GetSettingsOK { return &GetSettingsOK{} } -/*GetSettingsOK handles this case with default header values. +/* GetSettingsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type GetSettingsOK struct { func (o *GetSettingsOK) Error() string { return fmt.Sprintf("[POST /v1/Settings/Get][%d] getSettingsOk %+v", 200, o.Payload) } - func (o *GetSettingsOK) GetPayload() *GetSettingsOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewGetSettingsDefault(code int) *GetSettingsDefault { } } -/*GetSettingsDefault handles this case with default header values. +/* GetSettingsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *GetSettingsDefault) Code() int { func (o *GetSettingsDefault) Error() string { return fmt.Sprintf("[POST /v1/Settings/Get][%d] GetSettings default %+v", o._statusCode, o.Payload) } - func (o *GetSettingsDefault) GetPayload() *GetSettingsDefaultBody { return o.Payload } @@ -132,7 +131,7 @@ type GetSettingsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*GetSettingsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this get settings default body @@ -150,7 +149,6 @@ func (o *GetSettingsDefaultBody) Validate(formats strfmt.Registry) error { } func (o *GetSettingsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -164,6 +162,42 @@ func (o *GetSettingsDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("GetSettings default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetSettings default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("GetSettings default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -192,6 +226,47 @@ func (o *GetSettingsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*GetSettingsDefaultBodyDetailsItems0 get settings default body details items0 +swagger:model GetSettingsDefaultBodyDetailsItems0 +*/ +type GetSettingsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -216,7 +291,6 @@ func (o *GetSettingsOKBody) Validate(formats strfmt.Registry) error { } func (o *GetSettingsOKBody) validateSettings(formats strfmt.Registry) error { - if swag.IsZero(o.Settings) { // not required return nil } @@ -225,6 +299,38 @@ func (o *GetSettingsOKBody) validateSettings(formats strfmt.Registry) error { if err := o.Settings.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSettingsOk" + "." + "settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Settings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getSettingsOk" + "." + "settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSettingsOk" + "." + "settings") } return err } @@ -341,7 +447,6 @@ func (o *GetSettingsOKBodySettings) Validate(formats strfmt.Registry) error { } func (o *GetSettingsOKBodySettings) validateEmailAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.EmailAlertingSettings) { // not required return nil } @@ -350,6 +455,8 @@ func (o *GetSettingsOKBodySettings) validateEmailAlertingSettings(formats strfmt if err := o.EmailAlertingSettings.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "email_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "email_alerting_settings") } return err } @@ -359,7 +466,6 @@ func (o *GetSettingsOKBodySettings) validateEmailAlertingSettings(formats strfmt } func (o *GetSettingsOKBodySettings) validateMetricsResolutions(formats strfmt.Registry) error { - if swag.IsZero(o.MetricsResolutions) { // not required return nil } @@ -368,6 +474,8 @@ func (o *GetSettingsOKBodySettings) validateMetricsResolutions(formats strfmt.Re if err := o.MetricsResolutions.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "metrics_resolutions") } return err } @@ -377,7 +485,6 @@ func (o *GetSettingsOKBodySettings) validateMetricsResolutions(formats strfmt.Re } func (o *GetSettingsOKBodySettings) validateSlackAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.SlackAlertingSettings) { // not required return nil } @@ -386,6 +493,8 @@ func (o *GetSettingsOKBodySettings) validateSlackAlertingSettings(formats strfmt if err := o.SlackAlertingSettings.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") } return err } @@ -395,7 +504,6 @@ func (o *GetSettingsOKBodySettings) validateSlackAlertingSettings(formats strfmt } func (o *GetSettingsOKBodySettings) validateSttCheckIntervals(formats strfmt.Registry) error { - if swag.IsZero(o.SttCheckIntervals) { // not required return nil } @@ -404,6 +512,98 @@ func (o *GetSettingsOKBodySettings) validateSttCheckIntervals(formats strfmt.Reg if err := o.SttCheckIntervals.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "stt_check_intervals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "stt_check_intervals") + } + 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.contextValidateEmailAlertingSettings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateMetricsResolutions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSlackAlertingSettings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateSttCheckIntervals(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *GetSettingsOKBodySettings) contextValidateEmailAlertingSettings(ctx context.Context, formats strfmt.Registry) error { + + if o.EmailAlertingSettings != nil { + if err := o.EmailAlertingSettings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "email_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "email_alerting_settings") + } + return err + } + } + + return nil +} + +func (o *GetSettingsOKBodySettings) contextValidateMetricsResolutions(ctx context.Context, formats strfmt.Registry) error { + + if o.MetricsResolutions != nil { + if err := o.MetricsResolutions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "metrics_resolutions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "metrics_resolutions") + } + return err + } + } + + return nil +} + +func (o *GetSettingsOKBodySettings) contextValidateSlackAlertingSettings(ctx context.Context, formats strfmt.Registry) error { + + if o.SlackAlertingSettings != nil { + if err := o.SlackAlertingSettings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "slack_alerting_settings") + } + return err + } + } + + return nil +} + +func (o *GetSettingsOKBodySettings) contextValidateSttCheckIntervals(ctx context.Context, formats strfmt.Registry) error { + + if o.SttCheckIntervals != nil { + if err := o.SttCheckIntervals.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getSettingsOk" + "." + "settings" + "." + "stt_check_intervals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getSettingsOk" + "." + "settings" + "." + "stt_check_intervals") } return err } @@ -465,6 +665,11 @@ func (o *GetSettingsOKBodySettingsEmailAlertingSettings) Validate(formats strfmt return nil } +// ContextValidate validates this get settings OK body settings email alerting settings based on context it is used +func (o *GetSettingsOKBodySettingsEmailAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetSettingsOKBodySettingsEmailAlertingSettings) MarshalBinary() ([]byte, error) { if o == nil { @@ -503,6 +708,11 @@ func (o *GetSettingsOKBodySettingsMetricsResolutions) Validate(formats strfmt.Re 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 { @@ -535,6 +745,11 @@ func (o *GetSettingsOKBodySettingsSlackAlertingSettings) Validate(formats strfmt return nil } +// ContextValidate validates this get settings OK body settings slack alerting settings based on context it is used +func (o *GetSettingsOKBodySettingsSlackAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetSettingsOKBodySettingsSlackAlertingSettings) MarshalBinary() ([]byte, error) { if o == nil { @@ -573,6 +788,11 @@ func (o *GetSettingsOKBodySettingsSttCheckIntervals) Validate(formats strfmt.Reg return nil } +// ContextValidate validates this get settings OK body settings stt check intervals based on context it is used +func (o *GetSettingsOKBodySettingsSttCheckIntervals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *GetSettingsOKBodySettingsSttCheckIntervals) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/serverpb/json/client/server/logs_parameters.go b/api/serverpb/json/client/server/logs_parameters.go index 555d2f5189..10cd0b4893 100644 --- a/api/serverpb/json/client/server/logs_parameters.go +++ b/api/serverpb/json/client/server/logs_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewLogsParams creates a new LogsParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 { timeout time.Duration @@ -64,6 +63,21 @@ type LogsParams struct { 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) diff --git a/api/serverpb/json/client/server/logs_responses.go b/api/serverpb/json/client/server/logs_responses.go index 816c87b782..c55fdaf601 100644 --- a/api/serverpb/json/client/server/logs_responses.go +++ b/api/serverpb/json/client/server/logs_responses.go @@ -6,6 +6,7 @@ package server // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" @@ -44,11 +45,12 @@ func (o *LogsReader) ReadResponse(response runtime.ClientResponse, consumer runt // NewLogsOK creates a LogsOK with default headers values func NewLogsOK(writer io.Writer) *LogsOK { return &LogsOK{ + Payload: writer, } } -/*LogsOK handles this case with default header values. +/* LogsOK describes a response with status code 200, with default header values. A successful response. */ @@ -59,7 +61,6 @@ type LogsOK struct { func (o *LogsOK) Error() string { return fmt.Sprintf("[GET /logs.zip][%d] logsOk %+v", 200, o.Payload) } - func (o *LogsOK) GetPayload() io.Writer { return o.Payload } @@ -81,7 +82,7 @@ func NewLogsDefault(code int) *LogsDefault { } } -/*LogsDefault handles this case with default header values. +/* LogsDefault describes a response with status code -1, with default header values. An error response. */ @@ -99,7 +100,6 @@ func (o *LogsDefault) Code() int { func (o *LogsDefault) Error() string { return fmt.Sprintf("[GET /logs.zip][%d] Logs default %+v", o._statusCode, o.Payload) } - func (o *LogsDefault) GetPayload() *LogsDefaultBody { return o.Payload } @@ -136,6 +136,11 @@ 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 { diff --git a/api/serverpb/json/client/server/readiness_parameters.go b/api/serverpb/json/client/server/readiness_parameters.go index adcb61daba..97fba7b975 100644 --- a/api/serverpb/json/client/server/readiness_parameters.go +++ b/api/serverpb/json/client/server/readiness_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewReadinessParams creates a new ReadinessParams object -// with the default values initialized. +// 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 default values initialized, and the ability to set a timeout on a request +// 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 default values initialized, and the ability to set a context for a request +// 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 default values initialized, and the ability to set a custom HTTPClient for a request +// 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 +/* 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 @@ -64,6 +63,21 @@ type ReadinessParams struct { 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) diff --git a/api/serverpb/json/client/server/readiness_responses.go b/api/serverpb/json/client/server/readiness_responses.go index 5122521e5c..fac4084a0a 100644 --- a/api/serverpb/json/client/server/readiness_responses.go +++ b/api/serverpb/json/client/server/readiness_responses.go @@ -6,6 +6,7 @@ package server // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewReadinessOK() *ReadinessOK { return &ReadinessOK{} } -/*ReadinessOK handles this case with default header values. +/* ReadinessOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type ReadinessOK struct { func (o *ReadinessOK) Error() string { return fmt.Sprintf("[GET /v1/readyz][%d] readinessOk %+v", 200, o.Payload) } - func (o *ReadinessOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewReadinessDefault(code int) *ReadinessDefault { } } -/*ReadinessDefault handles this case with default header values. +/* ReadinessDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *ReadinessDefault) Code() int { func (o *ReadinessDefault) Error() string { return fmt.Sprintf("[GET /v1/readyz][%d] Readiness default %+v", o._statusCode, o.Payload) } - func (o *ReadinessDefault) GetPayload() *ReadinessDefaultBody { return o.Payload } @@ -130,7 +129,7 @@ type ReadinessDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*ReadinessDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this readiness default body @@ -148,7 +147,6 @@ func (o *ReadinessDefaultBody) Validate(formats strfmt.Registry) error { } func (o *ReadinessDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -162,6 +160,42 @@ func (o *ReadinessDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Readiness default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Readiness default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Readiness default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -189,3 +223,44 @@ func (o *ReadinessDefaultBody) UnmarshalBinary(b []byte) error { *o = res return nil } + +/*ReadinessDefaultBodyDetailsItems0 readiness default body details items0 +swagger:model ReadinessDefaultBodyDetailsItems0 +*/ +type ReadinessDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/serverpb/json/client/server/server_client.go b/api/serverpb/json/client/server/server_client.go index c207e7d079..9e79a4c1f0 100644 --- a/api/serverpb/json/client/server/server_client.go +++ b/api/serverpb/json/client/server/server_client.go @@ -25,27 +25,30 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AWSInstanceCheck(params *AWSInstanceCheckParams) (*AWSInstanceCheckOK, error) + AWSInstanceCheck(params *AWSInstanceCheckParams, opts ...ClientOption) (*AWSInstanceCheckOK, error) - ChangeSettings(params *ChangeSettingsParams) (*ChangeSettingsOK, error) + ChangeSettings(params *ChangeSettingsParams, opts ...ClientOption) (*ChangeSettingsOK, error) - CheckUpdates(params *CheckUpdatesParams) (*CheckUpdatesOK, error) + CheckUpdates(params *CheckUpdatesParams, opts ...ClientOption) (*CheckUpdatesOK, error) - GetSettings(params *GetSettingsParams) (*GetSettingsOK, error) + GetSettings(params *GetSettingsParams, opts ...ClientOption) (*GetSettingsOK, error) - Logs(params *LogsParams, writer io.Writer) (*LogsOK, error) + Logs(params *LogsParams, writer io.Writer, opts ...ClientOption) (*LogsOK, error) - Readiness(params *ReadinessParams) (*ReadinessOK, error) + Readiness(params *ReadinessParams, opts ...ClientOption) (*ReadinessOK, error) - StartUpdate(params *StartUpdateParams) (*StartUpdateOK, error) + StartUpdate(params *StartUpdateParams, opts ...ClientOption) (*StartUpdateOK, error) - TestEmailAlertingSettings(params *TestEmailAlertingSettingsParams) (*TestEmailAlertingSettingsOK, error) + TestEmailAlertingSettings(params *TestEmailAlertingSettingsParams, opts ...ClientOption) (*TestEmailAlertingSettingsOK, error) - UpdateStatus(params *UpdateStatusParams) (*UpdateStatusOK, error) + UpdateStatus(params *UpdateStatusParams, opts ...ClientOption) (*UpdateStatusOK, error) - Version(params *VersionParams) (*VersionOK, error) + Version(params *VersionParams, opts ...ClientOption) (*VersionOK, error) SetTransport(transport runtime.ClientTransport) } @@ -55,13 +58,12 @@ type ClientService interface { Checks AWS EC2 instance ID. */ -func (a *Client) AWSInstanceCheck(params *AWSInstanceCheckParams) (*AWSInstanceCheckOK, error) { +func (a *Client) AWSInstanceCheck(params *AWSInstanceCheckParams, opts ...ClientOption) (*AWSInstanceCheckOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAWSInstanceCheckParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "AWSInstanceCheck", Method: "POST", PathPattern: "/v1/AWSInstanceCheck", @@ -72,7 +74,12 @@ func (a *Client) AWSInstanceCheck(params *AWSInstanceCheckParams) (*AWSInstanceC Reader: &AWSInstanceCheckReader{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 } @@ -90,13 +97,12 @@ func (a *Client) AWSInstanceCheck(params *AWSInstanceCheckParams) (*AWSInstanceC Changes PMM Server settings. */ -func (a *Client) ChangeSettings(params *ChangeSettingsParams) (*ChangeSettingsOK, error) { +func (a *Client) ChangeSettings(params *ChangeSettingsParams, opts ...ClientOption) (*ChangeSettingsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewChangeSettingsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "ChangeSettings", Method: "POST", PathPattern: "/v1/Settings/Change", @@ -107,7 +113,12 @@ func (a *Client) ChangeSettings(params *ChangeSettingsParams) (*ChangeSettingsOK 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 } @@ -125,13 +136,12 @@ func (a *Client) ChangeSettings(params *ChangeSettingsParams) (*ChangeSettingsOK Checks for available PMM Server updates. */ -func (a *Client) CheckUpdates(params *CheckUpdatesParams) (*CheckUpdatesOK, error) { +func (a *Client) CheckUpdates(params *CheckUpdatesParams, opts ...ClientOption) (*CheckUpdatesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewCheckUpdatesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "CheckUpdates", Method: "POST", PathPattern: "/v1/Updates/Check", @@ -142,7 +152,12 @@ func (a *Client) CheckUpdates(params *CheckUpdatesParams) (*CheckUpdatesOK, erro 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 } @@ -160,13 +175,12 @@ func (a *Client) CheckUpdates(params *CheckUpdatesParams) (*CheckUpdatesOK, erro Returns current PMM Server settings. */ -func (a *Client) GetSettings(params *GetSettingsParams) (*GetSettingsOK, error) { +func (a *Client) GetSettings(params *GetSettingsParams, opts ...ClientOption) (*GetSettingsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetSettingsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "GetSettings", Method: "POST", PathPattern: "/v1/Settings/Get", @@ -177,7 +191,12 @@ func (a *Client) GetSettings(params *GetSettingsParams) (*GetSettingsOK, error) 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 } @@ -195,13 +214,12 @@ func (a *Client) GetSettings(params *GetSettingsParams) (*GetSettingsOK, error) Returns the PMM Server logs. */ -func (a *Client) Logs(params *LogsParams, writer io.Writer) (*LogsOK, error) { +func (a *Client) Logs(params *LogsParams, writer io.Writer, opts ...ClientOption) (*LogsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewLogsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "Logs", Method: "GET", PathPattern: "/logs.zip", @@ -212,7 +230,12 @@ func (a *Client) Logs(params *LogsParams, writer io.Writer) (*LogsOK, error) { 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 } @@ -230,13 +253,12 @@ func (a *Client) Logs(params *LogsParams, writer io.Writer) (*LogsOK, error) { 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) (*ReadinessOK, error) { +func (a *Client) Readiness(params *ReadinessParams, opts ...ClientOption) (*ReadinessOK, error) { // TODO: Validate the params before sending if params == nil { params = NewReadinessParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "Readiness", Method: "GET", PathPattern: "/v1/readyz", @@ -247,7 +269,12 @@ func (a *Client) Readiness(params *ReadinessParams) (*ReadinessOK, error) { 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 } @@ -265,13 +292,12 @@ func (a *Client) Readiness(params *ReadinessParams) (*ReadinessOK, error) { Starts PMM Server update. */ -func (a *Client) StartUpdate(params *StartUpdateParams) (*StartUpdateOK, error) { +func (a *Client) StartUpdate(params *StartUpdateParams, opts ...ClientOption) (*StartUpdateOK, error) { // TODO: Validate the params before sending if params == nil { params = NewStartUpdateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "StartUpdate", Method: "POST", PathPattern: "/v1/Updates/Start", @@ -282,7 +308,12 @@ func (a *Client) StartUpdate(params *StartUpdateParams) (*StartUpdateOK, error) 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 } @@ -300,13 +331,12 @@ func (a *Client) StartUpdate(params *StartUpdateParams) (*StartUpdateOK, error) Sends test email to check current SMTP settings for email alerting. */ -func (a *Client) TestEmailAlertingSettings(params *TestEmailAlertingSettingsParams) (*TestEmailAlertingSettingsOK, error) { +func (a *Client) TestEmailAlertingSettings(params *TestEmailAlertingSettingsParams, opts ...ClientOption) (*TestEmailAlertingSettingsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewTestEmailAlertingSettingsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "TestEmailAlertingSettings", Method: "POST", PathPattern: "/v1/Settings/TestEmailAlertingSettings", @@ -317,7 +347,12 @@ func (a *Client) TestEmailAlertingSettings(params *TestEmailAlertingSettingsPara Reader: &TestEmailAlertingSettingsReader{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 } @@ -335,13 +370,12 @@ func (a *Client) TestEmailAlertingSettings(params *TestEmailAlertingSettingsPara Returns PMM Server update status. */ -func (a *Client) UpdateStatus(params *UpdateStatusParams) (*UpdateStatusOK, error) { +func (a *Client) UpdateStatus(params *UpdateStatusParams, opts ...ClientOption) (*UpdateStatusOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateStatusParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "UpdateStatus", Method: "POST", PathPattern: "/v1/Updates/Status", @@ -352,7 +386,12 @@ func (a *Client) UpdateStatus(params *UpdateStatusParams) (*UpdateStatusOK, erro 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 } @@ -370,13 +409,12 @@ func (a *Client) UpdateStatus(params *UpdateStatusParams) (*UpdateStatusOK, erro Returns PMM Server versions. */ -func (a *Client) Version(params *VersionParams) (*VersionOK, error) { +func (a *Client) Version(params *VersionParams, opts ...ClientOption) (*VersionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewVersionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "Version", Method: "GET", PathPattern: "/v1/version", @@ -387,7 +425,12 @@ func (a *Client) Version(params *VersionParams) (*VersionOK, error) { 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 } diff --git a/api/serverpb/json/client/server/start_update_parameters.go b/api/serverpb/json/client/server/start_update_parameters.go index 653ff34cdc..18ff34fb9c 100644 --- a/api/serverpb/json/client/server/start_update_parameters.go +++ b/api/serverpb/json/client/server/start_update_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewStartUpdateParams creates a new StartUpdateParams object -// with the default values initialized. +// 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 { - var () return &StartUpdateParams{ - timeout: cr.DefaultTimeout, } } // NewStartUpdateParamsWithTimeout creates a new StartUpdateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewStartUpdateParamsWithTimeout(timeout time.Duration) *StartUpdateParams { - var () return &StartUpdateParams{ - timeout: timeout, } } // NewStartUpdateParamsWithContext creates a new StartUpdateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewStartUpdateParamsWithContext(ctx context.Context) *StartUpdateParams { - var () return &StartUpdateParams{ - Context: ctx, } } // NewStartUpdateParamsWithHTTPClient creates a new StartUpdateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewStartUpdateParamsWithHTTPClient(client *http.Client) *StartUpdateParams { - var () 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 +/* 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. Body interface{} timeout time.Duration @@ -68,6 +67,21 @@ type StartUpdateParams struct { 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) @@ -119,7 +133,6 @@ func (o *StartUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/api/serverpb/json/client/server/start_update_responses.go b/api/serverpb/json/client/server/start_update_responses.go index 8e1950dd6e..a472d24897 100644 --- a/api/serverpb/json/client/server/start_update_responses.go +++ b/api/serverpb/json/client/server/start_update_responses.go @@ -6,6 +6,7 @@ package server // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewStartUpdateOK() *StartUpdateOK { return &StartUpdateOK{} } -/*StartUpdateOK handles this case with default header values. +/* StartUpdateOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type StartUpdateOK struct { func (o *StartUpdateOK) Error() string { return fmt.Sprintf("[POST /v1/Updates/Start][%d] startUpdateOk %+v", 200, o.Payload) } - func (o *StartUpdateOK) GetPayload() *StartUpdateOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewStartUpdateDefault(code int) *StartUpdateDefault { } } -/*StartUpdateDefault handles this case with default header values. +/* StartUpdateDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *StartUpdateDefault) Code() int { func (o *StartUpdateDefault) Error() string { return fmt.Sprintf("[POST /v1/Updates/Start][%d] StartUpdate default %+v", o._statusCode, o.Payload) } - func (o *StartUpdateDefault) GetPayload() *StartUpdateDefaultBody { return o.Payload } @@ -132,7 +131,7 @@ type StartUpdateDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*StartUpdateDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this start update default body @@ -150,7 +149,6 @@ func (o *StartUpdateDefaultBody) Validate(formats strfmt.Registry) error { } func (o *StartUpdateDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -164,6 +162,42 @@ func (o *StartUpdateDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("StartUpdate default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("StartUpdate default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("StartUpdate default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -192,6 +226,47 @@ func (o *StartUpdateDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*StartUpdateDefaultBodyDetailsItems0 start update default body details items0 +swagger:model StartUpdateDefaultBodyDetailsItems0 +*/ +type StartUpdateDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -209,6 +284,11 @@ 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 { diff --git a/api/serverpb/json/client/server/test_email_alerting_settings_parameters.go b/api/serverpb/json/client/server/test_email_alerting_settings_parameters.go index c406c66352..15a7ebcabb 100644 --- a/api/serverpb/json/client/server/test_email_alerting_settings_parameters.go +++ b/api/serverpb/json/client/server/test_email_alerting_settings_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewTestEmailAlertingSettingsParams creates a new TestEmailAlertingSettingsParams object -// with the default values initialized. +// NewTestEmailAlertingSettingsParams creates a new TestEmailAlertingSettingsParams 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 NewTestEmailAlertingSettingsParams() *TestEmailAlertingSettingsParams { - var () return &TestEmailAlertingSettingsParams{ - timeout: cr.DefaultTimeout, } } // NewTestEmailAlertingSettingsParamsWithTimeout creates a new TestEmailAlertingSettingsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewTestEmailAlertingSettingsParamsWithTimeout(timeout time.Duration) *TestEmailAlertingSettingsParams { - var () return &TestEmailAlertingSettingsParams{ - timeout: timeout, } } // NewTestEmailAlertingSettingsParamsWithContext creates a new TestEmailAlertingSettingsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewTestEmailAlertingSettingsParamsWithContext(ctx context.Context) *TestEmailAlertingSettingsParams { - var () return &TestEmailAlertingSettingsParams{ - Context: ctx, } } // NewTestEmailAlertingSettingsParamsWithHTTPClient creates a new TestEmailAlertingSettingsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewTestEmailAlertingSettingsParamsWithHTTPClient(client *http.Client) *TestEmailAlertingSettingsParams { - var () return &TestEmailAlertingSettingsParams{ HTTPClient: client, } } -/*TestEmailAlertingSettingsParams contains all the parameters to send to the API endpoint -for the test email alerting settings operation typically these are written to a http.Request +/* TestEmailAlertingSettingsParams contains all the parameters to send to the API endpoint + for the test email alerting settings operation. + + Typically these are written to a http.Request. */ type TestEmailAlertingSettingsParams struct { - /*Body*/ + // Body. Body TestEmailAlertingSettingsBody timeout time.Duration @@ -68,6 +67,21 @@ type TestEmailAlertingSettingsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the test email alerting settings params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TestEmailAlertingSettingsParams) WithDefaults() *TestEmailAlertingSettingsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the test email alerting settings params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TestEmailAlertingSettingsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the test email alerting settings params func (o *TestEmailAlertingSettingsParams) WithTimeout(timeout time.Duration) *TestEmailAlertingSettingsParams { o.SetTimeout(timeout) @@ -119,7 +133,6 @@ func (o *TestEmailAlertingSettingsParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/serverpb/json/client/server/test_email_alerting_settings_responses.go b/api/serverpb/json/client/server/test_email_alerting_settings_responses.go index 57a16a1538..8f747c12d4 100644 --- a/api/serverpb/json/client/server/test_email_alerting_settings_responses.go +++ b/api/serverpb/json/client/server/test_email_alerting_settings_responses.go @@ -6,6 +6,7 @@ package server // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewTestEmailAlertingSettingsOK() *TestEmailAlertingSettingsOK { return &TestEmailAlertingSettingsOK{} } -/*TestEmailAlertingSettingsOK handles this case with default header values. +/* TestEmailAlertingSettingsOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type TestEmailAlertingSettingsOK struct { func (o *TestEmailAlertingSettingsOK) Error() string { return fmt.Sprintf("[POST /v1/Settings/TestEmailAlertingSettings][%d] testEmailAlertingSettingsOk %+v", 200, o.Payload) } - func (o *TestEmailAlertingSettingsOK) GetPayload() interface{} { return o.Payload } @@ -80,7 +80,7 @@ func NewTestEmailAlertingSettingsDefault(code int) *TestEmailAlertingSettingsDef } } -/*TestEmailAlertingSettingsDefault handles this case with default header values. +/* TestEmailAlertingSettingsDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -98,7 +98,6 @@ func (o *TestEmailAlertingSettingsDefault) Code() int { func (o *TestEmailAlertingSettingsDefault) Error() string { return fmt.Sprintf("[POST /v1/Settings/TestEmailAlertingSettings][%d] TestEmailAlertingSettings default %+v", o._statusCode, o.Payload) } - func (o *TestEmailAlertingSettingsDefault) GetPayload() *TestEmailAlertingSettingsDefaultBody { return o.Payload } @@ -142,7 +141,6 @@ func (o *TestEmailAlertingSettingsBody) Validate(formats strfmt.Registry) error } func (o *TestEmailAlertingSettingsBody) validateEmailAlertingSettings(formats strfmt.Registry) error { - if swag.IsZero(o.EmailAlertingSettings) { // not required return nil } @@ -151,6 +149,38 @@ func (o *TestEmailAlertingSettingsBody) validateEmailAlertingSettings(formats st if err := o.EmailAlertingSettings.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("body" + "." + "email_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "email_alerting_settings") + } + return err + } + } + + return nil +} + +// ContextValidate validate this test email alerting settings body based on the context it is used +func (o *TestEmailAlertingSettingsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateEmailAlertingSettings(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TestEmailAlertingSettingsBody) contextValidateEmailAlertingSettings(ctx context.Context, formats strfmt.Registry) error { + + if o.EmailAlertingSettings != nil { + if err := o.EmailAlertingSettings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "email_alerting_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "email_alerting_settings") } return err } @@ -192,7 +222,7 @@ type TestEmailAlertingSettingsDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*TestEmailAlertingSettingsDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this test email alerting settings default body @@ -210,7 +240,6 @@ func (o *TestEmailAlertingSettingsDefaultBody) Validate(formats strfmt.Registry) } func (o *TestEmailAlertingSettingsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -224,6 +253,42 @@ func (o *TestEmailAlertingSettingsDefaultBody) validateDetails(formats strfmt.Re if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("TestEmailAlertingSettings default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("TestEmailAlertingSettings default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this test email alerting settings default body based on the context it is used +func (o *TestEmailAlertingSettingsDefaultBody) 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 *TestEmailAlertingSettingsDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TestEmailAlertingSettings default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("TestEmailAlertingSettings default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -252,6 +317,47 @@ func (o *TestEmailAlertingSettingsDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*TestEmailAlertingSettingsDefaultBodyDetailsItems0 test email alerting settings default body details items0 +swagger:model TestEmailAlertingSettingsDefaultBodyDetailsItems0 +*/ +type TestEmailAlertingSettingsDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this test email alerting settings default body details items0 +func (o *TestEmailAlertingSettingsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this test email alerting settings default body details items0 based on context it is used +func (o *TestEmailAlertingSettingsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *TestEmailAlertingSettingsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *TestEmailAlertingSettingsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res TestEmailAlertingSettingsDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + /*TestEmailAlertingSettingsParamsBodyEmailAlertingSettings EmailAlertingSettings represents email (SMTP) configuration for Alerting. swagger:model TestEmailAlertingSettingsParamsBodyEmailAlertingSettings */ @@ -287,6 +393,11 @@ func (o *TestEmailAlertingSettingsParamsBodyEmailAlertingSettings) Validate(form return nil } +// ContextValidate validates this test email alerting settings params body email alerting settings based on context it is used +func (o *TestEmailAlertingSettingsParamsBodyEmailAlertingSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *TestEmailAlertingSettingsParamsBodyEmailAlertingSettings) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/serverpb/json/client/server/update_status_parameters.go b/api/serverpb/json/client/server/update_status_parameters.go index 7915605487..e7d269d45c 100644 --- a/api/serverpb/json/client/server/update_status_parameters.go +++ b/api/serverpb/json/client/server/update_status_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUpdateStatusParams creates a new UpdateStatusParams object -// with the default values initialized. +// 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 { - var () return &UpdateStatusParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateStatusParamsWithTimeout creates a new UpdateStatusParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateStatusParamsWithTimeout(timeout time.Duration) *UpdateStatusParams { - var () return &UpdateStatusParams{ - timeout: timeout, } } // NewUpdateStatusParamsWithContext creates a new UpdateStatusParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateStatusParamsWithContext(ctx context.Context) *UpdateStatusParams { - var () return &UpdateStatusParams{ - Context: ctx, } } // NewUpdateStatusParamsWithHTTPClient creates a new UpdateStatusParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateStatusParamsWithHTTPClient(client *http.Client) *UpdateStatusParams { - var () 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 +/* 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. Body UpdateStatusBody timeout time.Duration @@ -68,6 +67,21 @@ type UpdateStatusParams struct { 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) @@ -119,7 +133,6 @@ func (o *UpdateStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if err := r.SetBodyParam(o.Body); err != nil { return err } diff --git a/api/serverpb/json/client/server/update_status_responses.go b/api/serverpb/json/client/server/update_status_responses.go index 3e7a93dc84..d83ff2951a 100644 --- a/api/serverpb/json/client/server/update_status_responses.go +++ b/api/serverpb/json/client/server/update_status_responses.go @@ -6,6 +6,7 @@ package server // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -47,7 +48,7 @@ func NewUpdateStatusOK() *UpdateStatusOK { return &UpdateStatusOK{} } -/*UpdateStatusOK handles this case with default header values. +/* UpdateStatusOK describes a response with status code 200, with default header values. A successful response. */ @@ -58,7 +59,6 @@ type UpdateStatusOK struct { func (o *UpdateStatusOK) Error() string { return fmt.Sprintf("[POST /v1/Updates/Status][%d] updateStatusOk %+v", 200, o.Payload) } - func (o *UpdateStatusOK) GetPayload() *UpdateStatusOKBody { return o.Payload } @@ -82,7 +82,7 @@ func NewUpdateStatusDefault(code int) *UpdateStatusDefault { } } -/*UpdateStatusDefault handles this case with default header values. +/* UpdateStatusDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -100,7 +100,6 @@ func (o *UpdateStatusDefault) Code() int { func (o *UpdateStatusDefault) Error() string { return fmt.Sprintf("[POST /v1/Updates/Status][%d] UpdateStatus default %+v", o._statusCode, o.Payload) } - func (o *UpdateStatusDefault) GetPayload() *UpdateStatusDefaultBody { return o.Payload } @@ -134,6 +133,11 @@ 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 { @@ -167,7 +171,7 @@ type UpdateStatusDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*UpdateStatusDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this update status default body @@ -185,7 +189,6 @@ func (o *UpdateStatusDefaultBody) Validate(formats strfmt.Registry) error { } func (o *UpdateStatusDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -199,6 +202,42 @@ func (o *UpdateStatusDefaultBody) validateDetails(formats strfmt.Registry) error if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("UpdateStatus default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UpdateStatus default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("UpdateStatus default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -227,6 +266,47 @@ func (o *UpdateStatusDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*UpdateStatusDefaultBodyDetailsItems0 update status default body details items0 +swagger:model UpdateStatusDefaultBodyDetailsItems0 +*/ +type UpdateStatusDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -247,6 +327,11 @@ 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 { diff --git a/api/serverpb/json/client/server/version_parameters.go b/api/serverpb/json/client/server/version_parameters.go index c74cdf5d2a..2f5faf9585 100644 --- a/api/serverpb/json/client/server/version_parameters.go +++ b/api/serverpb/json/client/server/version_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewVersionParams creates a new VersionParams object -// with the default values initialized. +// 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 { - var () return &VersionParams{ - timeout: cr.DefaultTimeout, } } // NewVersionParamsWithTimeout creates a new VersionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewVersionParamsWithTimeout(timeout time.Duration) *VersionParams { - var () return &VersionParams{ - timeout: timeout, } } // NewVersionParamsWithContext creates a new VersionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewVersionParamsWithContext(ctx context.Context) *VersionParams { - var () return &VersionParams{ - Context: ctx, } } // NewVersionParamsWithHTTPClient creates a new VersionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewVersionParamsWithHTTPClient(client *http.Client) *VersionParams { - var () 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 +/* 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. + Dummy parameter for internal testing. Do not use. */ Dummy *string @@ -71,6 +70,21 @@ type VersionParams struct { 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) @@ -127,16 +141,17 @@ func (o *VersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis // 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 { diff --git a/api/serverpb/json/client/server/version_responses.go b/api/serverpb/json/client/server/version_responses.go index 667fe213ea..25270dcc11 100644 --- a/api/serverpb/json/client/server/version_responses.go +++ b/api/serverpb/json/client/server/version_responses.go @@ -6,6 +6,7 @@ package server // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "fmt" "io" @@ -49,7 +50,7 @@ func NewVersionOK() *VersionOK { return &VersionOK{} } -/*VersionOK handles this case with default header values. +/* VersionOK describes a response with status code 200, with default header values. A successful response. */ @@ -60,7 +61,6 @@ type VersionOK struct { func (o *VersionOK) Error() string { return fmt.Sprintf("[GET /v1/version][%d] versionOk %+v", 200, o.Payload) } - func (o *VersionOK) GetPayload() *VersionOKBody { return o.Payload } @@ -84,7 +84,7 @@ func NewVersionDefault(code int) *VersionDefault { } } -/*VersionDefault handles this case with default header values. +/* VersionDefault describes a response with status code -1, with default header values. An unexpected error response. */ @@ -102,7 +102,6 @@ func (o *VersionDefault) Code() int { func (o *VersionDefault) Error() string { return fmt.Sprintf("[GET /v1/version][%d] Version default %+v", o._statusCode, o.Payload) } - func (o *VersionDefault) GetPayload() *VersionDefaultBody { return o.Payload } @@ -134,7 +133,7 @@ type VersionDefaultBody struct { Message string `json:"message,omitempty"` // details - Details []*DetailsItems0 `json:"details"` + Details []*VersionDefaultBodyDetailsItems0 `json:"details"` } // Validate validates this version default body @@ -152,7 +151,6 @@ func (o *VersionDefaultBody) Validate(formats strfmt.Registry) error { } func (o *VersionDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required return nil } @@ -166,6 +164,42 @@ func (o *VersionDefaultBody) validateDetails(formats strfmt.Registry) error { if err := o.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Version default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Version default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Version default" + "." + "details" + "." + strconv.Itoa(i)) } return err } @@ -194,6 +228,47 @@ func (o *VersionDefaultBody) UnmarshalBinary(b []byte) error { return nil } +/*VersionDefaultBodyDetailsItems0 version default body details items0 +swagger:model VersionDefaultBodyDetailsItems0 +*/ +type VersionDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 */ @@ -277,7 +352,6 @@ func (o *VersionOKBody) validateDistributionMethodEnum(path, location string, va } func (o *VersionOKBody) validateDistributionMethod(formats strfmt.Registry) error { - if swag.IsZero(o.DistributionMethod) { // not required return nil } @@ -291,7 +365,6 @@ func (o *VersionOKBody) validateDistributionMethod(formats strfmt.Registry) erro } func (o *VersionOKBody) validateManaged(formats strfmt.Registry) error { - if swag.IsZero(o.Managed) { // not required return nil } @@ -300,6 +373,8 @@ func (o *VersionOKBody) validateManaged(formats strfmt.Registry) error { if err := o.Managed.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("versionOk" + "." + "managed") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("versionOk" + "." + "managed") } return err } @@ -309,7 +384,6 @@ func (o *VersionOKBody) validateManaged(formats strfmt.Registry) error { } func (o *VersionOKBody) validateServer(formats strfmt.Registry) error { - if swag.IsZero(o.Server) { // not required return nil } @@ -318,6 +392,58 @@ func (o *VersionOKBody) validateServer(formats strfmt.Registry) error { if err := o.Server.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("versionOk" + "." + "server") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Managed.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("versionOk" + "." + "managed") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Server.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("versionOk" + "." + "server") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("versionOk" + "." + "server") } return err } @@ -375,7 +501,6 @@ func (o *VersionOKBodyManaged) Validate(formats strfmt.Registry) error { } func (o *VersionOKBodyManaged) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.Timestamp) { // not required return nil } @@ -387,6 +512,11 @@ func (o *VersionOKBodyManaged) validateTimestamp(formats strfmt.Registry) error 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 { @@ -436,7 +566,6 @@ func (o *VersionOKBodyServer) Validate(formats strfmt.Registry) error { } func (o *VersionOKBodyServer) validateTimestamp(formats strfmt.Registry) error { - if swag.IsZero(o.Timestamp) { // not required return nil } @@ -448,6 +577,11 @@ func (o *VersionOKBodyServer) validateTimestamp(formats strfmt.Registry) error { 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 { diff --git a/api/serverpb/json/serverpb.json b/api/serverpb/json/serverpb.json index f2b1e1a2d9..a3408ad966 100644 --- a/api/serverpb/json/serverpb.json +++ b/api/serverpb/json/serverpb.json @@ -244,8 +244,7 @@ "type": "string", "x-order": 3 } - }, - "x-order": 16 + } }, "enable_alerting": { "description": "Enable Alerting.", @@ -299,8 +298,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 4 + } }, "pmm_public_address": { "description": "PMM Server public address.", @@ -340,8 +338,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 18 + } }, "ssh_key": { "type": "string", @@ -366,8 +363,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 22 + } } } } @@ -473,8 +469,7 @@ "type": "string", "x-order": 3 } - }, - "x-order": 12 + } }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -495,8 +490,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 2 + } }, "platform_email": { "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", @@ -517,8 +511,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 13 + } }, "ssh_key": { "type": "string", @@ -543,8 +536,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 15 + } }, "stt_enabled": { "description": "True if Security Threat Tool is enabled.", @@ -561,8 +553,7 @@ "type": "boolean", "x-order": 0 } - }, - "x-order": 0 + } } } } @@ -727,8 +718,7 @@ "type": "string", "x-order": 3 } - }, - "x-order": 12 + } }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -749,8 +739,7 @@ "type": "string", "x-order": 1 } - }, - "x-order": 2 + } }, "platform_email": { "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", @@ -771,8 +760,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 13 + } }, "ssh_key": { "type": "string", @@ -797,8 +785,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 15 + } }, "stt_enabled": { "description": "True if Security Threat Tool is enabled.", @@ -815,8 +802,7 @@ "type": "boolean", "x-order": 0 } - }, - "x-order": 0 + } } } } @@ -923,8 +909,7 @@ "type": "string", "x-order": 3 } - }, - "x-order": 0 + } }, "email_to": { "description": "Target email address to send the email to.", @@ -1040,8 +1025,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 0 + } }, "last_check": { "description": "Last check time.", @@ -1069,8 +1053,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 1 + } }, "latest_news_url": { "description": "Latest available PMM Server release announcement URL.", @@ -1398,8 +1381,7 @@ "AMI", "AZURE", "DO" - ], - "x-order": 3 + ] }, "managed": { "description": "VersionInfo describes component version, or PMM Server as a whole.", @@ -1421,8 +1403,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 2 + } }, "server": { "description": "VersionInfo describes component version, or PMM Server as a whole.", @@ -1444,8 +1425,7 @@ "type": "string", "x-order": 0 } - }, - "x-order": 1 + } }, "version": { "description": "PMM Server version.", diff --git a/api/serverpb/server.pb.go b/api/serverpb/server.pb.go index 189be55871..e86d2d28fb 100644 --- a/api/serverpb/server.pb.go +++ b/api/serverpb/server.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.0 // protoc (unknown) // source: serverpb/server.proto diff --git a/api/swagger/swagger-dev-only.json b/api/swagger/swagger-dev-only.json deleted file mode 100644 index bb14fc5aa9..0000000000 --- a/api/swagger/swagger-dev-only.json +++ /dev/null @@ -1,11913 +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": { - "/v0/qan/Filters/Get": { - "post": { - "tags": [ - "Filters" - ], - "summary": "Get gets map of metrics names.", - "operationId": "Get", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "FiltersRequest 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": "FiltersReply 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/GetMetricsNames": { - "post": { - "tags": [ - "MetricsNames" - ], - "summary": "GetMetricsNames gets map of metrics names.", - "operationId": "GetMetricsNames", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "MetricsNamesRequest is emty.", - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/GetReport": { - "post": { - "tags": [ - "Profile" - ], - "summary": "GetReport returns list of metrics group by queryid or other dimentions.", - "operationId": "GetReport", - "parameters": [ - { - "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": "Boolean metrics:\n- *_sum_per_sec - how many times this matric was true.\n\nQuery 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": "MongoDB metrics.\n\nThe 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_shared_blks_hit_sum_per_sec": { - "description": "PostgreSQL metrics.\n\nTotal number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "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": 53 - }, - "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": 54 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "title": "pg_stat_monitor 0.9 metrics", - "x-order": 57 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 58 - }, - "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": 59 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 61 - } - } - }, - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetHistogram": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetHistogram gets histogram items for specific filtering.", - "operationId": "GetHistogram", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "HistogramRequest 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": "HistogramReply 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetLabels": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetLabels gets list of labels for object details.", - "operationId": "GetLabels", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ObjectDetailsLabelsRequest 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": "ObjectDetailsLabelsReply 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetMetrics": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetMetrics gets map of metrics for specific filtering.", - "operationId": "GetMetrics", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "MetricsRequest 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": "MetricsReply 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": "Boolean metrics:\n- *_sum_per_sec - how many times this matric was true.\n\nQuery 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": "MongoDB metrics.\n\nThe 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_shared_blks_hit_sum_per_sec": { - "description": "PostgreSQL metrics.\n\nTotal number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "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": 53 - }, - "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": 54 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "title": "pg_stat_monitor 0.9 metrics", - "x-order": 57 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 58 - }, - "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": 59 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 61 - } - } - }, - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetQueryExample": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetQueryExample gets list of query examples.", - "operationId": "GetQueryExample", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "QueryExampleRequest 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": "QueryExampleReply 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_format": { - "description": "ExampleFormat is format of query example: real or query without values.\n\nDeprecated: is not used, should not be used, should be removed.", - "type": "string", - "default": "EXAMPLE_FORMAT_INVALID", - "enum": [ - "EXAMPLE_FORMAT_INVALID", - "EXAMPLE", - "FINGERPRINT" - ], - "x-order": 1 - }, - "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_INVALID", - "enum": [ - "EXAMPLE_TYPE_INVALID", - "RANDOM", - "SLOWEST", - "FASTEST", - "WITH_ERROR" - ], - "x-order": 2 - }, - "is_truncated": { - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "example_metrics": { - "type": "string", - "x-order": 4 - }, - "service_id": { - "type": "string", - "x-order": 5 - }, - "service_type": { - "type": "string", - "x-order": 6 - }, - "schema": { - "type": "string", - "x-order": 7 - }, - "tables": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 8 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetQueryPlan": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetQueryPlan gets query plan and plan id for specific filtering.", - "operationId": "GetQueryPlan", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "QueryPlanRequest defines filtering by queryid.", - "type": "object", - "properties": { - "queryid": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "QueryPlanReply 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/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": [ - "Platform" - ], - "summary": "Connect", - "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 - }, - "email": { - "description": "Existing Percona Platform user's email.", - "type": "string", - "x-order": 1 - }, - "password": { - "description": "Existing Percona Platform user's password.", - "type": "string", - "x-order": 2 - }, - "personal_access_token": { - "description": "Personal Access Token that the user obtains from Percona Portal.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Platform/Disconnect": { - "post": { - "description": "Disconnect a PMM server from the organization created on Percona Portal.", - "tags": [ - "Platform" - ], - "summary": "Disconnect", - "operationId": "Disconnect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Platform/SearchOrganizationEntitlements": { - "post": { - "description": "SearchOrganizationEntitlements fetches details of the entitlement's available to the Portal organization that the PMM server is connected to.", - "tags": [ - "Platform" - ], - "summary": "SearchOrganizationEntitlements", - "operationId": "SearchOrganizationEntitlements", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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-order": 3 - }, - "total_units": { - "description": "Total units covered by this entitlement.", - "type": "string", - "x-order": 4 - }, - "unlimited_units": { - "description": "Flag indicates that unlimited units are covered.", - "type": "boolean", - "x-order": 5 - }, - "support_level": { - "description": "Support level covered by this entitlement.", - "type": "string", - "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-order": 0 - }, - "config_advisor": { - "description": "Flag indicates that config advisors are covered by this entitlement.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 10 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Platform/SearchOrganizationTickets": { - "post": { - "description": "SearchOrganizationTickets searches support tickets belonging to the Percona Portal Organization that the PMM server is connected to.", - "tags": [ - "Platform" - ], - "summary": "SearchOrganizationTickets", - "operationId": "SearchOrganizationTickets", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Platform/ServerInfo": { - "post": { - "description": "ServerInfo returns PMM server ID and name.", - "tags": [ - "Platform" - ], - "summary": "ServerInfo", - "operationId": "ServerInfo", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Platform/UserStatus": { - "post": { - "description": "UserStatus returns a boolean indicating whether the current user is logged in with their Percona Account or not.", - "tags": [ - "Platform" - ], - "summary": "UserStatus", - "operationId": "UserStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/ChangePSMDB": { - "post": { - "tags": [ - "Components" - ], - "summary": "ChangePSMDBComponents manages PSMDB related components.", - "operationId": "ChangePSMDBComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "mongod": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/ChangePXC": { - "post": { - "tags": [ - "Components" - ], - "summary": "ChangePXCComponents manages PXC related components.", - "operationId": "ChangePXCComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "pxc": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/CheckForOperatorUpdate": { - "post": { - "tags": [ - "Components" - ], - "summary": "CheckForOperatorUpdate checks if a new version of an operator is available.", - "operationId": "CheckForOperatorUpdate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "cluster_to_components": { - "description": "The cluster name is used as a key for this map, value contains components and their inforamtion about update.", - "type": "object", - "additionalProperties": { - "description": "ComponentsUpdateInformation contains info about components and their available latest versions.", - "type": "object", - "properties": { - "component_to_update_information": { - "description": "component_to_update_information stores, under the name of the component, information about the update.\n\"pxc-operator\", \"psmdb-operator\" are names used by backend for our operators.", - "type": "object", - "additionalProperties": { - "description": "ComponentUpdateInformation contains version we can update to for certain component.", - "type": "object", - "properties": { - "available_version": { - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/GetPSMDB": { - "post": { - "tags": [ - "Components" - ], - "summary": "GetPSMDBComponents returns list of available components for PSMDB Clusters.", - "operationId": "GetPSMDBComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "db_version": { - "description": "Version of DB.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "versions": { - "type": "array", - "items": { - "description": "OperatorVersion contains information about operator and components matrix.", - "type": "object", - "properties": { - "product": { - "type": "string", - "x-order": 0 - }, - "operator": { - "type": "string", - "x-order": 1 - }, - "matrix": { - "description": "Matrix contains all available components.", - "type": "object", - "properties": { - "mongod": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 0 - }, - "pxc": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 1 - }, - "pmm": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 4 - }, - "backup": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 5 - }, - "operator": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 6 - }, - "log_collector": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 7 - } - }, - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/GetPXC": { - "post": { - "tags": [ - "Components" - ], - "summary": "GetPXCComponents returns list of available components for PXC Clusters.", - "operationId": "GetPXCComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "db_version": { - "description": "Version of DB.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "versions": { - "type": "array", - "items": { - "description": "OperatorVersion contains information about operator and components matrix.", - "type": "object", - "properties": { - "product": { - "type": "string", - "x-order": 0 - }, - "operator": { - "type": "string", - "x-order": 1 - }, - "matrix": { - "description": "Matrix contains all available components.", - "type": "object", - "properties": { - "mongod": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 0 - }, - "pxc": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 1 - }, - "pmm": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 4 - }, - "backup": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 5 - }, - "operator": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 6 - }, - "log_collector": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 7 - } - }, - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/InstallOperator": { - "post": { - "tags": [ - "Components" - ], - "summary": "InstallOperator installs given operator in given version.", - "operationId": "InstallOperator", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "operator_type": { - "description": "operator_type tells what operator we are interested in updating.", - "type": "string", - "x-order": 1 - }, - "version": { - "description": "version tells what version of the operator we should update to.", - "type": "string", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "status": { - "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", - "type": "string", - "default": "OPERATORS_STATUS_INVALID", - "enum": [ - "OPERATORS_STATUS_INVALID", - "OPERATORS_STATUS_OK", - "OPERATORS_STATUS_UNSUPPORTED", - "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/Delete": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "DeleteDBCluster deletes DB cluster.", - "operationId": "DeleteDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "DB cluster name.", - "type": "string", - "x-order": 1 - }, - "cluster_type": { - "description": "DBClusterType represents database cluster type.\n\n - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type.\n - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type.\n - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type.", - "type": "string", - "default": "DB_CLUSTER_TYPE_INVALID", - "enum": [ - "DB_CLUSTER_TYPE_INVALID", - "DB_CLUSTER_TYPE_PXC", - "DB_CLUSTER_TYPE_PSMDB" - ], - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/List": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "ListDBClusters returns a list of DB clusters.", - "operationId": "ListDBClusters", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pxc_clusters": { - "description": "PXC clusters information.", - "type": "array", - "items": { - "description": "PXCCluster represents PXC cluster information.", - "type": "object", - "properties": { - "name": { - "description": "Cluster name.", - "type": "string", - "x-order": 0 - }, - "state": { - "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", - "type": "string", - "default": "DB_CLUSTER_STATE_INVALID", - "enum": [ - "DB_CLUSTER_STATE_INVALID", - "DB_CLUSTER_STATE_CHANGING", - "DB_CLUSTER_STATE_READY", - "DB_CLUSTER_STATE_FAILED", - "DB_CLUSTER_STATE_DELETING", - "DB_CLUSTER_STATE_PAUSED", - "DB_CLUSTER_STATE_UPGRADING" - ], - "x-order": 1 - }, - "operation": { - "description": "RunningOperation respresents a long-running operation.", - "type": "object", - "properties": { - "finished_steps": { - "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "description": "Text describing the current operation progress step.", - "type": "string", - "x-order": 1 - }, - "total_steps": { - "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - }, - "x-order": 2 - }, - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for ProxySQL.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for HAProxy.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - } - }, - "x-order": 3 - }, - "exposed": { - "description": "DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 4 - }, - "installed_image": { - "description": "Installed XtraDB image.", - "type": "string", - "x-order": 5 - }, - "available_image": { - "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", - "type": "string", - "x-order": 6 - } - } - }, - "x-order": 0 - }, - "psmdb_clusters": { - "description": "PSMDB clusters information.", - "type": "array", - "items": { - "description": "PSMDBCluster represents PSMDB cluster information.", - "type": "object", - "properties": { - "name": { - "description": "Cluster name.", - "type": "string", - "x-order": 0 - }, - "state": { - "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", - "type": "string", - "default": "DB_CLUSTER_STATE_INVALID", - "enum": [ - "DB_CLUSTER_STATE_INVALID", - "DB_CLUSTER_STATE_CHANGING", - "DB_CLUSTER_STATE_READY", - "DB_CLUSTER_STATE_FAILED", - "DB_CLUSTER_STATE_DELETING", - "DB_CLUSTER_STATE_PAUSED", - "DB_CLUSTER_STATE_UPGRADING" - ], - "x-order": 1 - }, - "operation": { - "description": "RunningOperation respresents a long-running operation.", - "type": "object", - "properties": { - "finished_steps": { - "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "description": "Text describing the current operation progress step.", - "type": "string", - "x-order": 1 - }, - "total_steps": { - "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - }, - "x-order": 2 - }, - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "exposed": { - "description": "DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 4 - }, - "installed_image": { - "description": "Installed PSMDB image.", - "type": "string", - "x-order": 5 - }, - "available_image": { - "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", - "type": "string", - "x-order": 6 - } - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/Restart": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "RestartDBCluster restarts DB cluster.", - "operationId": "RestartDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PXC cluster name.", - "type": "string", - "x-order": 1 - }, - "cluster_type": { - "description": "DBClusterType represents database cluster type.\n\n - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type.\n - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type.\n - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type.", - "type": "string", - "default": "DB_CLUSTER_TYPE_INVALID", - "enum": [ - "DB_CLUSTER_TYPE_INVALID", - "DB_CLUSTER_TYPE_PXC", - "DB_CLUSTER_TYPE_PSMDB" - ], - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/GetLogs": { - "post": { - "tags": [ - "LogsAPI" - ], - "summary": "GetLogs gets all logs from db cluster.", - "operationId": "GetLogs", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "cluster_name": { - "description": "DB cluster name.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "description": "Log represents list of logs. Each entry contains either container's logs or,\nwhen container field is empty, pod's events.", - "type": "array", - "items": { - "description": "Logs contain logs for certain pod's container. If container is an empty\nstring, logs contain pod's events.", - "type": "object", - "properties": { - "pod": { - "description": "Pod name.", - "type": "string", - "x-order": 0 - }, - "container": { - "description": "Container name.", - "type": "string", - "x-order": 1 - }, - "logs": { - "description": "Content of container's log or pod's events.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Get": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "GetKubernetesCluster return KubeAuth with Kubernetes config.", - "operationId": "GetKubernetesCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "kube_auth": { - "description": "KubeAuth represents Kubernetes / kubectl authentication and authorization information.", - "type": "object", - "properties": { - "kubeconfig": { - "description": "Kubeconfig file content.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/List": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "ListKubernetesClusters returns a list of all registered Kubernetes clusters.", - "operationId": "ListKubernetesClusters", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "kubernetes_clusters": { - "description": "Kubernetes clusters.", - "type": "array", - "items": { - "description": "Cluster contains public info about Kubernetes cluster.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "operators": { - "description": "Operators contains list of operators installed in Kubernetes cluster.", - "type": "object", - "properties": { - "pxc": { - "description": "Operator contains all information about operator installed in Kubernetes cluster.", - "type": "object", - "properties": { - "status": { - "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", - "type": "string", - "default": "OPERATORS_STATUS_INVALID", - "enum": [ - "OPERATORS_STATUS_INVALID", - "OPERATORS_STATUS_OK", - "OPERATORS_STATUS_UNSUPPORTED", - "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 - }, - "version": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 0 - }, - "psmdb": { - "description": "Operator contains all information about operator installed in Kubernetes cluster.", - "type": "object", - "properties": { - "status": { - "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", - "type": "string", - "default": "OPERATORS_STATUS_INVALID", - "enum": [ - "OPERATORS_STATUS_INVALID", - "OPERATORS_STATUS_OK", - "OPERATORS_STATUS_UNSUPPORTED", - "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 - }, - "version": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 1 - }, - "status": { - "description": "KubernetesClusterStatus defines status of Kubernetes cluster.\n\n - KUBERNETES_CLUSTER_STATUS_INVALID: KUBERNETES_CLUSTER_STATUS_INVALID represents unknown state.\n - KUBERNETES_CLUSTER_STATUS_OK: KUBERNETES_CLUSTER_STATUS_OK represents that Kubernetes cluster is accessible.\n - KUBERNETES_CLUSTER_STATUS_UNAVAILABLE: KUBERNETES_CLUSTER_STATUS_UNAVAILABLE represents that Kubernetes cluster is not accessible.", - "type": "string", - "default": "KUBERNETES_CLUSTER_STATUS_INVALID", - "enum": [ - "KUBERNETES_CLUSTER_STATUS_INVALID", - "KUBERNETES_CLUSTER_STATUS_OK", - "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" - ], - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Register": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "RegisterKubernetesCluster registers an existing Kubernetes cluster in PMM.", - "operationId": "RegisterKubernetesCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "kube_auth": { - "description": "KubeAuth represents Kubernetes / kubectl authentication and authorization information.", - "type": "object", - "properties": { - "kubeconfig": { - "description": "Kubeconfig file content.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 1 - }, - "aws_access_key_id": { - "description": "AWS access key id, only needed when registering EKS cluster and kubeconfig does not contain it.", - "type": "string", - "x-order": 2 - }, - "aws_secret_access_key": { - "description": "AWS secret access key, only needed when registering EKS cluster and kubeconfig does not contain it.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Resources/Get": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "GetResources returns all and available resources of a Kubernetes cluster.\nNOTE: The user defined in kubeconfig for the cluster has to have rights to\n list and get Pods from all Namespaces. Also getting and listing Nodes\n has to be allowed.", - "operationId": "GetResources", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "all": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 0 - }, - "available": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Unregister": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "UnregisterKubernetesCluster removes a registered Kubernetes cluster from PMM.", - "operationId": "UnregisterKubernetesCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "force": { - "description": "If true then Kubernetes cluster will be deleted\neven if it contains database clusters.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBCluster/Create": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "CreatePSMDBCluster creates a new PSMDB cluster.", - "operationId": "CreatePSMDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "PSMDB cluster name.\na DNS-1035 label must consist of lower case alphanumeric characters or '-',\nstart with an alphabetic character, and end with an alphanumeric character\n(e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')", - "x-order": 1 - }, - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBCluster/Resources/Get": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "GetPSMDBClusterResources returns expected resources to be consumed by the cluster.", - "operationId": "GetPSMDBClusterResources", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "expected": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBCluster/Update": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "UpdatePSMDBCluster updates existing PSMDB cluster.", - "operationId": "UpdatePSMDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PSMDB cluster name.", - "type": "string", - "x-order": 1 - }, - "params": { - "description": "UpdatePSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - } - }, - "x-order": 1 - }, - "suspend": { - "description": "Suspend cluster `pause: true`.", - "type": "boolean", - "x-order": 2 - }, - "resume": { - "description": "Resume cluster `pause: false`.", - "type": "boolean", - "x-order": 3 - }, - "image": { - "description": "PSMDB image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBClusters/GetCredentials": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "GetPSMDBClusterCredentials returns a PSMDB cluster credentials by cluster name.", - "operationId": "GetPSMDBClusterCredentials", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PSMDB cluster name.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "connection_credentials": { - "description": "PSMDBCredentials is a credentials to connect to PSMDB.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "username": { - "description": "MongoDB username.", - "type": "string", - "x-order": 0 - }, - "password": { - "description": "MongoDB password.", - "type": "string", - "x-order": 1 - }, - "host": { - "description": "MongoDB host.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "MongoDB port.", - "type": "integer", - "format": "int32", - "x-order": 3 - }, - "replicaset": { - "description": "Replicaset name.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCCluster/Create": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "CreatePXCCluster creates a new PXC cluster.", - "operationId": "CreatePXCCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "PXC cluster name.\na DNS-1035 label must consist of lower case alphanumeric characters or '-',\nstart with an alphabetic character, and end with an alphanumeric character\n(e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')", - "x-order": 1 - }, - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for ProxySQL.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for HAProxy.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - } - }, - "x-order": 2 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCCluster/Resources/Get": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "GetPXCClusterResources returns expected resources to be consumed by the cluster.", - "operationId": "GetPXCClusterResources", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for ProxySQL.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for HAProxy.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "expected": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCCluster/Update": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "UpdatePXCCluster updates existing PXC cluster.", - "operationId": "UpdatePXCCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PXC cluster name.", - "type": "string", - "x-order": 1 - }, - "params": { - "description": "UpdatePXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "image": { - "description": "Image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - } - }, - "x-order": 2 - }, - "suspend": { - "description": "Suspend cluster `pause: true`.", - "type": "boolean", - "x-order": 3 - }, - "resume": { - "description": "Resume cluster `pause: false`.", - "type": "boolean", - "x-order": 4 - }, - "haproxy": { - "description": "HAProxy container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - } - }, - "x-order": 5 - } - }, - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCClusters/GetCredentials": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "GetPXCClusterCredentials returns a PXC cluster credentials by cluster name.", - "operationId": "GetPXCClusterCredentials", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PXC cluster name.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "connection_credentials": { - "description": "PXCClusterConnectionCredentials is cluster connection credentials.", - "type": "object", - "properties": { - "username": { - "description": "PXC username.", - "type": "string", - "x-order": 0 - }, - "password": { - "description": "PXC password.", - "type": "string", - "x-order": 1 - }, - "host": { - "description": "PXC host.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "PXC port.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/azure/AzureDatabase/Add": { - "post": { - "tags": [ - "AzureDatabase" - ], - "summary": "AddAzureDatabase adds Azure Database instance.", - "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_INVALID", - "enum": [ - "DISCOVER_AZURE_DATABASE_TYPE_INVALID", - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/azure/AzureDatabase/Discover": { - "post": { - "tags": [ - "AzureDatabase" - ], - "summary": "DiscoverAzureDatabase discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.", - "operationId": "DiscoverAzureDatabase", - "parameters": [ - { - "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_INVALID", - "enum": [ - "DISCOVER_AZURE_DATABASE_TYPE_INVALID", - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Artifacts/Delete": { - "post": { - "tags": [ - "Artifacts" - ], - "summary": "DeleteArtifact deletes specified artifact.", - "operationId": "DeleteArtifact", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Machine-readable artifact ID.", - "type": "string", - "x-order": 0 - }, - "remove_files": { - "description": "Removes all the backup files associated with artifact if flag is set.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Artifacts/List": { - "post": { - "tags": [ - "Artifacts" - ], - "summary": "ListArtifacts returns a list of all backup artifacts.", - "operationId": "ListArtifacts", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 7 - }, - "status": { - "description": "BackupStatus shows the current status of execution of backup.", - "type": "string", - "default": "BACKUP_STATUS_INVALID", - "enum": [ - "BACKUP_STATUS_INVALID", - "BACKUP_STATUS_PENDING", - "BACKUP_STATUS_IN_PROGRESS", - "BACKUP_STATUS_PAUSED", - "BACKUP_STATUS_SUCCESS", - "BACKUP_STATUS_ERROR", - "BACKUP_STATUS_DELETING", - "BACKUP_STATUS_FAILED_TO_DELETE" - ], - "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_INVALID", - "enum": [ - "BACKUP_MODE_INVALID", - "SNAPSHOT", - "INCREMENTAL", - "PITR" - ], - "x-order": 10 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/ChangeScheduled": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ChangeScheduledBackup changes existing 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-order": 1 - }, - "cron_expression": { - "description": "How often backup should be run in cron format.", - "type": "string", - "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-order": 4 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 5 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 6 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/GetLogs": { - "post": { - "tags": [ - "Backups" - ], - "summary": "GetLogs returns logs for provided artifact.", - "operationId": "GetLogsMixin2", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "type": "string", - "x-order": 0 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 2 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/ListArtifactCompatibleServices": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ListArtifactCompatibleServices lists compatible services for restoring a backup.", - "operationId": "ListArtifactCompatibleServices", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Artifact id used to determine restore compatibility.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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 - } - } - }, - "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 - } - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/ListScheduled": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ListScheduledBackups returns all scheduled backups.", - "operationId": "ListScheduledBackups", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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 - }, - "cron_expression": { - "description": "How often backup will be run in cron format.", - "type": "string", - "x-order": 5 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 6 - }, - "name": { - "description": "Artifact name.", - "type": "string", - "x-order": 7 - }, - "description": { - "description": "Description.", - "type": "string", - "x-order": 8 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 9 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 10 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 11 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 12 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 13 - }, - "last_run": { - "description": "Last run.", - "type": "string", - "format": "date-time", - "x-order": 14 - }, - "next_run": { - "description": "Next run.", - "type": "string", - "format": "date-time", - "x-order": 15 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 16 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_INVALID", - "enum": [ - "BACKUP_MODE_INVALID", - "SNAPSHOT", - "INCREMENTAL", - "PITR" - ], - "x-order": 17 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/RemoveScheduled": { - "post": { - "tags": [ - "Backups" - ], - "summary": "RemoveScheduledBackup removes existing scheduled backup.", - "operationId": "RemoveScheduledBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/Restore": { - "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": [ - "Backups" - ], - "summary": "RestoreBackup requests the backup restore.", - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/Schedule": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ScheduleBackup schedules repeated 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 - }, - "cron_expression": { - "description": "How often backup should be run in cron format.", - "type": "string", - "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-order": 4 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 5 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 6 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 8 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 9 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_INVALID", - "enum": [ - "BACKUP_MODE_INVALID", - "SNAPSHOT", - "INCREMENTAL", - "PITR" - ], - "x-order": 10 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/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": [ - "Backups" - ], - "summary": "StartBackup request backup specified service to location.", - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/Add": { - "post": { - "tags": [ - "Locations" - ], - "summary": "AddLocation adds 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 - }, - "pmm_client_config": { - "description": "PMMClientLocationConfig represents file system config inside pmm-client.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - }, - "pmm_server_config": { - "description": "PMMServerLocationConfig represents file system config inside pmm-server.", - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/Change": { - "post": { - "tags": [ - "Locations" - ], - "summary": "ChangeLocation changes backup location.", - "operationId": "ChangeLocation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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", - "x-order": 2 - }, - "pmm_client_config": { - "description": "PMMClientLocationConfig represents file system config inside pmm-client.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 3 - }, - "pmm_server_config": { - "description": "PMMServerLocationConfig represents file system config inside pmm-server.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 4 - }, - "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": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/List": { - "post": { - "tags": [ - "Locations" - ], - "summary": "ListLocations returns a list of all backup locations.", - "operationId": "ListLocations", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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 - }, - "pmm_client_config": { - "description": "PMMClientLocationConfig represents file system config inside pmm-client.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 3 - }, - "pmm_server_config": { - "description": "PMMServerLocationConfig represents file system config inside pmm-server.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 4 - }, - "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": 5 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/Remove": { - "post": { - "tags": [ - "Locations" - ], - "summary": "RemoveLocation removes existing backup location.", - "operationId": "RemoveLocation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "force": { - "type": "boolean", - "title": "Force mode", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/TestConfig": { - "post": { - "tags": [ - "Locations" - ], - "summary": "TestLocationConfig tests backup location and credentials.", - "operationId": "TestLocationConfig", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "pmm_client_config": { - "description": "PMMClientLocationConfig represents file system config inside pmm-client.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "pmm_server_config": { - "description": "PMMServerLocationConfig represents file system config inside pmm-server.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 1 - }, - "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": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/RestoreHistory/List": { - "post": { - "tags": [ - "RestoreHistory" - ], - "summary": "ListRestoreHistory returns a list of all backup restore history items.", - "operationId": "ListRestoreHistory", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 8 - }, - "status": { - "description": "RestoreStatus shows the current status of execution of restore.", - "type": "string", - "default": "RESTORE_STATUS_INVALID", - "enum": [ - "RESTORE_STATUS_INVALID", - "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 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Alerts/List": { - "post": { - "tags": [ - "Alerts" - ], - "summary": "ListAlerts returns a list of all Alerts.", - "operationId": "ListAlerts", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "alerts": { - "type": "array", - "items": { - "description": "Alert represents Alert.", - "type": "object", - "properties": { - "alert_id": { - "description": "ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Human-readable summary.", - "type": "string", - "x-order": 1 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 2 - }, - "status": { - "description": "Status represents Alert Rule's and Alert's combined status.\n\n - CLEAR: No alert.\n - PENDING: Pending, but not triggering alert.\n - TRIGGERING: Triggering (firing) alert.\n - SILENCED: Silenced alert.", - "type": "string", - "default": "STATUS_INVALID", - "enum": [ - "STATUS_INVALID", - "CLEAR", - "PENDING", - "TRIGGERING", - "SILENCED" - ], - "x-order": 3 - }, - "labels": { - "description": "Combined labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 4 - }, - "rule": { - "description": "Rule represents Alert Rule.", - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Rule human-readable summary.", - "type": "string", - "x-order": 2 - }, - "template_name": { - "description": "Template used for this rule.", - "type": "string", - "x-order": 3 - }, - "disabled": { - "description": "True if that rule is disabled.", - "type": "boolean", - "x-order": 4 - }, - "expr_template": { - "description": "Expression template.", - "type": "string", - "x-order": 5 - }, - "expr": { - "description": "Expression filled with parameters.", - "type": "string", - "x-order": 6 - }, - "params_definitions": { - "description": "Expression 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_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - }, - "x-order": 7 - }, - "params_values": { - "description": "Expression parameters values.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "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_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "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": 8 - }, - "default_for": { - "description": "Default for duration.", - "type": "string", - "x-order": 9 - }, - "for": { - "description": "For duration.", - "type": "string", - "x-order": 10 - }, - "default_severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 11 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 12 - }, - "custom_labels": { - "description": "Custom labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "channels": { - "description": "Channels.", - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 17 - }, - "created_at": { - "description": "Rule creation time.", - "type": "string", - "format": "date-time", - "x-order": 18 - } - }, - "x-order": 5 - }, - "created_at": { - "description": "Alert creation time.", - "type": "string", - "format": "date-time", - "x-order": 6 - }, - "updated_at": { - "description": "Alert last update time.", - "type": "string", - "format": "date-time", - "x-order": 7 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Alerts/Toggle": { - "post": { - "description": "Pass empty list to apply toggle action to all existing alerts", - "tags": [ - "Alerts" - ], - "summary": "ToggleAlerts allows to switch alerts state between silenced and unsilenced.", - "operationId": "ToggleAlerts", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "alert_ids": { - "description": "List of alerts that silence state should be switched. If provided array is empty than all\nexisting alerts are switched.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "silenced": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Add": { - "post": { - "tags": [ - "Channels" - ], - "summary": "AddChannel adds notification channel.", - "operationId": "AddChannel", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 0 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 1 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 3 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 4 - }, - "disabled": { - "description": "New channel status.", - "type": "boolean", - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Change": { - "post": { - "tags": [ - "Channels" - ], - "summary": "ChangeChannel changes notification channel.", - "operationId": "ChangeChannel", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary. Empty value will not change it.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "Enables or disables that channel. Should be set.", - "type": "boolean", - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/List": { - "post": { - "tags": [ - "Channels" - ], - "summary": "ListChannels returns a list of all notifation channels.", - "operationId": "ListChannels", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "channels": { - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Remove": { - "post": { - "tags": [ - "Channels" - ], - "summary": "RemoveChannel removes notification channel.", - "operationId": "RemoveChannel", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_id": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Create": { - "post": { - "tags": [ - "Rules" - ], - "summary": "CreateAlertRule creates Alerting rule.", - "operationId": "CreateAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "template_name": { - "description": "Template name. Can't be specified simultaneously with source_rule_id.", - "type": "string", - "x-order": 0 - }, - "source_rule_id": { - "description": "ID of the rule that will be used as source. Can't be specified simultaneously with template_name.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 2 - }, - "disabled": { - "description": "New rule status.", - "type": "boolean", - "x-order": 3 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "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_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "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_INVALID", - "enum": [ - "SEVERITY_INVALID", - "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. Should be set.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 8 - }, - "channel_ids": { - "description": "Channels. Should be set.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Delete": { - "post": { - "tags": [ - "Rules" - ], - "summary": "DeleteAlertRule deletes Alerting rule.", - "operationId": "DeleteAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/List": { - "post": { - "tags": [ - "Rules" - ], - "summary": "ListAlertRules returns a list of all Alerting rules.", - "operationId": "ListAlertRules", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rules": { - "type": "array", - "items": { - "description": "Rule represents Alert Rule.", - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Rule human-readable summary.", - "type": "string", - "x-order": 2 - }, - "template_name": { - "description": "Template used for this rule.", - "type": "string", - "x-order": 3 - }, - "disabled": { - "description": "True if that rule is disabled.", - "type": "boolean", - "x-order": 4 - }, - "expr_template": { - "description": "Expression template.", - "type": "string", - "x-order": 5 - }, - "expr": { - "description": "Expression filled with parameters.", - "type": "string", - "x-order": 6 - }, - "params_definitions": { - "description": "Expression 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_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - }, - "x-order": 7 - }, - "params_values": { - "description": "Expression parameters values.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "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_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "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": 8 - }, - "default_for": { - "description": "Default for duration.", - "type": "string", - "x-order": 9 - }, - "for": { - "description": "For duration.", - "type": "string", - "x-order": 10 - }, - "default_severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 11 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 12 - }, - "custom_labels": { - "description": "Custom labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "channels": { - "description": "Channels.", - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 17 - }, - "created_at": { - "description": "Rule creation time.", - "type": "string", - "format": "date-time", - "x-order": 18 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Toggle": { - "post": { - "tags": [ - "Rules" - ], - "summary": "ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule.", - "operationId": "ToggleAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "disabled": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Update": { - "post": { - "tags": [ - "Rules" - ], - "summary": "UpdateAlertRule updates Alerting rule.", - "operationId": "UpdateAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name. Should be set.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "New rule status. Should be set.", - "type": "boolean", - "x-order": 2 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "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_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "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": 3 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 4 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 5 - }, - "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": 6 - }, - "filters": { - "description": "Filters. Should be set.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 7 - }, - "channel_ids": { - "description": "Channels. Should be set.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Templates/Create": { - "post": { - "tags": [ - "Templates" - ], - "summary": "CreateTemplate creates a new template.", - "operationId": "CreateTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "yaml": { - "description": "YAML (or JSON) 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Templates/Delete": { - "post": { - "tags": [ - "Templates" - ], - "summary": "DeleteTemplate deletes existing, previously created via API.", - "operationId": "DeleteTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Templates/List": { - "post": { - "tags": [ - "Templates" - ], - "summary": "ListTemplates returns a list of all collected Alert Rule Templates.", - "operationId": "ListTemplates", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "reload": { - "description": "If true, template files will be re-read from disk.", - "type": "boolean", - "x-order": 0 - }, - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "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_INVALID", - "enum": [ - "SEVERITY_INVALID", - "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 - BUILT_IN: Template that is shipped with PMM Server releases.\n - SAAS: Template that is downloaded from check.percona.com.\n - USER_FILE: Templated loaded from user-suplied file.\n - USER_API: Templated created via API.", - "type": "string", - "default": "TEMPLATE_SOURCE_INVALID", - "enum": [ - "TEMPLATE_SOURCE_INVALID", - "BUILT_IN", - "SAAS", - "USER_FILE", - "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 (or JSON) template file content. Empty for built-in and SaaS templates.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Templates/Update": { - "post": { - "tags": [ - "Templates" - ], - "summary": "UpdateTemplate updates existing template, previously created via API.", - "operationId": "UpdateTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID).", - "type": "string", - "x-order": 0 - }, - "yaml": { - "description": "YAML (or JSON) template file content.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - } - }, - "securityDefinitions": { - "basicAuth": { - "type": "basic" - } - }, - "security": [ - { - "basicAuth": [] - } - ], - "x-readme": { - "samples-languages": [ - "curl", - "go", - "node", - "python" - ] - } -} \ No newline at end of file diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json deleted file mode 100644 index ec7b8510e3..0000000000 --- a/api/swagger/swagger-dev.json +++ /dev/null @@ -1,31381 +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": { - "/logs.zip": { - "get": { - "description": "Returns the PMM Server logs.", - "produces": [ - "application/zip" - ], - "tags": [ - "Server" - ], - "summary": "Logs", - "operationId": "Logs", - "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" - } - } - } - } - } - } - }, - "/v0/qan/Filters/Get": { - "post": { - "tags": [ - "Filters" - ], - "summary": "Get gets map of metrics names.", - "operationId": "Get", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "FiltersRequest 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": "FiltersReply 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/GetMetricsNames": { - "post": { - "tags": [ - "MetricsNames" - ], - "summary": "GetMetricsNames gets map of metrics names.", - "operationId": "GetMetricsNames", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "MetricsNamesRequest is emty.", - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/GetReport": { - "post": { - "tags": [ - "Profile" - ], - "summary": "GetReport returns list of metrics group by queryid or other dimentions.", - "operationId": "GetReport", - "parameters": [ - { - "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": "Boolean metrics:\n- *_sum_per_sec - how many times this matric was true.\n\nQuery 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": "MongoDB metrics.\n\nThe 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_shared_blks_hit_sum_per_sec": { - "description": "PostgreSQL metrics.\n\nTotal number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "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": 53 - }, - "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": 54 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "title": "pg_stat_monitor 0.9 metrics", - "x-order": 57 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 58 - }, - "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": 59 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 61 - } - } - }, - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetHistogram": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetHistogram gets histogram items for specific filtering.", - "operationId": "GetHistogram", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "HistogramRequest 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": "HistogramReply 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetLabels": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetLabels gets list of labels for object details.", - "operationId": "GetLabels", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "ObjectDetailsLabelsRequest 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": "ObjectDetailsLabelsReply 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetMetrics": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetMetrics gets map of metrics for specific filtering.", - "operationId": "GetMetrics", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "MetricsRequest 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": "MetricsReply 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": "Boolean metrics:\n- *_sum_per_sec - how many times this matric was true.\n\nQuery 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": "MongoDB metrics.\n\nThe 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_shared_blks_hit_sum_per_sec": { - "description": "PostgreSQL metrics.\n\nTotal number of shared block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 43 - }, - "m_shared_blks_read_sum_per_sec": { - "description": "Total number of shared blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 44 - }, - "m_shared_blks_dirtied_sum_per_sec": { - "description": "Total number of shared blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 45 - }, - "m_shared_blks_written_sum_per_sec": { - "description": "Total number of shared blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 46 - }, - "m_local_blks_hit_sum_per_sec": { - "description": "Total number of local block cache hits by the statement.", - "type": "number", - "format": "float", - "x-order": 47 - }, - "m_local_blks_read_sum_per_sec": { - "description": "Total number of local blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 48 - }, - "m_local_blks_dirtied_sum_per_sec": { - "description": "Total number of local blocks dirtied by the statement.", - "type": "number", - "format": "float", - "x-order": 49 - }, - "m_local_blks_written_sum_per_sec": { - "description": "Total number of local blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 50 - }, - "m_temp_blks_read_sum_per_sec": { - "description": "Total number of temp blocks read by the statement.", - "type": "number", - "format": "float", - "x-order": 51 - }, - "m_temp_blks_written_sum_per_sec": { - "description": "Total number of temp blocks written by the statement.", - "type": "number", - "format": "float", - "x-order": 52 - }, - "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": 53 - }, - "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": 54 - }, - "m_cpu_user_time_sum_per_sec": { - "description": "Total time user spent in query.", - "type": "number", - "format": "float", - "x-order": 55 - }, - "m_cpu_sys_time_sum_per_sec": { - "description": "Total time system spent in query.", - "type": "number", - "format": "float", - "x-order": 56 - }, - "m_plans_calls_sum_per_sec": { - "description": "Total number of planned calls.", - "type": "number", - "format": "float", - "title": "pg_stat_monitor 0.9 metrics", - "x-order": 57 - }, - "m_wal_records_sum_per_sec": { - "description": "Total number of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 58 - }, - "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": 59 - }, - "m_wal_bytes_sum_per_sec": { - "description": "Total bytes of WAL (Write-ahead logging) records.", - "type": "number", - "format": "float", - "x-order": 60 - }, - "m_plan_time_sum_per_sec": { - "description": "Plan time in per seconds.", - "type": "number", - "format": "float", - "x-order": 61 - } - } - }, - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetQueryExample": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetQueryExample gets list of query examples.", - "operationId": "GetQueryExample", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "QueryExampleRequest 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": "QueryExampleReply 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_format": { - "description": "ExampleFormat is format of query example: real or query without values.\n\nDeprecated: is not used, should not be used, should be removed.", - "type": "string", - "default": "EXAMPLE_FORMAT_INVALID", - "enum": [ - "EXAMPLE_FORMAT_INVALID", - "EXAMPLE", - "FINGERPRINT" - ], - "x-order": 1 - }, - "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_INVALID", - "enum": [ - "EXAMPLE_TYPE_INVALID", - "RANDOM", - "SLOWEST", - "FASTEST", - "WITH_ERROR" - ], - "x-order": 2 - }, - "is_truncated": { - "type": "integer", - "format": "int64", - "x-order": 3 - }, - "example_metrics": { - "type": "string", - "x-order": 4 - }, - "service_id": { - "type": "string", - "x-order": 5 - }, - "service_type": { - "type": "string", - "x-order": 6 - }, - "schema": { - "type": "string", - "x-order": 7 - }, - "tables": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 8 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v0/qan/ObjectDetails/GetQueryPlan": { - "post": { - "tags": [ - "ObjectDetails" - ], - "summary": "GetQueryPlan gets query plan and plan id for specific filtering.", - "operationId": "GetQueryPlan", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "description": "QueryPlanRequest defines filtering by queryid.", - "type": "object", - "properties": { - "queryid": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "description": "QueryPlanReply 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/AWSInstanceCheck": { - "post": { - "description": "Checks AWS EC2 instance ID.", - "tags": [ - "Server" - ], - "summary": "AWS instance check", - "operationId": "AWSInstanceCheck", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "instance_id": { - "description": "AWS EC2 instance ID (i-1234567890abcdef0).", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/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": [ - "Platform" - ], - "summary": "Connect", - "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 - }, - "email": { - "description": "Existing Percona Platform user's email.", - "type": "string", - "x-order": 1 - }, - "password": { - "description": "Existing Percona Platform user's password.", - "type": "string", - "x-order": 2 - }, - "personal_access_token": { - "description": "Personal Access Token that the user obtains from Percona Portal.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Platform/Disconnect": { - "post": { - "description": "Disconnect a PMM server from the organization created on Percona Portal.", - "tags": [ - "Platform" - ], - "summary": "Disconnect", - "operationId": "Disconnect", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Platform/SearchOrganizationEntitlements": { - "post": { - "description": "SearchOrganizationEntitlements fetches details of the entitlement's available to the Portal organization that the PMM server is connected to.", - "tags": [ - "Platform" - ], - "summary": "SearchOrganizationEntitlements", - "operationId": "SearchOrganizationEntitlements", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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-order": 3 - }, - "total_units": { - "description": "Total units covered by this entitlement.", - "type": "string", - "x-order": 4 - }, - "unlimited_units": { - "description": "Flag indicates that unlimited units are covered.", - "type": "boolean", - "x-order": 5 - }, - "support_level": { - "description": "Support level covered by this entitlement.", - "type": "string", - "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-order": 0 - }, - "config_advisor": { - "description": "Flag indicates that config advisors are covered by this entitlement.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 10 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Platform/SearchOrganizationTickets": { - "post": { - "description": "SearchOrganizationTickets searches support tickets belonging to the Percona Portal Organization that the PMM server is connected to.", - "tags": [ - "Platform" - ], - "summary": "SearchOrganizationTickets", - "operationId": "SearchOrganizationTickets", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Platform/ServerInfo": { - "post": { - "description": "ServerInfo returns PMM server ID and name.", - "tags": [ - "Platform" - ], - "summary": "ServerInfo", - "operationId": "ServerInfo", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Platform/UserStatus": { - "post": { - "description": "UserStatus returns a boolean indicating whether the current user is logged in with their Percona Account or not.", - "tags": [ - "Platform" - ], - "summary": "UserStatus", - "operationId": "UserStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Settings/Change": { - "post": { - "description": "Changes PMM Server settings.", - "tags": [ - "Server" - ], - "summary": "Change settings", - "operationId": "ChangeSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "enable_updates": { - "type": "boolean", - "x-order": 0 - }, - "disable_updates": { - "type": "boolean", - "x-order": 1 - }, - "enable_telemetry": { - "type": "boolean", - "x-order": 2 - }, - "disable_telemetry": { - "type": "boolean", - "x-order": 3 - }, - "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": 4 - }, - "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": 5 - }, - "ssh_key": { - "type": "string", - "x-order": 6 - }, - "aws_partitions": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 7 - }, - "alert_manager_url": { - "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", - "type": "string", - "x-order": 8 - }, - "remove_alert_manager_url": { - "description": "Remove external AlertManager URL.", - "type": "boolean", - "x-order": 9 - }, - "alert_manager_rules": { - "description": "Custom alerting or recording rules.", - "type": "string", - "x-order": 10 - }, - "remove_alert_manager_rules": { - "description": "Remove custom alerting or recording rules.", - "type": "boolean", - "x-order": 11 - }, - "enable_stt": { - "description": "Enable Security Threat Tool.", - "type": "boolean", - "x-order": 12 - }, - "disable_stt": { - "description": "Disable Security Threat Tool.", - "type": "boolean", - "x-order": 13 - }, - "enable_alerting": { - "description": "Enable Alerting.", - "type": "boolean", - "x-order": 14 - }, - "disable_alerting": { - "description": "Disable Alerting.", - "type": "boolean", - "x-order": 15 - }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 16 - }, - "remove_email_alerting_settings": { - "description": "If true, removes Alerting email (SMTP) settings.", - "type": "boolean", - "x-order": 17 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 18 - }, - "remove_slack_alerting_settings": { - "description": "If true, removes Alerting Slack settings.", - "type": "boolean", - "x-order": 19 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 20 - }, - "remove_pmm_public_address": { - "type": "boolean", - "x-order": 21 - }, - "stt_check_intervals": { - "description": "STTCheckIntervals represents intervals between STT 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": 22 - }, - "enable_azurediscover": { - "description": "Enable Azure Discover.", - "type": "boolean", - "x-order": 23 - }, - "disable_azurediscover": { - "description": "Disable Azure Discover.", - "type": "boolean", - "x-order": 24 - }, - "enable_backup_management": { - "description": "Enable Backup Management.", - "type": "boolean", - "x-order": 25 - }, - "disable_backup_management": { - "description": "Disable Backup Management.", - "type": "boolean", - "x-order": 26 - }, - "enable_dbaas": { - "description": "Enable DBaaS.", - "type": "boolean", - "x-order": 27 - }, - "disable_dbaas": { - "description": "Disable DBaaS.", - "type": "boolean", - "x-order": 28 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "Settings represents PMM Server settings.", - "type": "object", - "properties": { - "updates_disabled": { - "description": "True if updates are disabled.", - "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 - }, - "alert_manager_url": { - "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", - "type": "string", - "x-order": 6 - }, - "alert_manager_rules": { - "description": "Custom alerting or recording rules.", - "type": "string", - "x-order": 7 - }, - "stt_enabled": { - "description": "True if Security Threat Tool is enabled.", - "type": "boolean", - "x-order": 8 - }, - "platform_email": { - "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", - "type": "string", - "x-order": 9 - }, - "dbaas_enabled": { - "description": "True if DBaaS is enabled.", - "type": "boolean", - "x-order": 10 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 11 - }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 12 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 13 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 14 - }, - "stt_check_intervals": { - "description": "STTCheckIntervals represents intervals between STT 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": 15 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 16 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 17 - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform", - "x-order": 18 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Settings/Get": { - "post": { - "description": "Returns current PMM Server settings.", - "tags": [ - "Server" - ], - "summary": "Get settings", - "operationId": "GetSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "Settings represents PMM Server settings.", - "type": "object", - "properties": { - "updates_disabled": { - "description": "True if updates are disabled.", - "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 - }, - "alert_manager_url": { - "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", - "type": "string", - "x-order": 6 - }, - "alert_manager_rules": { - "description": "Custom alerting or recording rules.", - "type": "string", - "x-order": 7 - }, - "stt_enabled": { - "description": "True if Security Threat Tool is enabled.", - "type": "boolean", - "x-order": 8 - }, - "platform_email": { - "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", - "type": "string", - "x-order": 9 - }, - "dbaas_enabled": { - "description": "True if DBaaS is enabled.", - "type": "boolean", - "x-order": 10 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 11 - }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 12 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 13 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 14 - }, - "stt_check_intervals": { - "description": "STTCheckIntervals represents intervals between STT 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": 15 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 16 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 17 - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform", - "x-order": 18 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Settings/TestEmailAlertingSettings": { - "post": { - "description": "Sends test email to check current SMTP settings for email alerting.", - "tags": [ - "Server" - ], - "summary": "Test email alerting", - "operationId": "TestEmailAlertingSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 0 - }, - "email_to": { - "description": "Target email address to send the email to.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Updates/Check": { - "post": { - "description": "Checks for available PMM Server updates.", - "tags": [ - "Server" - ], - "summary": "Check updates", - "operationId": "CheckUpdates", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "force": { - "description": "If false, cached information may be returned.", - "type": "boolean", - "x-order": 0 - }, - "only_installed_version": { - "description": "If true, only installed version will be in response.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "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": { - "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 - }, - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Updates/Start": { - "post": { - "description": "Starts PMM Server update.", - "tags": [ - "Server" - ], - "summary": "Start update", - "operationId": "StartUpdate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Updates/Status": { - "post": { - "description": "Returns PMM Server update status.", - "tags": [ - "Server" - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddAzureDatabaseExporter": { - "post": { - "description": "Adds azure_database_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add Azure Database Exporter", - "operationId": "AddAzureDatabaseExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddExternalExporter": { - "post": { - "description": "Adds external_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add External Exporter", - "operationId": "AddExternalExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddMongoDBExporter": { - "post": { - "description": "Adds mongodb_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add MongoDB Exporter", - "operationId": "AddMongoDBExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddMySQLdExporter": { - "post": { - "description": "Adds mysqld_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add mysqld Exporter", - "operationId": "AddMySQLdExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - }, - "x-order": 0 - }, - "table_count": { - "description": "Actual table count at the moment of adding.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddNodeExporter": { - "post": { - "description": "Adds node_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add Node Exporter", - "operationId": "AddNodeExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 6 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 7 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddPMMAgent": { - "post": { - "description": "Adds PMM Agent.", - "tags": [ - "Agents" - ], - "summary": "Add PMM Agent", - "operationId": "AddPMMAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddPostgresExporter": { - "post": { - "description": "Adds postgres_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add Postgres Exporter", - "operationId": "AddPostgresExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddProxySQLExporter": { - "post": { - "description": "Adds proxysql_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add ProxySQL Exporter", - "operationId": "AddProxySQLExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddQANMongoDBProfilerAgent": { - "post": { - "description": "Adds 'Query Analytics MongoDB Profiler' Agent.", - "tags": [ - "Agents" - ], - "summary": "Add 'QAN MongoDB Profiler' Agent", - "operationId": "AddQANMongoDBProfilerAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - }, - "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 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 11 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 12 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddQANMySQLPerfSchemaAgent": { - "post": { - "description": "Adds 'Query Analytics MySQL PerfSchema' Agent.", - "tags": [ - "Agents" - ], - "summary": "Add 'QAN MySQL PerfSchema' Agent", - "operationId": "AddQANMySQLPerfSchemaAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddQANMySQLSlowlogAgent": { - "post": { - "description": "Adds 'Query Analytics MySQL Slowlog' Agent.", - "tags": [ - "Agents" - ], - "summary": "Add 'QAN MySQL Slowlog' Agent", - "operationId": "AddQANMySQLSlowlogAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 9 - }, - "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": 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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 13 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddQANPostgreSQLPgStatMonitorAgent": { - "post": { - "description": "Adds 'Query Analytics PostgreSQL pg_stat_monitor' Agent.", - "tags": [ - "Agents" - ], - "summary": "Add 'QAN PostgreSQL pg_stat_monitor' Agent", - "operationId": "AddQANPostgreSQLPgStatMonitorAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 8 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 9 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 10 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 11 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 9 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddQANPostgreSQLPgStatementsAgent": { - "post": { - "description": "Adds 'Query Analytics PostgreSQL pg_stat_statements' Agent.", - "tags": [ - "Agents" - ], - "summary": "Add 'QAN PostgreSQL pg_stat_statements' Agent", - "operationId": "AddQANPostgreSQLPgStatementsAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 8 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 9 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 10 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddRDSExporter": { - "post": { - "description": "Adds rds_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add RDS Exporter", - "operationId": "AddRDSExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeAzureDatabaseExporter": { - "post": { - "description": "Changes azure_database_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change Azure Database Exporter", - "operationId": "ChangeAzureDatabaseExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeExternalExporter": { - "post": { - "description": "Changes external_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change External Exporter", - "operationId": "ChangeExternalExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeMongoDBExporter": { - "post": { - "description": "Changes mongodb_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change MongoDB Exporter", - "operationId": "ChangeMongoDBExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeMySQLdExporter": { - "post": { - "description": "Changes mysqld_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change mysqld Exporter", - "operationId": "ChangeMySQLdExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeNodeExporter": { - "post": { - "description": "Changes node_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change Node Exporter", - "operationId": "ChangeNodeExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 6 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 7 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangePostgresExporter": { - "post": { - "description": "Changes postgres_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change Postgres Exporter", - "operationId": "ChangePostgresExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeProxySQLExporter": { - "post": { - "description": "Changes proxysql_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change ProxySQL Exporter", - "operationId": "ChangeProxySQLExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeQANMongoDBProfilerAgent": { - "post": { - "description": "Changes 'Query Analytics MongoDB Profiler' Agent.", - "tags": [ - "Agents" - ], - "summary": "Change 'QAN MongoDB Profiler' Agent", - "operationId": "ChangeQANMongoDBProfilerAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeQANMySQLPerfSchemaAgent": { - "post": { - "description": "Changes 'Query Analytics MySQL PerfSchema' Agent.", - "tags": [ - "Agents" - ], - "summary": "Change 'QAN MySQL PerfSchema' Agent", - "operationId": "ChangeQANMySQLPerfSchemaAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeQANMySQLSlowlogAgent": { - "post": { - "description": "Changes 'Query Analytics MySQL Slowlog' Agent.", - "tags": [ - "Agents" - ], - "summary": "Change 'QAN MySQL Slowlog' Agent", - "operationId": "ChangeQANMySQLSlowlogAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 13 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeQANPostgreSQLPgStatMonitorAgent": { - "post": { - "description": "Changes 'Query Analytics PostgreSQL pg_stat_monitor' Agent.", - "tags": [ - "Agents" - ], - "summary": "Change 'QAN PostgreSQL pg_stat_monitor' Agent", - "operationId": "ChangeQANPostgreSQLPgStatMonitorAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 9 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeQANPostgreSQLPgStatementsAgent": { - "post": { - "description": "Changes 'Query Analytics PostgreSQL pg_stat_statements' Agent.", - "tags": [ - "Agents" - ], - "summary": "Change 'QAN PostgreSQL pg_stat_statements' Agent", - "operationId": "ChangeQANPostgreSQLPgStatementsAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeRDSExporter": { - "post": { - "description": "Changes rds_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change RDS Exporter", - "operationId": "ChangeRDSExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/Get": { - "post": { - "description": "Returns a single Agent by ID.", - "tags": [ - "Agents" - ], - "summary": "Get Agent", - "operationId": "GetAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 2 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 6 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 7 - } - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 13 - } - }, - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 9 - }, - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 10 - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 9 - } - }, - "x-order": 11 - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "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 - } - }, - "x-order": 13 - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 14 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/List": { - "post": { - "description": "Returns a list of all Agents.", - "tags": [ - "Agents" - ], - "summary": "List Agents", - "operationId": "ListAgents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "Return only Agents started by this pmm-agent.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Return only Agents that provide insights for that Node.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "type": "string", - "x-order": 1 - }, - "service_id": { - "description": "Return only Agents that provide insights for that Service.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "type": "string", - "x-order": 2 - }, - "agent_type": { - "description": "AgentType describes supported Agent types.", - "type": "string", - "default": "AGENT_TYPE_INVALID", - "enum": [ - "AGENT_TYPE_INVALID", - "PMM_AGENT", - "VM_AGENT", - "NODE_EXPORTER", - "MYSQLD_EXPORTER", - "MONGODB_EXPORTER", - "POSTGRES_EXPORTER", - "PROXYSQL_EXPORTER", - "QAN_MYSQL_PERFSCHEMA_AGENT", - "QAN_MYSQL_SLOWLOG_AGENT", - "QAN_MONGODB_PROFILER_AGENT", - "QAN_POSTGRESQL_PGSTATEMENTS_AGENT", - "QAN_POSTGRESQL_PGSTATMONITOR_AGENT", - "RDS_EXPORTER", - "EXTERNAL_EXPORTER", - "AZURE_DATABASE_EXPORTER" - ], - "x-order": 3 - } - } - } - } - ], - "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 - } - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 2 - } - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 6 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 7 - } - } - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 13 - } - } - }, - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - } - }, - "x-order": 9 - }, - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - } - }, - "x-order": 10 - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 9 - } - } - }, - "x-order": 11 - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - } - }, - "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 - } - } - }, - "x-order": 13 - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - } - }, - "x-order": 14 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/Remove": { - "post": { - "description": "Removes Agent.", - "tags": [ - "Agents" - ], - "summary": "Remove Agent", - "operationId": "RemoveAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "force": { - "description": "Remove agent with all dependencies.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/AddContainer": { - "post": { - "description": "Adds container Node.", - "tags": [ - "Nodes" - ], - "summary": "Add Container Node", - "operationId": "AddContainerNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/AddGeneric": { - "post": { - "description": "Adds generic Node.", - "tags": [ - "Nodes" - ], - "summary": "Add Generic Node", - "operationId": "AddGenericNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/AddRemote": { - "post": { - "description": "Adds remote Node.", - "tags": [ - "Nodes" - ], - "summary": "Add Remote Node", - "operationId": "AddRemoteNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/AddRemoteAzureDatabase": { - "post": { - "description": "Adds remote Azure database Node.", - "tags": [ - "Nodes" - ], - "summary": "Add Remote Azure Database Node", - "operationId": "AddRemoteAzureDatabaseNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/AddRemoteRDS": { - "post": { - "description": "Adds remote RDS Node.", - "tags": [ - "Nodes" - ], - "summary": "Add Remote RDS Node", - "operationId": "AddRemoteRDSNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "remote_rds": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/Get": { - "post": { - "description": "Returns a single Node by ID.", - "tags": [ - "Nodes" - ], - "summary": "Get Node", - "operationId": "GetNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "remote": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 2 - }, - "remote_rds": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/List": { - "post": { - "description": "Returns a list of all Nodes.", - "tags": [ - "Nodes" - ], - "summary": "List Nodes", - "operationId": "ListNodes", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 - } - } - } - } - ], - "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 - } - } - }, - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/Remove": { - "post": { - "description": "Removes Node.", - "tags": [ - "Nodes" - ], - "summary": "Remove Node", - "operationId": "RemoveNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "force": { - "description": "Remove node with all dependencies.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddExternalService": { - "post": { - "description": "Adds External Service.", - "tags": [ - "Services" - ], - "summary": "Add External Service", - "operationId": "AddExternalService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddHAProxyService": { - "post": { - "description": "Adds HAProxy Service.", - "tags": [ - "Services" - ], - "summary": "Add HAProxy Service", - "operationId": "AddHAProxyService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddMongoDB": { - "post": { - "description": "Adds MongoDB Service.", - "tags": [ - "Services" - ], - "summary": "Add MongoDB Service", - "operationId": "AddMongoDBService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddMySQL": { - "post": { - "description": "Adds MySQL Service.", - "tags": [ - "Services" - ], - "summary": "Add MySQL Service", - "operationId": "AddMySQLService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddPostgreSQL": { - "post": { - "description": "Adds PostgreSQL Service.", - "tags": [ - "Services" - ], - "summary": "Add PostgreSQL Service", - "operationId": "AddPostgreSQLService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddProxySQL": { - "post": { - "description": "Adds ProxySQL Service.", - "tags": [ - "Services" - ], - "summary": "Add ProxySQL Service", - "operationId": "AddProxySQLService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/Get": { - "post": { - "description": "Returns a single Service by ID.", - "tags": [ - "Services" - ], - "summary": "Get Service", - "operationId": "GetService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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 - } - }, - "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 - } - }, - "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 - } - }, - "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 - } - }, - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/List": { - "post": { - "description": "Returns a list of Services filtered by type.", - "tags": [ - "Services" - ], - "summary": "List Services", - "operationId": "ListServices", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_id": { - "description": "Return only Services running on that Node.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "ServiceType describes supported Service types.", - "type": "string", - "default": "SERVICE_TYPE_INVALID", - "enum": [ - "SERVICE_TYPE_INVALID", - "MYSQL_SERVICE", - "MONGODB_SERVICE", - "POSTGRESQL_SERVICE", - "PROXYSQL_SERVICE", - "HAPROXY_SERVICE", - "EXTERNAL_SERVICE" - ], - "x-order": 1 - }, - "external_group": { - "description": "Return only services in this external group.", - "type": "string", - "x-order": 2 - } - } - } - } - ], - "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 - } - } - }, - "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 - } - } - }, - "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 - } - } - }, - "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 - } - } - }, - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/Remove": { - "post": { - "description": "Removes Service.", - "tags": [ - "Services" - ], - "summary": "Remove Service", - "operationId": "RemoveService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Unique randomly generated instance identifier. Required.", - "type": "string", - "x-order": 0 - }, - "force": { - "description": "Remove service with all dependencies.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/Cancel": { - "post": { - "description": "Stops an Action.", - "tags": [ - "Actions" - ], - "summary": "Cancel 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/Get": { - "post": { - "description": "Gets the result of a given Action.", - "tags": [ - "Actions" - ], - "summary": "Get Action", - "operationId": "GetAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMongoDBExplain": { - "post": { - "description": "Starts 'MongoDB EXPLAIN' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'MongoDB EXPLAIN' Action", - "operationId": "StartMongoDBExplainAction", - "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 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "Query. Required.", - "type": "string", - "x-order": 2 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLExplain": { - "post": { - "description": "Starts 'MySQL EXPLAIN' Action with traditional output.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL EXPLAIN' Action", - "operationId": "StartMySQLExplainAction", - "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 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "SQL query. Required.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLExplainJSON": { - "post": { - "description": "Starts 'MySQL EXPLAIN' Action with JSON output.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL EXPLAIN JSON' Action", - "operationId": "StartMySQLExplainJSONAction", - "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 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "SQL query. Required.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLExplainTraditionalJSON": { - "post": { - "description": "Starts 'MySQL EXPLAIN' Action with traditional JSON output.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL EXPLAIN Traditional JSON' Action", - "operationId": "StartMySQLExplainTraditionalJSONAction", - "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 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "SQL query. Required.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLShowCreateTable": { - "post": { - "description": "Starts 'MySQL SHOW CREATE TABLE' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL SHOW CREATE TABLE' Action", - "operationId": "StartMySQLShowCreateTableAction", - "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 - }, - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLShowIndex": { - "post": { - "description": "Starts 'MySQL SHOW INDEX' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL SHOW INDEX' Action", - "operationId": "StartMySQLShowIndexAction", - "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 - }, - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLShowTableStatus": { - "post": { - "description": "Starts 'MySQL SHOW TABLE STATUS' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL SHOW TABLE STATUS' Action", - "operationId": "StartMySQLShowTableStatusAction", - "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 - }, - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPTMongoDBSummary": { - "post": { - "description": "Starts 'Percona Toolkit MongoDB Summary' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'PT MongoDB Summary' Action", - "operationId": "StartPTMongoDBSummaryAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPTMySQLSummary": { - "post": { - "description": "Starts 'Percona Toolkit MySQL Summary' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'PT MySQL Summary' Action", - "operationId": "StartPTMySQLSummaryAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPTPgSummary": { - "post": { - "description": "Starts 'Percona Toolkit PostgreSQL Summary' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'PT PostgreSQL Summary' Action", - "operationId": "StartPTPgSummaryAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPTSummary": { - "post": { - "description": "Starts 'Percona Toolkit Summary' Action.", - "tags": [ - "Actions" - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPostgreSQLShowCreateTable": { - "post": { - "description": "Starts 'PostgreSQL SHOW CREATE TABLE' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'PostgreSQL SHOW CREATE TABLE' Action", - "operationId": "StartPostgreSQLShowCreateTableAction", - "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 - }, - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPostgreSQLShowIndex": { - "post": { - "description": "Starts 'PostgreSQL SHOW INDEX' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'PostgreSQL SHOW INDEX' Action", - "operationId": "StartPostgreSQLShowIndexAction", - "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 - }, - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Annotations/Add": { - "post": { - "description": "Adds annotation.", - "tags": [ - "Annotation" - ], - "summary": "Add Annotation", - "operationId": "AddAnnotation", - "parameters": [ - { - "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 annotate node.", - "type": "string", - "x-order": 2 - }, - "service_names": { - "description": "Used for annotate 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/ChangePSMDB": { - "post": { - "tags": [ - "Components" - ], - "summary": "ChangePSMDBComponents manages PSMDB related components.", - "operationId": "ChangePSMDBComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "mongod": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/ChangePXC": { - "post": { - "tags": [ - "Components" - ], - "summary": "ChangePXCComponents manages PXC related components.", - "operationId": "ChangePXCComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "pxc": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "ChangeComponent contains fields to manage components.", - "type": "object", - "properties": { - "default_version": { - "type": "string", - "x-order": 0 - }, - "versions": { - "type": "array", - "items": { - "description": "ComponentVersion contains operations which should be done with component version.", - "type": "object", - "properties": { - "version": { - "type": "string", - "x-order": 0 - }, - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/CheckForOperatorUpdate": { - "post": { - "tags": [ - "Components" - ], - "summary": "CheckForOperatorUpdate checks if a new version of an operator is available.", - "operationId": "CheckForOperatorUpdate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "cluster_to_components": { - "description": "The cluster name is used as a key for this map, value contains components and their inforamtion about update.", - "type": "object", - "additionalProperties": { - "description": "ComponentsUpdateInformation contains info about components and their available latest versions.", - "type": "object", - "properties": { - "component_to_update_information": { - "description": "component_to_update_information stores, under the name of the component, information about the update.\n\"pxc-operator\", \"psmdb-operator\" are names used by backend for our operators.", - "type": "object", - "additionalProperties": { - "description": "ComponentUpdateInformation contains version we can update to for certain component.", - "type": "object", - "properties": { - "available_version": { - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/GetPSMDB": { - "post": { - "tags": [ - "Components" - ], - "summary": "GetPSMDBComponents returns list of available components for PSMDB Clusters.", - "operationId": "GetPSMDBComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "db_version": { - "description": "Version of DB.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "versions": { - "type": "array", - "items": { - "description": "OperatorVersion contains information about operator and components matrix.", - "type": "object", - "properties": { - "product": { - "type": "string", - "x-order": 0 - }, - "operator": { - "type": "string", - "x-order": 1 - }, - "matrix": { - "description": "Matrix contains all available components.", - "type": "object", - "properties": { - "mongod": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 0 - }, - "pxc": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 1 - }, - "pmm": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 4 - }, - "backup": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 5 - }, - "operator": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 6 - }, - "log_collector": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 7 - } - }, - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/GetPXC": { - "post": { - "tags": [ - "Components" - ], - "summary": "GetPXCComponents returns list of available components for PXC Clusters.", - "operationId": "GetPXCComponents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "db_version": { - "description": "Version of DB.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "versions": { - "type": "array", - "items": { - "description": "OperatorVersion contains information about operator and components matrix.", - "type": "object", - "properties": { - "product": { - "type": "string", - "x-order": 0 - }, - "operator": { - "type": "string", - "x-order": 1 - }, - "matrix": { - "description": "Matrix contains all available components.", - "type": "object", - "properties": { - "mongod": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 0 - }, - "pxc": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 1 - }, - "pmm": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 3 - }, - "haproxy": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 4 - }, - "backup": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 5 - }, - "operator": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 6 - }, - "log_collector": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "image_path": { - "type": "string", - "x-order": 0 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "status": { - "type": "string", - "x-order": 2 - }, - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - } - } - }, - "x-order": 7 - } - }, - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Components/InstallOperator": { - "post": { - "tags": [ - "Components" - ], - "summary": "InstallOperator installs given operator in given version.", - "operationId": "InstallOperator", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "operator_type": { - "description": "operator_type tells what operator we are interested in updating.", - "type": "string", - "x-order": 1 - }, - "version": { - "description": "version tells what version of the operator we should update to.", - "type": "string", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "status": { - "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", - "type": "string", - "default": "OPERATORS_STATUS_INVALID", - "enum": [ - "OPERATORS_STATUS_INVALID", - "OPERATORS_STATUS_OK", - "OPERATORS_STATUS_UNSUPPORTED", - "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/Delete": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "DeleteDBCluster deletes DB cluster.", - "operationId": "DeleteDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "DB cluster name.", - "type": "string", - "x-order": 1 - }, - "cluster_type": { - "description": "DBClusterType represents database cluster type.\n\n - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type.\n - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type.\n - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type.", - "type": "string", - "default": "DB_CLUSTER_TYPE_INVALID", - "enum": [ - "DB_CLUSTER_TYPE_INVALID", - "DB_CLUSTER_TYPE_PXC", - "DB_CLUSTER_TYPE_PSMDB" - ], - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/List": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "ListDBClusters returns a list of DB clusters.", - "operationId": "ListDBClusters", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pxc_clusters": { - "description": "PXC clusters information.", - "type": "array", - "items": { - "description": "PXCCluster represents PXC cluster information.", - "type": "object", - "properties": { - "name": { - "description": "Cluster name.", - "type": "string", - "x-order": 0 - }, - "state": { - "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", - "type": "string", - "default": "DB_CLUSTER_STATE_INVALID", - "enum": [ - "DB_CLUSTER_STATE_INVALID", - "DB_CLUSTER_STATE_CHANGING", - "DB_CLUSTER_STATE_READY", - "DB_CLUSTER_STATE_FAILED", - "DB_CLUSTER_STATE_DELETING", - "DB_CLUSTER_STATE_PAUSED", - "DB_CLUSTER_STATE_UPGRADING" - ], - "x-order": 1 - }, - "operation": { - "description": "RunningOperation respresents a long-running operation.", - "type": "object", - "properties": { - "finished_steps": { - "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "description": "Text describing the current operation progress step.", - "type": "string", - "x-order": 1 - }, - "total_steps": { - "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - }, - "x-order": 2 - }, - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for ProxySQL.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for HAProxy.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - } - }, - "x-order": 3 - }, - "exposed": { - "description": "DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 4 - }, - "installed_image": { - "description": "Installed XtraDB image.", - "type": "string", - "x-order": 5 - }, - "available_image": { - "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", - "type": "string", - "x-order": 6 - } - } - }, - "x-order": 0 - }, - "psmdb_clusters": { - "description": "PSMDB clusters information.", - "type": "array", - "items": { - "description": "PSMDBCluster represents PSMDB cluster information.", - "type": "object", - "properties": { - "name": { - "description": "Cluster name.", - "type": "string", - "x-order": 0 - }, - "state": { - "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", - "type": "string", - "default": "DB_CLUSTER_STATE_INVALID", - "enum": [ - "DB_CLUSTER_STATE_INVALID", - "DB_CLUSTER_STATE_CHANGING", - "DB_CLUSTER_STATE_READY", - "DB_CLUSTER_STATE_FAILED", - "DB_CLUSTER_STATE_DELETING", - "DB_CLUSTER_STATE_PAUSED", - "DB_CLUSTER_STATE_UPGRADING" - ], - "x-order": 1 - }, - "operation": { - "description": "RunningOperation respresents a long-running operation.", - "type": "object", - "properties": { - "finished_steps": { - "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "description": "Text describing the current operation progress step.", - "type": "string", - "x-order": 1 - }, - "total_steps": { - "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", - "type": "integer", - "format": "int32", - "x-order": 2 - } - }, - "x-order": 2 - }, - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "exposed": { - "description": "DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 4 - }, - "installed_image": { - "description": "Installed PSMDB image.", - "type": "string", - "x-order": 5 - }, - "available_image": { - "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", - "type": "string", - "x-order": 6 - } - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/Restart": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "RestartDBCluster restarts DB cluster.", - "operationId": "RestartDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PXC cluster name.", - "type": "string", - "x-order": 1 - }, - "cluster_type": { - "description": "DBClusterType represents database cluster type.\n\n - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type.\n - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type.\n - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type.", - "type": "string", - "default": "DB_CLUSTER_TYPE_INVALID", - "enum": [ - "DB_CLUSTER_TYPE_INVALID", - "DB_CLUSTER_TYPE_PXC", - "DB_CLUSTER_TYPE_PSMDB" - ], - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/GetLogs": { - "post": { - "tags": [ - "LogsAPI" - ], - "summary": "GetLogs gets all logs from db cluster.", - "operationId": "GetLogs", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "cluster_name": { - "description": "DB cluster name.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "logs": { - "description": "Log represents list of logs. Each entry contains either container's logs or,\nwhen container field is empty, pod's events.", - "type": "array", - "items": { - "description": "Logs contain logs for certain pod's container. If container is an empty\nstring, logs contain pod's events.", - "type": "object", - "properties": { - "pod": { - "description": "Pod name.", - "type": "string", - "x-order": 0 - }, - "container": { - "description": "Container name.", - "type": "string", - "x-order": 1 - }, - "logs": { - "description": "Content of container's log or pod's events.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Get": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "GetKubernetesCluster return KubeAuth with Kubernetes config.", - "operationId": "GetKubernetesCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "kube_auth": { - "description": "KubeAuth represents Kubernetes / kubectl authentication and authorization information.", - "type": "object", - "properties": { - "kubeconfig": { - "description": "Kubeconfig file content.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/List": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "ListKubernetesClusters returns a list of all registered Kubernetes clusters.", - "operationId": "ListKubernetesClusters", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "kubernetes_clusters": { - "description": "Kubernetes clusters.", - "type": "array", - "items": { - "description": "Cluster contains public info about Kubernetes cluster.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "operators": { - "description": "Operators contains list of operators installed in Kubernetes cluster.", - "type": "object", - "properties": { - "pxc": { - "description": "Operator contains all information about operator installed in Kubernetes cluster.", - "type": "object", - "properties": { - "status": { - "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", - "type": "string", - "default": "OPERATORS_STATUS_INVALID", - "enum": [ - "OPERATORS_STATUS_INVALID", - "OPERATORS_STATUS_OK", - "OPERATORS_STATUS_UNSUPPORTED", - "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 - }, - "version": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 0 - }, - "psmdb": { - "description": "Operator contains all information about operator installed in Kubernetes cluster.", - "type": "object", - "properties": { - "status": { - "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", - "type": "string", - "default": "OPERATORS_STATUS_INVALID", - "enum": [ - "OPERATORS_STATUS_INVALID", - "OPERATORS_STATUS_OK", - "OPERATORS_STATUS_UNSUPPORTED", - "OPERATORS_STATUS_NOT_INSTALLED" - ], - "x-order": 0 - }, - "version": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 1 - }, - "status": { - "description": "KubernetesClusterStatus defines status of Kubernetes cluster.\n\n - KUBERNETES_CLUSTER_STATUS_INVALID: KUBERNETES_CLUSTER_STATUS_INVALID represents unknown state.\n - KUBERNETES_CLUSTER_STATUS_OK: KUBERNETES_CLUSTER_STATUS_OK represents that Kubernetes cluster is accessible.\n - KUBERNETES_CLUSTER_STATUS_UNAVAILABLE: KUBERNETES_CLUSTER_STATUS_UNAVAILABLE represents that Kubernetes cluster is not accessible.", - "type": "string", - "default": "KUBERNETES_CLUSTER_STATUS_INVALID", - "enum": [ - "KUBERNETES_CLUSTER_STATUS_INVALID", - "KUBERNETES_CLUSTER_STATUS_OK", - "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" - ], - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Register": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "RegisterKubernetesCluster registers an existing Kubernetes cluster in PMM.", - "operationId": "RegisterKubernetesCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "kube_auth": { - "description": "KubeAuth represents Kubernetes / kubectl authentication and authorization information.", - "type": "object", - "properties": { - "kubeconfig": { - "description": "Kubeconfig file content.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 1 - }, - "aws_access_key_id": { - "description": "AWS access key id, only needed when registering EKS cluster and kubeconfig does not contain it.", - "type": "string", - "x-order": 2 - }, - "aws_secret_access_key": { - "description": "AWS secret access key, only needed when registering EKS cluster and kubeconfig does not contain it.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Resources/Get": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "GetResources returns all and available resources of a Kubernetes cluster.\nNOTE: The user defined in kubeconfig for the cluster has to have rights to\n list and get Pods from all Namespaces. Also getting and listing Nodes\n has to be allowed.", - "operationId": "GetResources", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "all": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 0 - }, - "available": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/Unregister": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "UnregisterKubernetesCluster removes a registered Kubernetes cluster from PMM.", - "operationId": "UnregisterKubernetesCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "force": { - "description": "If true then Kubernetes cluster will be deleted\neven if it contains database clusters.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBCluster/Create": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "CreatePSMDBCluster creates a new PSMDB cluster.", - "operationId": "CreatePSMDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "PSMDB cluster name.\na DNS-1035 label must consist of lower case alphanumeric characters or '-',\nstart with an alphabetic character, and end with an alphanumeric character\n(e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')", - "x-order": 1 - }, - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBCluster/Resources/Get": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "GetPSMDBClusterResources returns expected resources to be consumed by the cluster.", - "operationId": "GetPSMDBClusterResources", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "expected": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBCluster/Update": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "UpdatePSMDBCluster updates existing PSMDB cluster.", - "operationId": "UpdatePSMDBCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PSMDB cluster name.", - "type": "string", - "x-order": 1 - }, - "params": { - "description": "UpdatePSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "replicaset": { - "description": "ReplicaSet container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - } - }, - "x-order": 1 - }, - "suspend": { - "description": "Suspend cluster `pause: true`.", - "type": "boolean", - "x-order": 2 - }, - "resume": { - "description": "Resume cluster `pause: false`.", - "type": "boolean", - "x-order": 3 - }, - "image": { - "description": "PSMDB image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PSMDBClusters/GetCredentials": { - "post": { - "tags": [ - "PSMDBClusters" - ], - "summary": "GetPSMDBClusterCredentials returns a PSMDB cluster credentials by cluster name.", - "operationId": "GetPSMDBClusterCredentials", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PSMDB cluster name.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "connection_credentials": { - "description": "PSMDBCredentials is a credentials to connect to PSMDB.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "username": { - "description": "MongoDB username.", - "type": "string", - "x-order": 0 - }, - "password": { - "description": "MongoDB password.", - "type": "string", - "x-order": 1 - }, - "host": { - "description": "MongoDB host.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "MongoDB port.", - "type": "integer", - "format": "int32", - "x-order": 3 - }, - "replicaset": { - "description": "Replicaset name.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCCluster/Create": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "CreatePXCCluster creates a new PXC cluster.", - "operationId": "CreatePXCCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "type": "string", - "title": "PXC cluster name.\na DNS-1035 label must consist of lower case alphanumeric characters or '-',\nstart with an alphabetic character, and end with an alphanumeric character\n(e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')", - "x-order": 1 - }, - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for ProxySQL.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for HAProxy.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - } - }, - "x-order": 2 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCCluster/Resources/Get": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "GetPXCClusterResources returns expected resources to be consumed by the cluster.", - "operationId": "GetPXCClusterResources", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for ProxySQL.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - } - }, - "x-order": 2 - }, - "haproxy": { - "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", - "type": "object", - "properties": { - "image": { - "description": "Docker image used for HAProxy.", - "type": "string", - "x-order": 0 - }, - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 1 - } - }, - "x-order": 3 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "expected": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - }, - "cpu_m": { - "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", - "type": "string", - "format": "uint64", - "x-order": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "uint64", - "x-order": 2 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCCluster/Update": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "UpdatePXCCluster updates existing PXC cluster.", - "operationId": "UpdatePXCCluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PXC cluster name.", - "type": "string", - "x-order": 1 - }, - "params": { - "description": "UpdatePXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "pxc": { - "description": "PXC container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - }, - "image": { - "description": "Image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 1 - }, - "proxysql": { - "description": "ProxySQL container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - } - }, - "x-order": 2 - }, - "suspend": { - "description": "Suspend cluster `pause: true`.", - "type": "boolean", - "x-order": 3 - }, - "resume": { - "description": "Resume cluster `pause: false`.", - "type": "boolean", - "x-order": 4 - }, - "haproxy": { - "description": "HAProxy container parameters.", - "type": "object", - "properties": { - "compute_resources": { - "description": "ComputeResources represents container computer resources requests or limits.", - "type": "object", - "properties": { - "cpu_m": { - "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - } - }, - "x-order": 0 - } - }, - "x-order": 5 - } - }, - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/PXCClusters/GetCredentials": { - "post": { - "tags": [ - "PXCClusters" - ], - "summary": "GetPXCClusterCredentials returns a PXC cluster credentials by cluster name.", - "operationId": "GetPXCClusterCredentials", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "PXC cluster name.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "connection_credentials": { - "description": "PXCClusterConnectionCredentials is cluster connection credentials.", - "type": "object", - "properties": { - "username": { - "description": "PXC username.", - "type": "string", - "x-order": 0 - }, - "password": { - "description": "PXC password.", - "type": "string", - "x-order": 1 - }, - "host": { - "description": "PXC host.", - "type": "string", - "x-order": 2 - }, - "port": { - "description": "PXC port.", - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/External/Add": { - "post": { - "description": "Adds external service and adds external exporter. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds an \"external exporter\" agent to inventory, which is running on provided \"runs_on_node_id\".", - "tags": [ - "External" - ], - "summary": "Add External Service", - "operationId": "AddExternal", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "runs_on_node_id": { - "description": "Node identifier on which an external exporter is been running.\nruns_on_node_id always should 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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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 - }, - "node_id": { - "description": "Node identifier on which an external service is been running.\nnode_id always should 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.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 16 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 17 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/HAProxy/Add": { - "post": { - "description": "Adds HAProxy service and external exporter. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds an \"external exporter\" agent to the inventory.", - "tags": [ - "HAProxy" - ], - "summary": "Add HAProxy", - "operationId": "AddHAProxy", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 14 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 15 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/MongoDB/Add": { - "post": { - "description": "Adds MongoDB Service and starts several Agents. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds \"mongodb_exporter\", and \"qan_mongodb_profiler\" agents with the provided \"pmm_agent_id\" and other parameters.", - "tags": [ - "MongoDB" - ], - "summary": "Add MongoDB", - "operationId": "AddMongoDB", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 15 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 16 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 17 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 18 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 19 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 20 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 21 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 22 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 23 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 24 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 25 - }, - "stats_collections": { - "description": "List of collections to get stats from. Can use * .", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 26 - }, - "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": 27 - }, - "enable_all_collectors": { - "type": "boolean", - "title": "Enable all collectors", - "x-order": 28 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 2 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/MySQL/Add": { - "post": { - "description": "Adds MySQL Service and starts several Agents. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds \"mysqld_exporter\", and \"qan_mysql_perfschema\" agents with the provided \"pmm_agent_id\" and other parameters.", - "tags": [ - "MySQL" - ], - "summary": "Add MySQL", - "operationId": "AddMySQL", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 17 - }, - "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": 18 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 19 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 20 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 21 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 22 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "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 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 25 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 26 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 27 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 13 - } - }, - "x-order": 3 - }, - "table_count": { - "description": "Actual table count at the moment of adding.", - "type": "integer", - "format": "int32", - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Node/Register": { - "post": { - "description": "Registers a new Node and pmm-agent.", - "tags": [ - "Node" - ], - "summary": "Register 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "REMOTE_AZURE_DATABASE_NODE" - ], - "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 - }, - "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.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 12 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 13 - } - } - } - } - ], - "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 - } - }, - "x-order": 2 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/PostgreSQL/Add": { - "post": { - "description": "Adds PostgreSQL Service and starts postgres exporter. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds \"postgres_exporter\" with provided \"pmm_agent_id\" and other parameters.", - "tags": [ - "PostgreSQL" - ], - "summary": "Add PostgreSQL", - "operationId": "AddPostgreSQL", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 16 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 17 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 18 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 19 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 20 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 21 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 22 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 23 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 24 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 25 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 26 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 9 - } - }, - "x-order": 3 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ProxySQL/Add": { - "post": { - "description": "Adds ProxySQL Service and starts several Agents. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds \"proxysql_exporter\" with provided \"pmm_agent_id\" and other parameters.", - "tags": [ - "ProxySQL" - ], - "summary": "Add ProxySQL", - "operationId": "AddProxySQL", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/RDS/Add": { - "post": { - "description": "Adds RDS instance.", - "tags": [ - "RDS" - ], - "summary": "Add RDS", - "operationId": "AddRDS", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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_INVALID", - "enum": [ - "DISCOVER_RDS_ENGINE_INVALID", - "DISCOVER_RDS_MYSQL", - "DISCOVER_RDS_POSTGRESQL" - ], - "x-order": 6 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name. Defaults to AWS instance ID.", - "type": "string", - "x-order": 7 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Defaults to AWS instance ID.", - "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": "Username for scraping metrics.", - "type": "string", - "x-order": 12 - }, - "password": { - "description": "Password for scraping metrics.", - "type": "string", - "x-order": 13 - }, - "aws_access_key": { - "description": "AWS Access key.", - "type": "string", - "x-order": 14 - }, - "aws_secret_key": { - "description": "AWS Secret key.", - "type": "string", - "x-order": 15 - }, - "rds_exporter": { - "description": "If true, adds rds_exporter.", - "type": "boolean", - "x-order": 16 - }, - "qan_mysql_perfschema": { - "description": "If true, adds qan-mysql-perfschema-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 - }, - "disable_basic_metrics": { - "description": "Disable basic metrics.", - "type": "boolean", - "x-order": 24 - }, - "disable_enhanced_metrics": { - "description": "Disable enhanced metrics.", - "type": "boolean", - "x-order": 25 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 26 - }, - "qan_postgresql_pgstatements": { - "type": "boolean", - "title": "If true, add qan-pgstatements", - "x-order": 27 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 28 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "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 - } - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - }, - "x-order": 4 - }, - "table_count": { - "description": "Actual table count at the moment of adding.", - "type": "integer", - "format": "int32", - "x-order": 5 - }, - "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 - } - }, - "x-order": 6 - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 7 - }, - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 8 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/RDS/Discover": { - "post": { - "description": "Discovers RDS instances.", - "tags": [ - "RDS" - ], - "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_INVALID", - "enum": [ - "DISCOVER_RDS_ENGINE_INVALID", - "DISCOVER_RDS_MYSQL", - "DISCOVER_RDS_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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/Change": { - "post": { - "description": "Enables/disables Security Thread Tool checks or changes their interval by names.", - "tags": [ - "SecurityChecks" - ], - "summary": "Change Security Checks", - "operationId": "ChangeSecurityChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "type": "array", - "items": { - "description": "ChangeSecurityCheckParams 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-order": 1 - }, - "disable": { - "type": "boolean", - "x-order": 2 - }, - "interval": { - "description": "SecurityCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "SECURITY_CHECK_INTERVAL_INVALID", - "enum": [ - "SECURITY_CHECK_INTERVAL_INVALID", - "STANDARD", - "FREQUENT", - "RARE" - ], - "x-order": 3 - } - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/FailedChecks": { - "post": { - "description": "Returns the latest check results for a given service.", - "tags": [ - "SecurityChecks" - ], - "summary": "Get Failed Checks", - "operationId": "GetFailedChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "x-order": 0 - }, - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "results": { - "type": "array", - "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_INVALID", - "enum": [ - "SEVERITY_INVALID", - "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 STT 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 - }, - "alert_id": { - "type": "string", - "title": "ID of the check result as stored in AlertManager", - "x-order": 8 - }, - "silenced": { - "type": "boolean", - "title": "Silence status of the check result", - "x-order": 9 - } - } - }, - "x-order": 0 - }, - "page_totals": { - "description": "PageTotals represents total values for pagination.", - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/GetCheckResults": { - "post": { - "description": "Returns Security Thread Tool's latest checks results.", - "tags": [ - "SecurityChecks" - ], - "summary": "Get Security Check Results", - "operationId": "GetSecurityCheckResults", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "description": "SecurityCheckResult represents the check result returned from pmm-managed after running the check.", - "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_INVALID", - "enum": [ - "SEVERITY_INVALID", - "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 STT check.", - "type": "string", - "x-order": 4 - }, - "service_name": { - "description": "Name of the monitored service on which the check ran.", - "type": "string", - "x-order": 5 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/List": { - "post": { - "description": "Returns a list of available Security Thread Tool checks.", - "tags": [ - "SecurityChecks" - ], - "summary": "List Security Checks", - "operationId": "ListSecurityChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "checks": { - "type": "array", - "items": { - "description": "SecurityCheck contains check name and status.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "disabled": { - "description": "True if that check is disabled.", - "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": "SecurityCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "SECURITY_CHECK_INTERVAL_INVALID", - "enum": [ - "SECURITY_CHECK_INTERVAL_INVALID", - "STANDARD", - "FREQUENT", - "RARE" - ], - "x-order": 4 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/ListFailedServices": { - "post": { - "description": "Returns a list of services with failed checks and a summary of check results.", - "tags": [ - "SecurityChecks" - ], - "summary": "List Failed Services", - "operationId": "ListFailedServices", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/Start": { - "post": { - "description": "Executes Security Thread Tool checks and returns when all checks are executed. All available checks will be started if check names aren't specified.", - "tags": [ - "SecurityChecks" - ], - "summary": "Start Security Checks", - "operationId": "StartSecurityChecks", - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/ToggleCheckAlert": { - "post": { - "description": "Silence/Unsilence alerts for a specific check result.", - "tags": [ - "SecurityChecks" - ], - "summary": "Toggle Check Alert", - "operationId": "ToggleCheckAlert", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "alert_id": { - "description": "Alert ID of the check result.", - "type": "string", - "x-order": 0 - }, - "silence": { - "description": "Silence the check result if set to true, unsilence otherwise.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Service/Remove": { - "post": { - "description": "Removes Service with Agents.", - "tags": [ - "Service" - ], - "summary": "Remove Service", - "operationId": "RemoveServiceMixin2", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_type": { - "description": "ServiceType describes supported Service types.", - "type": "string", - "default": "SERVICE_TYPE_INVALID", - "enum": [ - "SERVICE_TYPE_INVALID", - "MYSQL_SERVICE", - "MONGODB_SERVICE", - "POSTGRESQL_SERVICE", - "PROXYSQL_SERVICE", - "HAPROXY_SERVICE", - "EXTERNAL_SERVICE" - ], - "x-order": 0 - }, - "service_id": { - "description": "Service ID or Service Name is required.\nUnique randomly generated instance identifier.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Unique across all Services user-defined name.", - "type": "string", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/azure/AzureDatabase/Add": { - "post": { - "tags": [ - "AzureDatabase" - ], - "summary": "AddAzureDatabase adds Azure Database instance.", - "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_INVALID", - "enum": [ - "DISCOVER_AZURE_DATABASE_TYPE_INVALID", - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/azure/AzureDatabase/Discover": { - "post": { - "tags": [ - "AzureDatabase" - ], - "summary": "DiscoverAzureDatabase discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.", - "operationId": "DiscoverAzureDatabase", - "parameters": [ - { - "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_INVALID", - "enum": [ - "DISCOVER_AZURE_DATABASE_TYPE_INVALID", - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Artifacts/Delete": { - "post": { - "tags": [ - "Artifacts" - ], - "summary": "DeleteArtifact deletes specified artifact.", - "operationId": "DeleteArtifact", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Machine-readable artifact ID.", - "type": "string", - "x-order": 0 - }, - "remove_files": { - "description": "Removes all the backup files associated with artifact if flag is set.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Artifacts/List": { - "post": { - "tags": [ - "Artifacts" - ], - "summary": "ListArtifacts returns a list of all backup artifacts.", - "operationId": "ListArtifacts", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 7 - }, - "status": { - "description": "BackupStatus shows the current status of execution of backup.", - "type": "string", - "default": "BACKUP_STATUS_INVALID", - "enum": [ - "BACKUP_STATUS_INVALID", - "BACKUP_STATUS_PENDING", - "BACKUP_STATUS_IN_PROGRESS", - "BACKUP_STATUS_PAUSED", - "BACKUP_STATUS_SUCCESS", - "BACKUP_STATUS_ERROR", - "BACKUP_STATUS_DELETING", - "BACKUP_STATUS_FAILED_TO_DELETE" - ], - "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_INVALID", - "enum": [ - "BACKUP_MODE_INVALID", - "SNAPSHOT", - "INCREMENTAL", - "PITR" - ], - "x-order": 10 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/ChangeScheduled": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ChangeScheduledBackup changes existing 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-order": 1 - }, - "cron_expression": { - "description": "How often backup should be run in cron format.", - "type": "string", - "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-order": 4 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 5 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 6 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/GetLogs": { - "post": { - "tags": [ - "Backups" - ], - "summary": "GetLogs returns logs for provided artifact.", - "operationId": "GetLogsMixin5", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "type": "string", - "x-order": 0 - }, - "offset": { - "type": "integer", - "format": "int64", - "x-order": 1 - }, - "limit": { - "type": "integer", - "format": "int64", - "x-order": 2 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/ListArtifactCompatibleServices": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ListArtifactCompatibleServices lists compatible services for restoring a backup.", - "operationId": "ListArtifactCompatibleServices", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "artifact_id": { - "description": "Artifact id used to determine restore compatibility.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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 - } - } - }, - "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 - } - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/ListScheduled": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ListScheduledBackups returns all scheduled backups.", - "operationId": "ListScheduledBackups", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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 - }, - "cron_expression": { - "description": "How often backup will be run in cron format.", - "type": "string", - "x-order": 5 - }, - "start_time": { - "description": "First backup wouldn't happen before this time.", - "type": "string", - "format": "date-time", - "x-order": 6 - }, - "name": { - "description": "Artifact name.", - "type": "string", - "x-order": 7 - }, - "description": { - "description": "Description.", - "type": "string", - "x-order": 8 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 9 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 10 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 11 - }, - "data_model": { - "description": "DataModel is a model used for performing a backup.", - "type": "string", - "default": "DATA_MODEL_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 12 - }, - "vendor": { - "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", - "type": "string", - "x-order": 13 - }, - "last_run": { - "description": "Last run.", - "type": "string", - "format": "date-time", - "x-order": 14 - }, - "next_run": { - "description": "Next run.", - "type": "string", - "format": "date-time", - "x-order": 15 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 16 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_INVALID", - "enum": [ - "BACKUP_MODE_INVALID", - "SNAPSHOT", - "INCREMENTAL", - "PITR" - ], - "x-order": 17 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/RemoveScheduled": { - "post": { - "tags": [ - "Backups" - ], - "summary": "RemoveScheduledBackup removes existing scheduled backup.", - "operationId": "RemoveScheduledBackup", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "scheduled_backup_id": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/Restore": { - "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": [ - "Backups" - ], - "summary": "RestoreBackup requests the backup restore.", - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Backups/Schedule": { - "post": { - "tags": [ - "Backups" - ], - "summary": "ScheduleBackup schedules repeated 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 - }, - "cron_expression": { - "description": "How often backup should be run in cron format.", - "type": "string", - "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-order": 4 - }, - "description": { - "description": "Human-readable description.", - "type": "string", - "x-order": 5 - }, - "retry_interval": { - "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", - "type": "string", - "x-order": 6 - }, - "retries": { - "description": "How many times to retry a failed backup before giving up.", - "type": "integer", - "format": "int64", - "x-order": 7 - }, - "enabled": { - "description": "If scheduling is enabled.", - "type": "boolean", - "x-order": 8 - }, - "retention": { - "description": "How many artifacts keep. 0 - unlimited.", - "type": "integer", - "format": "int64", - "x-order": 9 - }, - "mode": { - "description": "BackupMode specifies backup mode.", - "type": "string", - "default": "BACKUP_MODE_INVALID", - "enum": [ - "BACKUP_MODE_INVALID", - "SNAPSHOT", - "INCREMENTAL", - "PITR" - ], - "x-order": 10 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/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": [ - "Backups" - ], - "summary": "StartBackup request backup specified service to location.", - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/Add": { - "post": { - "tags": [ - "Locations" - ], - "summary": "AddLocation adds 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 - }, - "pmm_client_config": { - "description": "PMMClientLocationConfig represents file system config inside pmm-client.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 2 - }, - "pmm_server_config": { - "description": "PMMServerLocationConfig represents file system config inside pmm-server.", - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/Change": { - "post": { - "tags": [ - "Locations" - ], - "summary": "ChangeLocation changes backup location.", - "operationId": "ChangeLocation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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", - "x-order": 2 - }, - "pmm_client_config": { - "description": "PMMClientLocationConfig represents file system config inside pmm-client.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 3 - }, - "pmm_server_config": { - "description": "PMMServerLocationConfig represents file system config inside pmm-server.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 4 - }, - "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": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/List": { - "post": { - "tags": [ - "Locations" - ], - "summary": "ListLocations returns a list of all backup locations.", - "operationId": "ListLocations", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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 - }, - "pmm_client_config": { - "description": "PMMClientLocationConfig represents file system config inside pmm-client.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 3 - }, - "pmm_server_config": { - "description": "PMMServerLocationConfig represents file system config inside pmm-server.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 4 - }, - "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": 5 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/Remove": { - "post": { - "tags": [ - "Locations" - ], - "summary": "RemoveLocation removes existing backup location.", - "operationId": "RemoveLocation", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "location_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "force": { - "type": "boolean", - "title": "Force mode", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/Locations/TestConfig": { - "post": { - "tags": [ - "Locations" - ], - "summary": "TestLocationConfig tests backup location and credentials.", - "operationId": "TestLocationConfig", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "pmm_client_config": { - "description": "PMMClientLocationConfig represents file system config inside pmm-client.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - }, - "pmm_server_config": { - "description": "PMMServerLocationConfig represents file system config inside pmm-server.", - "type": "object", - "properties": { - "path": { - "type": "string", - "x-order": 0 - } - }, - "x-order": 1 - }, - "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": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/backup/RestoreHistory/List": { - "post": { - "tags": [ - "RestoreHistory" - ], - "summary": "ListRestoreHistory returns a list of all backup restore history items.", - "operationId": "ListRestoreHistory", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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_INVALID", - "enum": [ - "DATA_MODEL_INVALID", - "PHYSICAL", - "LOGICAL" - ], - "x-order": 8 - }, - "status": { - "description": "RestoreStatus shows the current status of execution of restore.", - "type": "string", - "default": "RESTORE_STATUS_INVALID", - "enum": [ - "RESTORE_STATUS_INVALID", - "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 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Alerts/List": { - "post": { - "tags": [ - "Alerts" - ], - "summary": "ListAlerts returns a list of all Alerts.", - "operationId": "ListAlerts", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "alerts": { - "type": "array", - "items": { - "description": "Alert represents Alert.", - "type": "object", - "properties": { - "alert_id": { - "description": "ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Human-readable summary.", - "type": "string", - "x-order": 1 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 2 - }, - "status": { - "description": "Status represents Alert Rule's and Alert's combined status.\n\n - CLEAR: No alert.\n - PENDING: Pending, but not triggering alert.\n - TRIGGERING: Triggering (firing) alert.\n - SILENCED: Silenced alert.", - "type": "string", - "default": "STATUS_INVALID", - "enum": [ - "STATUS_INVALID", - "CLEAR", - "PENDING", - "TRIGGERING", - "SILENCED" - ], - "x-order": 3 - }, - "labels": { - "description": "Combined labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 4 - }, - "rule": { - "description": "Rule represents Alert Rule.", - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Rule human-readable summary.", - "type": "string", - "x-order": 2 - }, - "template_name": { - "description": "Template used for this rule.", - "type": "string", - "x-order": 3 - }, - "disabled": { - "description": "True if that rule is disabled.", - "type": "boolean", - "x-order": 4 - }, - "expr_template": { - "description": "Expression template.", - "type": "string", - "x-order": 5 - }, - "expr": { - "description": "Expression filled with parameters.", - "type": "string", - "x-order": 6 - }, - "params_definitions": { - "description": "Expression 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_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - }, - "x-order": 7 - }, - "params_values": { - "description": "Expression parameters values.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "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_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "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": 8 - }, - "default_for": { - "description": "Default for duration.", - "type": "string", - "x-order": 9 - }, - "for": { - "description": "For duration.", - "type": "string", - "x-order": 10 - }, - "default_severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 11 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 12 - }, - "custom_labels": { - "description": "Custom labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "channels": { - "description": "Channels.", - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 17 - }, - "created_at": { - "description": "Rule creation time.", - "type": "string", - "format": "date-time", - "x-order": 18 - } - }, - "x-order": 5 - }, - "created_at": { - "description": "Alert creation time.", - "type": "string", - "format": "date-time", - "x-order": 6 - }, - "updated_at": { - "description": "Alert last update time.", - "type": "string", - "format": "date-time", - "x-order": 7 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Alerts/Toggle": { - "post": { - "description": "Pass empty list to apply toggle action to all existing alerts", - "tags": [ - "Alerts" - ], - "summary": "ToggleAlerts allows to switch alerts state between silenced and unsilenced.", - "operationId": "ToggleAlerts", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "alert_ids": { - "description": "List of alerts that silence state should be switched. If provided array is empty than all\nexisting alerts are switched.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - }, - "silenced": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Add": { - "post": { - "tags": [ - "Channels" - ], - "summary": "AddChannel adds notification channel.", - "operationId": "AddChannel", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 0 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 1 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 2 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 3 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 4 - }, - "disabled": { - "description": "New channel status.", - "type": "boolean", - "x-order": 5 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Change": { - "post": { - "tags": [ - "Channels" - ], - "summary": "ChangeChannel changes notification channel.", - "operationId": "ChangeChannel", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary. Empty value will not change it.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "Enables or disables that channel. Should be set.", - "type": "boolean", - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/List": { - "post": { - "tags": [ - "Channels" - ], - "summary": "ListChannels returns a list of all notifation channels.", - "operationId": "ListChannels", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "channels": { - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Channels/Remove": { - "post": { - "tags": [ - "Channels" - ], - "summary": "RemoveChannel removes notification channel.", - "operationId": "RemoveChannel", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "channel_id": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Create": { - "post": { - "tags": [ - "Rules" - ], - "summary": "CreateAlertRule creates Alerting rule.", - "operationId": "CreateAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "template_name": { - "description": "Template name. Can't be specified simultaneously with source_rule_id.", - "type": "string", - "x-order": 0 - }, - "source_rule_id": { - "description": "ID of the rule that will be used as source. Can't be specified simultaneously with template_name.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 2 - }, - "disabled": { - "description": "New rule status.", - "type": "boolean", - "x-order": 3 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "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_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "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_INVALID", - "enum": [ - "SEVERITY_INVALID", - "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. Should be set.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 8 - }, - "channel_ids": { - "description": "Channels. Should be set.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 9 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Delete": { - "post": { - "tags": [ - "Rules" - ], - "summary": "DeleteAlertRule deletes Alerting rule.", - "operationId": "DeleteAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/List": { - "post": { - "tags": [ - "Rules" - ], - "summary": "ListAlertRules returns a list of all Alerting rules.", - "operationId": "ListAlertRules", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "rules": { - "type": "array", - "items": { - "description": "Rule represents Alert Rule.", - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name.", - "type": "string", - "x-order": 1 - }, - "summary": { - "description": "Rule human-readable summary.", - "type": "string", - "x-order": 2 - }, - "template_name": { - "description": "Template used for this rule.", - "type": "string", - "x-order": 3 - }, - "disabled": { - "description": "True if that rule is disabled.", - "type": "boolean", - "x-order": 4 - }, - "expr_template": { - "description": "Expression template.", - "type": "string", - "x-order": 5 - }, - "expr": { - "description": "Expression filled with parameters.", - "type": "string", - "x-order": 6 - }, - "params_definitions": { - "description": "Expression 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_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - }, - "x-order": 7 - }, - "params_values": { - "description": "Expression parameters values.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "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_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "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": 8 - }, - "default_for": { - "description": "Default for duration.", - "type": "string", - "x-order": 9 - }, - "for": { - "description": "For duration.", - "type": "string", - "x-order": 10 - }, - "default_severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 11 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 12 - }, - "custom_labels": { - "description": "Custom labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 13 - }, - "labels": { - "description": "Labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "annotations": { - "description": "Annotations.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 15 - }, - "filters": { - "description": "Filters.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 16 - }, - "channels": { - "description": "Channels.", - "type": "array", - "items": { - "description": "Channel represents a single Notification Channel.", - "type": "object", - "properties": { - "channel_id": { - "description": "Machine-readable ID.", - "type": "string", - "x-order": 0 - }, - "summary": { - "description": "Short human-readable summary.", - "type": "string", - "x-order": 1 - }, - "email_config": { - "description": "EmailConfig represents email configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "to": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "pagerduty_config": { - "description": "PagerDutyConfig represents PagerDuty configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "routing_key": { - "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 1 - }, - "service_key": { - "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 3 - }, - "slack_config": { - "description": "SlackConfig represents Slack configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "channel": { - "type": "string", - "x-order": 1 - } - }, - "x-order": 4 - }, - "webhook_config": { - "description": "WebhookConfig represents webhook configuration.", - "type": "object", - "properties": { - "send_resolved": { - "type": "boolean", - "x-order": 0 - }, - "url": { - "type": "string", - "x-order": 1 - }, - "http_config": { - "description": "HTTPConfig represents HTTP client configuration.", - "type": "object", - "properties": { - "basic_auth": { - "description": "BasicAuth represents basic HTTP auth configuration.", - "type": "object", - "properties": { - "username": { - "type": "string", - "x-order": 0 - }, - "password": { - "type": "string", - "x-order": 1 - }, - "password_file": { - "type": "string", - "x-order": 2 - } - }, - "x-order": 0 - }, - "bearer_token": { - "type": "string", - "x-order": 1 - }, - "bearer_token_file": { - "type": "string", - "x-order": 2 - }, - "tls_config": { - "type": "object", - "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", - "properties": { - "ca_file": { - "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 0 - }, - "cert_file": { - "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 1 - }, - "key_file": { - "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 2 - }, - "server_name": { - "description": "Name of the server.", - "type": "string", - "x-order": 3 - }, - "insecure_skip_verify": { - "description": "Disable validation of the server certificate.", - "type": "boolean", - "x-order": 4 - }, - "ca_file_content": { - "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", - "type": "string", - "x-order": 5 - }, - "cert_file_content": { - "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", - "type": "string", - "x-order": 6 - }, - "key_file_content": { - "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", - "type": "string", - "x-order": 7 - } - }, - "x-order": 3 - }, - "proxy_url": { - "type": "string", - "x-order": 4 - } - }, - "x-order": 2 - }, - "max_alerts": { - "type": "integer", - "format": "int32", - "x-order": 3 - } - }, - "x-order": 5 - }, - "disabled": { - "description": "True if that channel is disabled.", - "type": "boolean", - "x-order": 6 - } - } - }, - "x-order": 17 - }, - "created_at": { - "description": "Rule creation time.", - "type": "string", - "format": "date-time", - "x-order": 18 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Toggle": { - "post": { - "tags": [ - "Rules" - ], - "summary": "ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule.", - "operationId": "ToggleAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "disabled": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Rules/Update": { - "post": { - "tags": [ - "Rules" - ], - "summary": "UpdateAlertRule updates Alerting rule.", - "operationId": "UpdateAlertRule", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "rule_id": { - "description": "Rule ID.", - "type": "string", - "x-order": 0 - }, - "name": { - "description": "Rule name. Should be set.", - "type": "string", - "x-order": 1 - }, - "disabled": { - "description": "New rule status. Should be set.", - "type": "boolean", - "x-order": 2 - }, - "params": { - "description": "Rule parameters. All template parameters should be set.", - "type": "array", - "items": { - "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", - "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_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "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": 3 - }, - "for": { - "description": "Rule duration. Should be set.", - "type": "string", - "x-order": 4 - }, - "severity": { - "description": "Severity represents severity level of the check result or alert.", - "type": "string", - "default": "SEVERITY_INVALID", - "enum": [ - "SEVERITY_INVALID", - "SEVERITY_EMERGENCY", - "SEVERITY_ALERT", - "SEVERITY_CRITICAL", - "SEVERITY_ERROR", - "SEVERITY_WARNING", - "SEVERITY_NOTICE", - "SEVERITY_INFO", - "SEVERITY_DEBUG" - ], - "x-order": 5 - }, - "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": 6 - }, - "filters": { - "description": "Filters. Should be set.", - "type": "array", - "items": { - "description": "Filter repsents a single filter condition.", - "type": "object", - "properties": { - "type": { - "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", - "type": "string", - "default": "FILTER_TYPE_INVALID", - "enum": [ - "FILTER_TYPE_INVALID", - "EQUAL", - "REGEX" - ], - "x-order": 0 - }, - "key": { - "type": "string", - "x-order": 1 - }, - "value": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 7 - }, - "channel_ids": { - "description": "Channels. Should be set.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 8 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Templates/Create": { - "post": { - "tags": [ - "Templates" - ], - "summary": "CreateTemplate creates a new template.", - "operationId": "CreateTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "yaml": { - "description": "YAML (or JSON) 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Templates/Delete": { - "post": { - "tags": [ - "Templates" - ], - "summary": "DeleteTemplate deletes existing, previously created via API.", - "operationId": "DeleteTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Templates/List": { - "post": { - "tags": [ - "Templates" - ], - "summary": "ListTemplates returns a list of all collected Alert Rule Templates.", - "operationId": "ListTemplates", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "reload": { - "description": "If true, template files will be re-read from disk.", - "type": "boolean", - "x-order": 0 - }, - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", - "type": "string", - "default": "PARAM_UNIT_INVALID", - "enum": [ - "PARAM_UNIT_INVALID", - "PERCENTAGE", - "SECONDS" - ], - "x-order": 2 - }, - "type": { - "description": "ParamType represents template parameter type.", - "type": "string", - "default": "PARAM_TYPE_INVALID", - "enum": [ - "PARAM_TYPE_INVALID", - "BOOL", - "FLOAT", - "STRING" - ], - "x-order": 3 - }, - "bool": { - "description": "BoolParamDefinition represents boolean parameter's default value.", - "type": "object", - "properties": { - "default": { - "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", - "type": "string", - "default": "DO_NOT_CHANGE", - "enum": [ - "DO_NOT_CHANGE", - "TRUE", - "FALSE" - ], - "x-order": 0 - } - }, - "x-order": 4 - }, - "float": { - "description": "FloatParamDefinition represents float parameter's default value and valid range.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "number", - "format": "double", - "x-order": 1 - }, - "has_min": { - "description": "True if minimal valid value is set.", - "type": "boolean", - "x-order": 2 - }, - "min": { - "description": "Minimal valid value (inclusive) if has_min is true.", - "type": "number", - "format": "double", - "x-order": 3 - }, - "has_max": { - "description": "True if maximal valid value is set.", - "type": "boolean", - "x-order": 4 - }, - "max": { - "description": "Maximal valid value (inclusive) if has_max is true.", - "type": "number", - "format": "double", - "x-order": 5 - } - }, - "x-order": 5 - }, - "string": { - "description": "StringParamDefinition represents string parameter's default value.", - "type": "object", - "properties": { - "has_default": { - "description": "True if default value is set.", - "type": "boolean", - "x-order": 0 - }, - "default": { - "description": "Default value if has_default is true.", - "type": "string", - "x-order": 1 - } - }, - "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_INVALID", - "enum": [ - "SEVERITY_INVALID", - "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 - BUILT_IN: Template that is shipped with PMM Server releases.\n - SAAS: Template that is downloaded from check.percona.com.\n - USER_FILE: Templated loaded from user-suplied file.\n - USER_API: Templated created via API.", - "type": "string", - "default": "TEMPLATE_SOURCE_INVALID", - "enum": [ - "TEMPLATE_SOURCE_INVALID", - "BUILT_IN", - "SAAS", - "USER_FILE", - "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 (or JSON) template file content. Empty for built-in and SaaS templates.", - "type": "string", - "x-order": 10 - } - } - }, - "x-order": 0 - }, - "totals": { - "description": "PageTotals represents total values for pagination.", - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ia/Templates/Update": { - "post": { - "tags": [ - "Templates" - ], - "summary": "UpdateTemplate updates existing template, previously created via API.", - "operationId": "UpdateTemplate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID).", - "type": "string", - "x-order": 0 - }, - "yaml": { - "description": "YAML (or JSON) template file content.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/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": [ - "Server" - ], - "summary": "Check server readiness", - "operationId": "Readiness", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/version": { - "get": { - "description": "Returns PMM Server versions.", - "tags": [ - "Server" - ], - "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_INVALID", - "enum": [ - "DISTRIBUTION_METHOD_INVALID", - "DOCKER", - "OVF", - "AMI", - "AZURE", - "DO" - ], - "x-order": 3 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - } - }, - "securityDefinitions": { - "basicAuth": { - "type": "basic" - } - }, - "security": [ - { - "basicAuth": [] - } - ], - "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 48a2174995..0000000000 --- a/api/swagger/swagger.json +++ /dev/null @@ -1,19505 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM API", - "version": "public" - }, - "paths": { - "/logs.zip": { - "get": { - "description": "Returns the PMM Server logs.", - "produces": [ - "application/zip" - ], - "tags": [ - "Server" - ], - "summary": "Logs", - "operationId": "Logs", - "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/AWSInstanceCheck": { - "post": { - "description": "Checks AWS EC2 instance ID.", - "tags": [ - "Server" - ], - "summary": "AWS instance check", - "operationId": "AWSInstanceCheck", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "instance_id": { - "description": "AWS EC2 instance ID (i-1234567890abcdef0).", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Settings/Change": { - "post": { - "description": "Changes PMM Server settings.", - "tags": [ - "Server" - ], - "summary": "Change settings", - "operationId": "ChangeSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "enable_updates": { - "type": "boolean", - "x-order": 0 - }, - "disable_updates": { - "type": "boolean", - "x-order": 1 - }, - "enable_telemetry": { - "type": "boolean", - "x-order": 2 - }, - "disable_telemetry": { - "type": "boolean", - "x-order": 3 - }, - "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": 4 - }, - "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": 5 - }, - "ssh_key": { - "type": "string", - "x-order": 6 - }, - "aws_partitions": { - "type": "array", - "items": { - "type": "string" - }, - "x-order": 7 - }, - "alert_manager_url": { - "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", - "type": "string", - "x-order": 8 - }, - "remove_alert_manager_url": { - "description": "Remove external AlertManager URL.", - "type": "boolean", - "x-order": 9 - }, - "alert_manager_rules": { - "description": "Custom alerting or recording rules.", - "type": "string", - "x-order": 10 - }, - "remove_alert_manager_rules": { - "description": "Remove custom alerting or recording rules.", - "type": "boolean", - "x-order": 11 - }, - "enable_stt": { - "description": "Enable Security Threat Tool.", - "type": "boolean", - "x-order": 12 - }, - "disable_stt": { - "description": "Disable Security Threat Tool.", - "type": "boolean", - "x-order": 13 - }, - "enable_alerting": { - "description": "Enable Alerting.", - "type": "boolean", - "x-order": 14 - }, - "disable_alerting": { - "description": "Disable Alerting.", - "type": "boolean", - "x-order": 15 - }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 16 - }, - "remove_email_alerting_settings": { - "description": "If true, removes Alerting email (SMTP) settings.", - "type": "boolean", - "x-order": 17 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 18 - }, - "remove_slack_alerting_settings": { - "description": "If true, removes Alerting Slack settings.", - "type": "boolean", - "x-order": 19 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 20 - }, - "remove_pmm_public_address": { - "type": "boolean", - "x-order": 21 - }, - "stt_check_intervals": { - "description": "STTCheckIntervals represents intervals between STT 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": 22 - }, - "enable_azurediscover": { - "description": "Enable Azure Discover.", - "type": "boolean", - "x-order": 23 - }, - "disable_azurediscover": { - "description": "Disable Azure Discover.", - "type": "boolean", - "x-order": 24 - }, - "enable_backup_management": { - "description": "Enable Backup Management.", - "type": "boolean", - "x-order": 25 - }, - "disable_backup_management": { - "description": "Disable Backup Management.", - "type": "boolean", - "x-order": 26 - }, - "enable_dbaas": { - "description": "Enable DBaaS.", - "type": "boolean", - "x-order": 27 - }, - "disable_dbaas": { - "description": "Disable DBaaS.", - "type": "boolean", - "x-order": 28 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "Settings represents PMM Server settings.", - "type": "object", - "properties": { - "updates_disabled": { - "description": "True if updates are disabled.", - "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 - }, - "alert_manager_url": { - "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", - "type": "string", - "x-order": 6 - }, - "alert_manager_rules": { - "description": "Custom alerting or recording rules.", - "type": "string", - "x-order": 7 - }, - "stt_enabled": { - "description": "True if Security Threat Tool is enabled.", - "type": "boolean", - "x-order": 8 - }, - "platform_email": { - "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", - "type": "string", - "x-order": 9 - }, - "dbaas_enabled": { - "description": "True if DBaaS is enabled.", - "type": "boolean", - "x-order": 10 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 11 - }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 12 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 13 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 14 - }, - "stt_check_intervals": { - "description": "STTCheckIntervals represents intervals between STT 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": 15 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 16 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 17 - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform", - "x-order": 18 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Settings/Get": { - "post": { - "description": "Returns current PMM Server settings.", - "tags": [ - "Server" - ], - "summary": "Get settings", - "operationId": "GetSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "settings": { - "description": "Settings represents PMM Server settings.", - "type": "object", - "properties": { - "updates_disabled": { - "description": "True if updates are disabled.", - "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 - }, - "alert_manager_url": { - "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", - "type": "string", - "x-order": 6 - }, - "alert_manager_rules": { - "description": "Custom alerting or recording rules.", - "type": "string", - "x-order": 7 - }, - "stt_enabled": { - "description": "True if Security Threat Tool is enabled.", - "type": "boolean", - "x-order": 8 - }, - "platform_email": { - "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", - "type": "string", - "x-order": 9 - }, - "dbaas_enabled": { - "description": "True if DBaaS is enabled.", - "type": "boolean", - "x-order": 10 - }, - "alerting_enabled": { - "description": "True if Alerting is enabled.", - "type": "boolean", - "x-order": 11 - }, - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 12 - }, - "slack_alerting_settings": { - "description": "SlackAlertingSettings represents Slack configuration for Alerting.", - "type": "object", - "properties": { - "url": { - "description": "Slack API (webhook) URL.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 13 - }, - "pmm_public_address": { - "description": "PMM Server public address.", - "type": "string", - "x-order": 14 - }, - "stt_check_intervals": { - "description": "STTCheckIntervals represents intervals between STT 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": 15 - }, - "backup_management_enabled": { - "description": "True if Backup Management is enabled.", - "type": "boolean", - "x-order": 16 - }, - "azurediscover_enabled": { - "description": "True if Azure Discover is enabled.", - "type": "boolean", - "x-order": 17 - }, - "connected_to_platform": { - "type": "boolean", - "title": "True if the PMM instance is connected to Platform", - "x-order": 18 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Settings/TestEmailAlertingSettings": { - "post": { - "description": "Sends test email to check current SMTP settings for email alerting.", - "tags": [ - "Server" - ], - "summary": "Test email alerting", - "operationId": "TestEmailAlertingSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "email_alerting_settings": { - "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", - "type": "object", - "properties": { - "from": { - "description": "SMTP From header field.", - "type": "string", - "x-order": 0 - }, - "smarthost": { - "description": "SMTP host and port.", - "type": "string", - "x-order": 1 - }, - "hello": { - "description": "Hostname to identify to the SMTP server.", - "type": "string", - "x-order": 2 - }, - "username": { - "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", - "type": "string", - "x-order": 3 - }, - "password": { - "description": "Auth using LOGIN and PLAIN.", - "type": "string", - "x-order": 4 - }, - "identity": { - "description": "Auth using PLAIN.", - "type": "string", - "x-order": 5 - }, - "secret": { - "description": "Auth using CRAM-MD5.", - "type": "string", - "x-order": 6 - }, - "require_tls": { - "description": "Require TLS.", - "type": "boolean", - "x-order": 7 - } - }, - "x-order": 0 - }, - "email_to": { - "description": "Target email address to send the email to.", - "type": "string", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Updates/Check": { - "post": { - "description": "Checks for available PMM Server updates.", - "tags": [ - "Server" - ], - "summary": "Check updates", - "operationId": "CheckUpdates", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "force": { - "description": "If false, cached information may be returned.", - "type": "boolean", - "x-order": 0 - }, - "only_installed_version": { - "description": "If true, only installed version will be in response.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "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": { - "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 - }, - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Updates/Start": { - "post": { - "description": "Starts PMM Server update.", - "tags": [ - "Server" - ], - "summary": "Start update", - "operationId": "StartUpdate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/Updates/Status": { - "post": { - "description": "Returns PMM Server update status.", - "tags": [ - "Server" - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddAzureDatabaseExporter": { - "post": { - "description": "Adds azure_database_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add Azure Database Exporter", - "operationId": "AddAzureDatabaseExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddExternalExporter": { - "post": { - "description": "Adds external_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add External Exporter", - "operationId": "AddExternalExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddMongoDBExporter": { - "post": { - "description": "Adds mongodb_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add MongoDB Exporter", - "operationId": "AddMongoDBExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddMySQLdExporter": { - "post": { - "description": "Adds mysqld_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add mysqld Exporter", - "operationId": "AddMySQLdExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - }, - "x-order": 0 - }, - "table_count": { - "description": "Actual table count at the moment of adding.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddNodeExporter": { - "post": { - "description": "Adds node_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add Node Exporter", - "operationId": "AddNodeExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 6 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 7 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddPMMAgent": { - "post": { - "description": "Adds PMM Agent.", - "tags": [ - "Agents" - ], - "summary": "Add PMM Agent", - "operationId": "AddPMMAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddPostgresExporter": { - "post": { - "description": "Adds postgres_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add Postgres Exporter", - "operationId": "AddPostgresExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddProxySQLExporter": { - "post": { - "description": "Adds proxysql_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add ProxySQL Exporter", - "operationId": "AddProxySQLExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddQANMongoDBProfilerAgent": { - "post": { - "description": "Adds 'Query Analytics MongoDB Profiler' Agent.", - "tags": [ - "Agents" - ], - "summary": "Add 'QAN MongoDB Profiler' Agent", - "operationId": "AddQANMongoDBProfilerAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - }, - "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 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 11 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 12 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddQANMySQLPerfSchemaAgent": { - "post": { - "description": "Adds 'Query Analytics MySQL PerfSchema' Agent.", - "tags": [ - "Agents" - ], - "summary": "Add 'QAN MySQL PerfSchema' Agent", - "operationId": "AddQANMySQLPerfSchemaAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddQANMySQLSlowlogAgent": { - "post": { - "description": "Adds 'Query Analytics MySQL Slowlog' Agent.", - "tags": [ - "Agents" - ], - "summary": "Add 'QAN MySQL Slowlog' Agent", - "operationId": "AddQANMySQLSlowlogAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 9 - }, - "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": 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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 13 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddQANPostgreSQLPgStatMonitorAgent": { - "post": { - "description": "Adds 'Query Analytics PostgreSQL pg_stat_monitor' Agent.", - "tags": [ - "Agents" - ], - "summary": "Add 'QAN PostgreSQL pg_stat_monitor' Agent", - "operationId": "AddQANPostgreSQLPgStatMonitorAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 6 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 8 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 9 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 10 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 11 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 9 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddQANPostgreSQLPgStatementsAgent": { - "post": { - "description": "Adds 'Query Analytics PostgreSQL pg_stat_statements' Agent.", - "tags": [ - "Agents" - ], - "summary": "Add 'QAN PostgreSQL pg_stat_statements' Agent", - "operationId": "AddQANPostgreSQLPgStatementsAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 8 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 9 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 10 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/AddRDSExporter": { - "post": { - "description": "Adds rds_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Add RDS Exporter", - "operationId": "AddRDSExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeAzureDatabaseExporter": { - "post": { - "description": "Changes azure_database_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change Azure Database Exporter", - "operationId": "ChangeAzureDatabaseExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeExternalExporter": { - "post": { - "description": "Changes external_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change External Exporter", - "operationId": "ChangeExternalExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeMongoDBExporter": { - "post": { - "description": "Changes mongodb_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change MongoDB Exporter", - "operationId": "ChangeMongoDBExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeMySQLdExporter": { - "post": { - "description": "Changes mysqld_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change mysqld Exporter", - "operationId": "ChangeMySQLdExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeNodeExporter": { - "post": { - "description": "Changes node_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change Node Exporter", - "operationId": "ChangeNodeExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 6 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 7 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangePostgresExporter": { - "post": { - "description": "Changes postgres_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change Postgres Exporter", - "operationId": "ChangePostgresExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeProxySQLExporter": { - "post": { - "description": "Changes proxysql_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change ProxySQL Exporter", - "operationId": "ChangeProxySQLExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeQANMongoDBProfilerAgent": { - "post": { - "description": "Changes 'Query Analytics MongoDB Profiler' Agent.", - "tags": [ - "Agents" - ], - "summary": "Change 'QAN MongoDB Profiler' Agent", - "operationId": "ChangeQANMongoDBProfilerAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeQANMySQLPerfSchemaAgent": { - "post": { - "description": "Changes 'Query Analytics MySQL PerfSchema' Agent.", - "tags": [ - "Agents" - ], - "summary": "Change 'QAN MySQL PerfSchema' Agent", - "operationId": "ChangeQANMySQLPerfSchemaAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeQANMySQLSlowlogAgent": { - "post": { - "description": "Changes 'Query Analytics MySQL Slowlog' Agent.", - "tags": [ - "Agents" - ], - "summary": "Change 'QAN MySQL Slowlog' Agent", - "operationId": "ChangeQANMySQLSlowlogAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 13 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeQANPostgreSQLPgStatMonitorAgent": { - "post": { - "description": "Changes 'Query Analytics PostgreSQL pg_stat_monitor' Agent.", - "tags": [ - "Agents" - ], - "summary": "Change 'QAN PostgreSQL pg_stat_monitor' Agent", - "operationId": "ChangeQANPostgreSQLPgStatMonitorAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 9 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeQANPostgreSQLPgStatementsAgent": { - "post": { - "description": "Changes 'Query Analytics PostgreSQL pg_stat_statements' Agent.", - "tags": [ - "Agents" - ], - "summary": "Change 'QAN PostgreSQL pg_stat_statements' Agent", - "operationId": "ChangeQANPostgreSQLPgStatementsAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/ChangeRDSExporter": { - "post": { - "description": "Changes rds_exporter Agent.", - "tags": [ - "Agents" - ], - "summary": "Change RDS Exporter", - "operationId": "ChangeRDSExporter", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "common": { - "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", - "type": "object", - "properties": { - "enable": { - "description": "Enable this Agent. Can't be used with disabled.", - "type": "boolean", - "x-order": 0 - }, - "disable": { - "description": "Disable this Agent. Can't be used with enabled.", - "type": "boolean", - "x-order": 1 - }, - "custom_labels": { - "description": "Replace all custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 2 - }, - "remove_custom_labels": { - "description": "Remove all custom user-assigned labels.", - "type": "boolean", - "x-order": 3 - }, - "enable_push_metrics": { - "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", - "type": "boolean", - "x-order": 4 - }, - "disable_push_metrics": { - "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", - "type": "boolean", - "x-order": 5 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/Get": { - "post": { - "description": "Returns a single Agent by ID.", - "tags": [ - "Agents" - ], - "summary": "Get Agent", - "operationId": "GetAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 2 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 6 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 7 - } - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 13 - } - }, - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 9 - }, - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 10 - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 9 - } - }, - "x-order": 11 - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "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 - } - }, - "x-order": 13 - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "x-order": 14 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/List": { - "post": { - "description": "Returns a list of all Agents.", - "tags": [ - "Agents" - ], - "summary": "List Agents", - "operationId": "ListAgents", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "pmm_agent_id": { - "description": "Return only Agents started by this pmm-agent.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "type": "string", - "x-order": 0 - }, - "node_id": { - "description": "Return only Agents that provide insights for that Node.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "type": "string", - "x-order": 1 - }, - "service_id": { - "description": "Return only Agents that provide insights for that Service.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", - "type": "string", - "x-order": 2 - }, - "agent_type": { - "description": "AgentType describes supported Agent types.", - "type": "string", - "default": "AGENT_TYPE_INVALID", - "enum": [ - "AGENT_TYPE_INVALID", - "PMM_AGENT", - "VM_AGENT", - "NODE_EXPORTER", - "MYSQLD_EXPORTER", - "MONGODB_EXPORTER", - "POSTGRES_EXPORTER", - "PROXYSQL_EXPORTER", - "QAN_MYSQL_PERFSCHEMA_AGENT", - "QAN_MYSQL_SLOWLOG_AGENT", - "QAN_MONGODB_PROFILER_AGENT", - "QAN_POSTGRESQL_PGSTATEMENTS_AGENT", - "QAN_POSTGRESQL_PGSTATMONITOR_AGENT", - "RDS_EXPORTER", - "EXTERNAL_EXPORTER", - "AZURE_DATABASE_EXPORTER" - ], - "x-order": 3 - } - } - } - } - ], - "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 - } - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 2 - } - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 6 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 7 - } - } - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 13 - } - } - }, - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - } - }, - "x-order": 9 - }, - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - } - }, - "x-order": 10 - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 9 - } - } - }, - "x-order": 11 - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - } - }, - "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 - } - } - }, - "x-order": 13 - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - } - }, - "x-order": 14 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Agents/Remove": { - "post": { - "description": "Removes Agent.", - "tags": [ - "Agents" - ], - "summary": "Remove Agent", - "operationId": "RemoveAgent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "x-order": 0 - }, - "force": { - "description": "Remove agent with all dependencies.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/AddContainer": { - "post": { - "description": "Adds container Node.", - "tags": [ - "Nodes" - ], - "summary": "Add Container Node", - "operationId": "AddContainerNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/AddGeneric": { - "post": { - "description": "Adds generic Node.", - "tags": [ - "Nodes" - ], - "summary": "Add Generic Node", - "operationId": "AddGenericNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/AddRemote": { - "post": { - "description": "Adds remote Node.", - "tags": [ - "Nodes" - ], - "summary": "Add Remote Node", - "operationId": "AddRemoteNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/AddRemoteAzureDatabase": { - "post": { - "description": "Adds remote Azure database Node.", - "tags": [ - "Nodes" - ], - "summary": "Add Remote Azure Database Node", - "operationId": "AddRemoteAzureDatabaseNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/AddRemoteRDS": { - "post": { - "description": "Adds remote RDS Node.", - "tags": [ - "Nodes" - ], - "summary": "Add Remote RDS Node", - "operationId": "AddRemoteRDSNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "remote_rds": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/Get": { - "post": { - "description": "Returns a single Node by ID.", - "tags": [ - "Nodes" - ], - "summary": "Get Node", - "operationId": "GetNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "generic": { - "description": "GenericNode represents a bare metal server or virtual machine.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id.", - "type": "string", - "x-order": 3 - }, - "distro": { - "description": "Linux distribution name and version.", - "type": "string", - "x-order": 4 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 5 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 6 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 7 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 8 - } - }, - "x-order": 0 - }, - "container": { - "description": "ContainerNode represents a Docker container.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "machine_id": { - "description": "Linux machine-id of the Generic Node where this Container Node runs.", - "type": "string", - "x-order": 3 - }, - "container_id": { - "description": "Container identifier. If specified, must be a unique Docker container identifier.", - "type": "string", - "x-order": 4 - }, - "container_name": { - "description": "Container name.", - "type": "string", - "x-order": 5 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 6 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 7 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 8 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 9 - } - }, - "x-order": 1 - }, - "remote": { - "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "Node address (DNS name or IP).", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 2 - }, - "remote_rds": { - "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 3 - }, - "remote_azure_database": { - "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name.", - "type": "string", - "x-order": 1 - }, - "address": { - "description": "DB instance identifier.", - "type": "string", - "x-order": 2 - }, - "node_model": { - "description": "Node model.", - "type": "string", - "x-order": 3 - }, - "region": { - "description": "Node region.", - "type": "string", - "x-order": 4 - }, - "az": { - "description": "Node availability zone.", - "type": "string", - "x-order": 5 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 6 - } - }, - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/List": { - "post": { - "description": "Returns a list of all Nodes.", - "tags": [ - "Nodes" - ], - "summary": "List Nodes", - "operationId": "ListNodes", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "REMOTE_AZURE_DATABASE_NODE" - ], - "x-order": 0 - } - } - } - } - ], - "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 - } - } - }, - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Nodes/Remove": { - "post": { - "description": "Removes Node.", - "tags": [ - "Nodes" - ], - "summary": "Remove Node", - "operationId": "RemoveNode", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - }, - "force": { - "description": "Remove node with all dependencies.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddExternalService": { - "post": { - "description": "Adds External Service.", - "tags": [ - "Services" - ], - "summary": "Add External Service", - "operationId": "AddExternalService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddHAProxyService": { - "post": { - "description": "Adds HAProxy Service.", - "tags": [ - "Services" - ], - "summary": "Add HAProxy Service", - "operationId": "AddHAProxyService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddMongoDB": { - "post": { - "description": "Adds MongoDB Service.", - "tags": [ - "Services" - ], - "summary": "Add MongoDB Service", - "operationId": "AddMongoDBService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddMySQL": { - "post": { - "description": "Adds MySQL Service.", - "tags": [ - "Services" - ], - "summary": "Add MySQL Service", - "operationId": "AddMySQLService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddPostgreSQL": { - "post": { - "description": "Adds PostgreSQL Service.", - "tags": [ - "Services" - ], - "summary": "Add PostgreSQL Service", - "operationId": "AddPostgreSQLService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/AddProxySQL": { - "post": { - "description": "Adds ProxySQL Service.", - "tags": [ - "Services" - ], - "summary": "Add ProxySQL Service", - "operationId": "AddProxySQLService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "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 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/Get": { - "post": { - "description": "Returns a single Service by ID.", - "tags": [ - "Services" - ], - "summary": "Get Service", - "operationId": "GetService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Unique randomly generated instance identifier.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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 - } - }, - "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 - } - }, - "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 - } - }, - "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 - } - }, - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/List": { - "post": { - "description": "Returns a list of Services filtered by type.", - "tags": [ - "Services" - ], - "summary": "List Services", - "operationId": "ListServices", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "node_id": { - "description": "Return only Services running on that Node.", - "type": "string", - "x-order": 0 - }, - "service_type": { - "description": "ServiceType describes supported Service types.", - "type": "string", - "default": "SERVICE_TYPE_INVALID", - "enum": [ - "SERVICE_TYPE_INVALID", - "MYSQL_SERVICE", - "MONGODB_SERVICE", - "POSTGRESQL_SERVICE", - "PROXYSQL_SERVICE", - "HAPROXY_SERVICE", - "EXTERNAL_SERVICE" - ], - "x-order": 1 - }, - "external_group": { - "description": "Return only services in this external group.", - "type": "string", - "x-order": 2 - } - } - } - } - ], - "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 - } - } - }, - "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 - } - } - }, - "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 - } - } - }, - "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 - } - } - }, - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/inventory/Services/Remove": { - "post": { - "description": "Removes Service.", - "tags": [ - "Services" - ], - "summary": "Remove Service", - "operationId": "RemoveService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "description": "Unique randomly generated instance identifier. Required.", - "type": "string", - "x-order": 0 - }, - "force": { - "description": "Remove service with all dependencies.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/Cancel": { - "post": { - "description": "Stops an Action.", - "tags": [ - "Actions" - ], - "summary": "Cancel 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/Get": { - "post": { - "description": "Gets the result of a given Action.", - "tags": [ - "Actions" - ], - "summary": "Get Action", - "operationId": "GetAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "action_id": { - "description": "Unique Action ID.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMongoDBExplain": { - "post": { - "description": "Starts 'MongoDB EXPLAIN' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'MongoDB EXPLAIN' Action", - "operationId": "StartMongoDBExplainAction", - "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 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "Query. Required.", - "type": "string", - "x-order": 2 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLExplain": { - "post": { - "description": "Starts 'MySQL EXPLAIN' Action with traditional output.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL EXPLAIN' Action", - "operationId": "StartMySQLExplainAction", - "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 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "SQL query. Required.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLExplainJSON": { - "post": { - "description": "Starts 'MySQL EXPLAIN' Action with JSON output.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL EXPLAIN JSON' Action", - "operationId": "StartMySQLExplainJSONAction", - "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 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "SQL query. Required.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLExplainTraditionalJSON": { - "post": { - "description": "Starts 'MySQL EXPLAIN' Action with traditional JSON output.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL EXPLAIN Traditional JSON' Action", - "operationId": "StartMySQLExplainTraditionalJSONAction", - "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 - }, - "service_id": { - "description": "Service ID for this Action. Required.", - "type": "string", - "x-order": 1 - }, - "query": { - "description": "SQL query. Required.", - "type": "string", - "x-order": 2 - }, - "database": { - "description": "Database name. Required if it can't be deduced from the query.", - "type": "string", - "x-order": 3 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLShowCreateTable": { - "post": { - "description": "Starts 'MySQL SHOW CREATE TABLE' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL SHOW CREATE TABLE' Action", - "operationId": "StartMySQLShowCreateTableAction", - "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 - }, - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLShowIndex": { - "post": { - "description": "Starts 'MySQL SHOW INDEX' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL SHOW INDEX' Action", - "operationId": "StartMySQLShowIndexAction", - "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 - }, - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartMySQLShowTableStatus": { - "post": { - "description": "Starts 'MySQL SHOW TABLE STATUS' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'MySQL SHOW TABLE STATUS' Action", - "operationId": "StartMySQLShowTableStatusAction", - "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 - }, - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPTMongoDBSummary": { - "post": { - "description": "Starts 'Percona Toolkit MongoDB Summary' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'PT MongoDB Summary' Action", - "operationId": "StartPTMongoDBSummaryAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPTMySQLSummary": { - "post": { - "description": "Starts 'Percona Toolkit MySQL Summary' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'PT MySQL Summary' Action", - "operationId": "StartPTMySQLSummaryAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPTPgSummary": { - "post": { - "description": "Starts 'Percona Toolkit PostgreSQL Summary' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'PT PostgreSQL Summary' Action", - "operationId": "StartPTPgSummaryAction", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPTSummary": { - "post": { - "description": "Starts 'Percona Toolkit Summary' Action.", - "tags": [ - "Actions" - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPostgreSQLShowCreateTable": { - "post": { - "description": "Starts 'PostgreSQL SHOW CREATE TABLE' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'PostgreSQL SHOW CREATE TABLE' Action", - "operationId": "StartPostgreSQLShowCreateTableAction", - "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 - }, - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Actions/StartPostgreSQLShowIndex": { - "post": { - "description": "Starts 'PostgreSQL SHOW INDEX' Action.", - "tags": [ - "Actions" - ], - "summary": "Start 'PostgreSQL SHOW INDEX' Action", - "operationId": "StartPostgreSQLShowIndexAction", - "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 - }, - "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 - } - } - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Annotations/Add": { - "post": { - "description": "Adds annotation.", - "tags": [ - "Annotation" - ], - "summary": "Add Annotation", - "operationId": "AddAnnotation", - "parameters": [ - { - "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 annotate node.", - "type": "string", - "x-order": 2 - }, - "service_names": { - "description": "Used for annotate 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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/External/Add": { - "post": { - "description": "Adds external service and adds external exporter. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds an \"external exporter\" agent to inventory, which is running on provided \"runs_on_node_id\".", - "tags": [ - "External" - ], - "summary": "Add External Service", - "operationId": "AddExternal", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "runs_on_node_id": { - "description": "Node identifier on which an external exporter is been running.\nruns_on_node_id always should 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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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 - }, - "node_id": { - "description": "Node identifier on which an external service is been running.\nnode_id always should 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.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 16 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 17 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/HAProxy/Add": { - "post": { - "description": "Adds HAProxy service and external exporter. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds an \"external exporter\" agent to the inventory.", - "tags": [ - "HAProxy" - ], - "summary": "Add HAProxy", - "operationId": "AddHAProxy", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 14 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 15 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/MongoDB/Add": { - "post": { - "description": "Adds MongoDB Service and starts several Agents. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds \"mongodb_exporter\", and \"qan_mongodb_profiler\" agents with the provided \"pmm_agent_id\" and other parameters.", - "tags": [ - "MongoDB" - ], - "summary": "Add MongoDB", - "operationId": "AddMongoDB", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 14 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 15 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 16 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 17 - }, - "tls_certificate_key": { - "description": "Client certificate and key.", - "type": "string", - "x-order": 18 - }, - "tls_certificate_key_file_password": { - "description": "Password for decrypting tls_certificate_key.", - "type": "string", - "x-order": 19 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 20 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 21 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 22 - }, - "authentication_mechanism": { - "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", - "type": "string", - "x-order": 23 - }, - "authentication_database": { - "description": "Authentication database.", - "type": "string", - "x-order": 24 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 25 - }, - "stats_collections": { - "description": "List of collections to get stats from. Can use * .", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 26 - }, - "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": 27 - }, - "enable_all_collectors": { - "type": "boolean", - "title": "Enable all collectors", - "x-order": 28 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "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 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 7 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 2 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/MySQL/Add": { - "post": { - "description": "Adds MySQL Service and starts several Agents. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds \"mysqld_exporter\", and \"qan_mysql_perfschema\" agents with the provided \"pmm_agent_id\" and other parameters.", - "tags": [ - "MySQL" - ], - "summary": "Add MySQL", - "operationId": "AddMySQL", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 17 - }, - "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": 18 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 19 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation.", - "type": "boolean", - "x-order": 20 - }, - "tls_ca": { - "description": "Certificate Authority certificate chain.", - "type": "string", - "x-order": 21 - }, - "tls_cert": { - "description": "Client certificate.", - "type": "string", - "x-order": 22 - }, - "tls_key": { - "description": "Password for decrypting tls_cert.", - "type": "string", - "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 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 25 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 26 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 27 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "max_slowlog_file_size": { - "description": "Slowlog file is rotated at this size if \u003e 0.", - "type": "string", - "format": "int64", - "x-order": 11 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 12 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 13 - } - }, - "x-order": 3 - }, - "table_count": { - "description": "Actual table count at the moment of adding.", - "type": "integer", - "format": "int32", - "x-order": 4 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Node/Register": { - "post": { - "description": "Registers a new Node and pmm-agent.", - "tags": [ - "Node" - ], - "summary": "Register 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "REMOTE_AZURE_DATABASE_NODE" - ], - "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 - }, - "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.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 12 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 13 - } - } - } - } - ], - "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 - } - }, - "x-order": 2 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/PostgreSQL/Add": { - "post": { - "description": "Adds PostgreSQL Service and starts postgres exporter. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds \"postgres_exporter\" with provided \"pmm_agent_id\" and other parameters.", - "tags": [ - "PostgreSQL" - ], - "summary": "Add PostgreSQL", - "operationId": "AddPostgreSQL", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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 - }, - "disable_query_examples": { - "description": "Disable query examples.", - "type": "boolean", - "x-order": 16 - }, - "custom_labels": { - "description": "Custom user-assigned labels for Service.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 17 - }, - "skip_connection_check": { - "description": "Skip connection check.", - "type": "boolean", - "x-order": 18 - }, - "tls": { - "description": "Use TLS for database connections.", - "type": "boolean", - "x-order": 19 - }, - "tls_skip_verify": { - "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", - "type": "boolean", - "x-order": 20 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 21 - }, - "disable_collectors": { - "description": "List of collector names to disable in this exporter.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 22 - }, - "tls_ca": { - "description": "TLS CA certificate.", - "type": "string", - "x-order": 23 - }, - "tls_cert": { - "description": "TLS Certifcate.", - "type": "string", - "x-order": 24 - }, - "tls_key": { - "description": "TLS Certificate Key.", - "type": "string", - "x-order": 25 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 26 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 9 - } - }, - "x-order": 3 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/ProxySQL/Add": { - "post": { - "description": "Adds ProxySQL Service and starts several Agents. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds \"proxysql_exporter\" with provided \"pmm_agent_id\" and other parameters.", - "tags": [ - "ProxySQL" - ], - "summary": "Add ProxySQL", - "operationId": "AddProxySQL", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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 is a params 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_INVALID", - "enum": [ - "NODE_TYPE_INVALID", - "GENERIC_NODE", - "CONTAINER_NODE", - "REMOTE_NODE", - "REMOTE_RDS_NODE", - "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.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/RDS/Add": { - "post": { - "description": "Adds RDS instance.", - "tags": [ - "RDS" - ], - "summary": "Add RDS", - "operationId": "AddRDS", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "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_INVALID", - "enum": [ - "DISCOVER_RDS_ENGINE_INVALID", - "DISCOVER_RDS_MYSQL", - "DISCOVER_RDS_POSTGRESQL" - ], - "x-order": 6 - }, - "node_name": { - "description": "Unique across all Nodes user-defined name. Defaults to AWS instance ID.", - "type": "string", - "x-order": 7 - }, - "service_name": { - "description": "Unique across all Services user-defined name. Defaults to AWS instance ID.", - "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": "Username for scraping metrics.", - "type": "string", - "x-order": 12 - }, - "password": { - "description": "Password for scraping metrics.", - "type": "string", - "x-order": 13 - }, - "aws_access_key": { - "description": "AWS Access key.", - "type": "string", - "x-order": 14 - }, - "aws_secret_key": { - "description": "AWS Secret key.", - "type": "string", - "x-order": 15 - }, - "rds_exporter": { - "description": "If true, adds rds_exporter.", - "type": "boolean", - "x-order": 16 - }, - "qan_mysql_perfschema": { - "description": "If true, adds qan-mysql-perfschema-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 - }, - "disable_basic_metrics": { - "description": "Disable basic metrics.", - "type": "boolean", - "x-order": 24 - }, - "disable_enhanced_metrics": { - "description": "Disable enhanced metrics.", - "type": "boolean", - "x-order": 25 - }, - "metrics_mode": { - "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", - "type": "string", - "default": "AUTO", - "enum": [ - "AUTO", - "PULL", - "PUSH" - ], - "x-order": 26 - }, - "qan_postgresql_pgstatements": { - "type": "boolean", - "title": "If true, add qan-pgstatements", - "x-order": 27 - }, - "agent_password": { - "description": "Custom password for exporter endpoint /metrics.", - "type": "string", - "x-order": 28 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "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 - } - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "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 - } - }, - "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 - } - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 14 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 15 - }, - "tablestats_group_disabled": { - "description": "True if tablestats group collectors are currently disabled.", - "type": "boolean", - "x-order": 16 - } - }, - "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 - }, - "query_examples_disabled": { - "description": "True if query examples are disabled.", - "type": "boolean", - "x-order": 10 - }, - "custom_labels": { - "description": "Custom user-assigned labels.", - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-order": 11 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 12 - } - }, - "x-order": 4 - }, - "table_count": { - "description": "Actual table count at the moment of adding.", - "type": "integer", - "format": "int32", - "x-order": 5 - }, - "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 - } - }, - "x-order": 6 - }, - "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 - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 10 - }, - "listen_port": { - "description": "Listen port for scraping metrics.", - "type": "integer", - "format": "int64", - "x-order": 11 - } - }, - "x-order": 7 - }, - "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 - }, - "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 - }, - "status": { - "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", - "type": "string", - "default": "AGENT_STATUS_INVALID", - "enum": [ - "AGENT_STATUS_INVALID", - "STARTING", - "RUNNING", - "WAITING", - "STOPPING", - "DONE", - "UNKNOWN" - ], - "x-order": 8 - } - }, - "x-order": 8 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/RDS/Discover": { - "post": { - "description": "Discovers RDS instances.", - "tags": [ - "RDS" - ], - "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_INVALID", - "enum": [ - "DISCOVER_RDS_ENGINE_INVALID", - "DISCOVER_RDS_MYSQL", - "DISCOVER_RDS_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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/Change": { - "post": { - "description": "Enables/disables Security Thread Tool checks or changes their interval by names.", - "tags": [ - "SecurityChecks" - ], - "summary": "Change Security Checks", - "operationId": "ChangeSecurityChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "params": { - "type": "array", - "items": { - "description": "ChangeSecurityCheckParams 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-order": 1 - }, - "disable": { - "type": "boolean", - "x-order": 2 - }, - "interval": { - "description": "SecurityCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "SECURITY_CHECK_INTERVAL_INVALID", - "enum": [ - "SECURITY_CHECK_INTERVAL_INVALID", - "STANDARD", - "FREQUENT", - "RARE" - ], - "x-order": 3 - } - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/FailedChecks": { - "post": { - "description": "Returns the latest check results for a given service.", - "tags": [ - "SecurityChecks" - ], - "summary": "Get Failed Checks", - "operationId": "GetFailedChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_id": { - "type": "string", - "x-order": 0 - }, - "page_params": { - "description": "PageParams represents page request parameters for pagination.", - "type": "object", - "properties": { - "page_size": { - "description": "Maximum number of results per page.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "index": { - "description": "Index of the requested page, starts from 0.", - "type": "integer", - "format": "int32", - "x-order": 1 - } - }, - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "results": { - "type": "array", - "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_INVALID", - "enum": [ - "SEVERITY_INVALID", - "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 STT 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 - }, - "alert_id": { - "type": "string", - "title": "ID of the check result as stored in AlertManager", - "x-order": 8 - }, - "silenced": { - "type": "boolean", - "title": "Silence status of the check result", - "x-order": 9 - } - } - }, - "x-order": 0 - }, - "page_totals": { - "description": "PageTotals represents total values for pagination.", - "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 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/GetCheckResults": { - "post": { - "description": "Returns Security Thread Tool's latest checks results.", - "tags": [ - "SecurityChecks" - ], - "summary": "Get Security Check Results", - "operationId": "GetSecurityCheckResults", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "description": "SecurityCheckResult represents the check result returned from pmm-managed after running the check.", - "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_INVALID", - "enum": [ - "SEVERITY_INVALID", - "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 STT check.", - "type": "string", - "x-order": 4 - }, - "service_name": { - "description": "Name of the monitored service on which the check ran.", - "type": "string", - "x-order": 5 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/List": { - "post": { - "description": "Returns a list of available Security Thread Tool checks.", - "tags": [ - "SecurityChecks" - ], - "summary": "List Security Checks", - "operationId": "ListSecurityChecks", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "checks": { - "type": "array", - "items": { - "description": "SecurityCheck contains check name and status.", - "type": "object", - "properties": { - "name": { - "description": "Machine-readable name (ID) that is used in expression.", - "type": "string", - "x-order": 0 - }, - "disabled": { - "description": "True if that check is disabled.", - "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": "SecurityCheckInterval represents possible execution interval values for checks.", - "type": "string", - "default": "SECURITY_CHECK_INTERVAL_INVALID", - "enum": [ - "SECURITY_CHECK_INTERVAL_INVALID", - "STANDARD", - "FREQUENT", - "RARE" - ], - "x-order": 4 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/ListFailedServices": { - "post": { - "description": "Returns a list of services with failed checks and a summary of check results.", - "tags": [ - "SecurityChecks" - ], - "summary": "List Failed Services", - "operationId": "ListFailedServices", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/Start": { - "post": { - "description": "Executes Security Thread Tool checks and returns when all checks are executed. All available checks will be started if check names aren't specified.", - "tags": [ - "SecurityChecks" - ], - "summary": "Start Security Checks", - "operationId": "StartSecurityChecks", - "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": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/SecurityChecks/ToggleCheckAlert": { - "post": { - "description": "Silence/Unsilence alerts for a specific check result.", - "tags": [ - "SecurityChecks" - ], - "summary": "Toggle Check Alert", - "operationId": "ToggleCheckAlert", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "alert_id": { - "description": "Alert ID of the check result.", - "type": "string", - "x-order": 0 - }, - "silence": { - "description": "Silence the check result if set to true, unsilence otherwise.", - "type": "boolean", - "x-order": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/management/Service/Remove": { - "post": { - "description": "Removes Service with Agents.", - "tags": [ - "Service" - ], - "summary": "Remove Service", - "operationId": "RemoveServiceMixin2", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "service_type": { - "description": "ServiceType describes supported Service types.", - "type": "string", - "default": "SERVICE_TYPE_INVALID", - "enum": [ - "SERVICE_TYPE_INVALID", - "MYSQL_SERVICE", - "MONGODB_SERVICE", - "POSTGRESQL_SERVICE", - "PROXYSQL_SERVICE", - "HAPROXY_SERVICE", - "EXTERNAL_SERVICE" - ], - "x-order": 0 - }, - "service_id": { - "description": "Service ID or Service Name is required.\nUnique randomly generated instance identifier.", - "type": "string", - "x-order": 1 - }, - "service_name": { - "description": "Unique across all Services user-defined name.", - "type": "string", - "x-order": 2 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/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": [ - "Server" - ], - "summary": "Check server readiness", - "operationId": "Readiness", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - }, - "/v1/version": { - "get": { - "description": "Returns PMM Server versions.", - "tags": [ - "Server" - ], - "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_INVALID", - "enum": [ - "DISTRIBUTION_METHOD_INVALID", - "DOCKER", - "OVF", - "AMI", - "AZURE", - "DO" - ], - "x-order": 3 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "error": { - "type": "string", - "x-order": 0 - }, - "code": { - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "message": { - "type": "string", - "x-order": 2 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type_url": { - "type": "string", - "x-order": 0 - }, - "value": { - "type": "string", - "format": "byte", - "x-order": 1 - } - } - }, - "x-order": 3 - } - } - } - } - } - } - } - }, - "securityDefinitions": { - "basicAuth": { - "type": "basic" - } - }, - "security": [ - { - "basicAuth": [] - } - ], - "x-readme": { - "samples-languages": [ - "curl", - "go", - "node", - "python" - ] - } -} \ No newline at end of file From 84d9f7d044b2fcba3a7e6b110cf3266df763e354 Mon Sep 17 00:00:00 2001 From: Alexey Mukas Date: Thu, 14 Apr 2022 01:19:46 +0200 Subject: [PATCH 6/6] regenerate alertmanager --- .../amclient/alert/alert_client.go | 31 +- .../amclient/alert/get_alerts_parameters.go | 182 +- .../amclient/alert/get_alerts_responses.go | 12 +- .../amclient/alert/post_alerts_parameters.go | 47 +- .../amclient/alert/post_alerts_responses.go | 11 +- .../amclient/alertgroup/alertgroup_client.go | 17 +- .../alertgroup/get_alert_groups_parameters.go | 159 +- .../alertgroup/get_alert_groups_responses.go | 12 +- ...r_client.go => alertmanager_api_client.go} | 22 +- .../amclient/general/general_client.go | 17 +- .../amclient/general/get_status_parameters.go | 42 +- .../amclient/general/get_status_responses.go | 6 +- .../receiver/get_receivers_parameters.go | 42 +- .../receiver/get_receivers_responses.go | 6 +- .../amclient/receiver/receiver_client.go | 17 +- .../silence/delete_silence_parameters.go | 48 +- .../silence/delete_silence_responses.go | 8 +- .../silence/get_silence_parameters.go | 48 +- .../amclient/silence/get_silence_responses.go | 11 +- .../silence/get_silences_parameters.go | 76 +- .../silence/get_silences_responses.go | 9 +- .../silence/post_silences_parameters.go | 47 +- .../silence/post_silences_responses.go | 18 +- .../amclient/silence/silence_client.go | 59 +- api/alertmanager/ammodels/alert.go | 41 +- api/alertmanager/ammodels/alert_group.go | 93 +- api/alertmanager/ammodels/alert_groups.go | 28 + api/alertmanager/ammodels/alert_status.go | 6 + .../ammodels/alertmanager_config.go | 7 + .../ammodels/alertmanager_status.go | 78 + api/alertmanager/ammodels/cluster_status.go | 38 +- api/alertmanager/ammodels/gettable_alert.go | 98 +- api/alertmanager/ammodels/gettable_alerts.go | 28 + api/alertmanager/ammodels/gettable_silence.go | 39 + .../ammodels/gettable_silences.go | 28 + api/alertmanager/ammodels/label_set.go | 7 + api/alertmanager/ammodels/matcher.go | 7 + api/alertmanager/ammodels/matchers.go | 28 + api/alertmanager/ammodels/peer_status.go | 7 + api/alertmanager/ammodels/postable_alert.go | 47 +- api/alertmanager/ammodels/postable_alerts.go | 28 + api/alertmanager/ammodels/postable_silence.go | 17 + api/alertmanager/ammodels/receiver.go | 7 + api/alertmanager/ammodels/silence.go | 32 + api/alertmanager/ammodels/silence_status.go | 6 + api/alertmanager/ammodels/version_info.go | 7 + .../client/platform/connect_parameters.go | 144 + .../json/client/platform/connect_responses.go | 312 + .../client/platform/disconnect_parameters.go | 146 + .../client/platform/disconnect_responses.go | 266 + .../json/client/platform/platform_client.go | 283 + ...ch_organization_entitlements_parameters.go | 146 + ...rch_organization_entitlements_responses.go | 566 + .../search_organization_tickets_parameters.go | 146 + .../search_organization_tickets_responses.go | 453 + .../client/platform/server_info_parameters.go | 146 + .../client/platform/server_info_responses.go | 308 + .../client/platform/user_status_parameters.go | 146 + .../client/platform/user_status_responses.go | 305 + .../json/client/pmm_platform_api_client.go | 112 + api/platformpb/json/platformpb.json | 601 + .../json/client/filters/filters_client.go | 76 + .../json/client/filters/get_parameters.go | 144 + .../json/client/filters/get_responses.go | 694 + .../get_metrics_names_parameters.go | 146 + .../get_metrics_names_responses.go | 307 + .../metrics_names/metrics_names_client.go | 76 + .../get_histogram_parameters.go | 144 + .../object_details/get_histogram_responses.go | 594 + .../object_details/get_labels_parameters.go | 144 + .../object_details/get_labels_responses.go | 488 + .../object_details/get_metrics_parameters.go | 144 + .../object_details/get_metrics_responses.go | 1019 + .../get_query_example_parameters.go | 144 + .../get_query_example_responses.go | 736 + .../get_query_plan_parameters.go | 144 + .../get_query_plan_responses.go | 345 + .../object_details/object_details_client.go | 232 + api/qanpb/json/client/pmm_qan_api_client.go | 127 + .../client/profile/get_report_parameters.go | 144 + .../client/profile/get_report_responses.go | 1133 + .../json/client/profile/profile_client.go | 76 + api/swagger/swagger-dev-only.json | 11740 ++++++ api/swagger/swagger-dev.json | 30986 ++++++++++++++++ api/swagger/swagger.json | 19283 ++++++++++ 85 files changed, 74393 insertions(+), 377 deletions(-) rename api/alertmanager/amclient/{alertmanager_client.go => alertmanager_api_client.go} (86%) create mode 100644 api/platformpb/json/client/platform/connect_parameters.go create mode 100644 api/platformpb/json/client/platform/connect_responses.go create mode 100644 api/platformpb/json/client/platform/disconnect_parameters.go create mode 100644 api/platformpb/json/client/platform/disconnect_responses.go create mode 100644 api/platformpb/json/client/platform/platform_client.go create mode 100644 api/platformpb/json/client/platform/search_organization_entitlements_parameters.go create mode 100644 api/platformpb/json/client/platform/search_organization_entitlements_responses.go create mode 100644 api/platformpb/json/client/platform/search_organization_tickets_parameters.go create mode 100644 api/platformpb/json/client/platform/search_organization_tickets_responses.go create mode 100644 api/platformpb/json/client/platform/server_info_parameters.go create mode 100644 api/platformpb/json/client/platform/server_info_responses.go create mode 100644 api/platformpb/json/client/platform/user_status_parameters.go create mode 100644 api/platformpb/json/client/platform/user_status_responses.go create mode 100644 api/platformpb/json/client/pmm_platform_api_client.go create mode 100644 api/platformpb/json/platformpb.json create mode 100644 api/qanpb/json/client/filters/filters_client.go create mode 100644 api/qanpb/json/client/filters/get_parameters.go create mode 100644 api/qanpb/json/client/filters/get_responses.go create mode 100644 api/qanpb/json/client/metrics_names/get_metrics_names_parameters.go create mode 100644 api/qanpb/json/client/metrics_names/get_metrics_names_responses.go create mode 100644 api/qanpb/json/client/metrics_names/metrics_names_client.go create mode 100644 api/qanpb/json/client/object_details/get_histogram_parameters.go create mode 100644 api/qanpb/json/client/object_details/get_histogram_responses.go create mode 100644 api/qanpb/json/client/object_details/get_labels_parameters.go create mode 100644 api/qanpb/json/client/object_details/get_labels_responses.go create mode 100644 api/qanpb/json/client/object_details/get_metrics_parameters.go create mode 100644 api/qanpb/json/client/object_details/get_metrics_responses.go create mode 100644 api/qanpb/json/client/object_details/get_query_example_parameters.go create mode 100644 api/qanpb/json/client/object_details/get_query_example_responses.go create mode 100644 api/qanpb/json/client/object_details/get_query_plan_parameters.go create mode 100644 api/qanpb/json/client/object_details/get_query_plan_responses.go create mode 100644 api/qanpb/json/client/object_details/object_details_client.go create mode 100644 api/qanpb/json/client/pmm_qan_api_client.go create mode 100644 api/qanpb/json/client/profile/get_report_parameters.go create mode 100644 api/qanpb/json/client/profile/get_report_responses.go create mode 100644 api/qanpb/json/client/profile/profile_client.go create mode 100644 api/swagger/swagger-dev-only.json create mode 100644 api/swagger/swagger-dev.json create mode 100644 api/swagger/swagger.json diff --git a/api/alertmanager/amclient/alert/alert_client.go b/api/alertmanager/amclient/alert/alert_client.go index 699722e5f3..71ea6e0da9 100644 --- a/api/alertmanager/amclient/alert/alert_client.go +++ b/api/alertmanager/amclient/alert/alert_client.go @@ -25,11 +25,14 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetAlerts(params *GetAlertsParams) (*GetAlertsOK, error) + GetAlerts(params *GetAlertsParams, opts ...ClientOption) (*GetAlertsOK, error) - PostAlerts(params *PostAlertsParams) (*PostAlertsOK, error) + PostAlerts(params *PostAlertsParams, opts ...ClientOption) (*PostAlertsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -37,13 +40,12 @@ type ClientService interface { /* GetAlerts Get a list of alerts */ -func (a *Client) GetAlerts(params *GetAlertsParams) (*GetAlertsOK, error) { +func (a *Client) GetAlerts(params *GetAlertsParams, opts ...ClientOption) (*GetAlertsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAlertsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAlerts", Method: "GET", PathPattern: "/alerts", @@ -54,7 +56,12 @@ func (a *Client) GetAlerts(params *GetAlertsParams) (*GetAlertsOK, error) { Reader: &GetAlertsReader{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 } @@ -71,13 +78,12 @@ func (a *Client) GetAlerts(params *GetAlertsParams) (*GetAlertsOK, error) { /* PostAlerts Create new Alerts */ -func (a *Client) PostAlerts(params *PostAlertsParams) (*PostAlertsOK, error) { +func (a *Client) PostAlerts(params *PostAlertsParams, opts ...ClientOption) (*PostAlertsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPostAlertsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "postAlerts", Method: "POST", PathPattern: "/alerts", @@ -88,7 +94,12 @@ func (a *Client) PostAlerts(params *PostAlertsParams) (*PostAlertsOK, error) { Reader: &PostAlertsReader{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 } diff --git a/api/alertmanager/amclient/alert/get_alerts_parameters.go b/api/alertmanager/amclient/alert/get_alerts_parameters.go index 078067a5c1..a213b53d74 100644 --- a/api/alertmanager/amclient/alert/get_alerts_parameters.go +++ b/api/alertmanager/amclient/alert/get_alerts_parameters.go @@ -17,114 +17,90 @@ import ( "github.com/go-openapi/swag" ) -// NewGetAlertsParams creates a new GetAlertsParams object -// with the default values initialized. +// NewGetAlertsParams creates a new GetAlertsParams 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 NewGetAlertsParams() *GetAlertsParams { - var ( - activeDefault = bool(true) - inhibitedDefault = bool(true) - silencedDefault = bool(true) - unprocessedDefault = bool(true) - ) return &GetAlertsParams{ - Active: &activeDefault, - Inhibited: &inhibitedDefault, - Silenced: &silencedDefault, - Unprocessed: &unprocessedDefault, - timeout: cr.DefaultTimeout, } } // NewGetAlertsParamsWithTimeout creates a new GetAlertsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAlertsParamsWithTimeout(timeout time.Duration) *GetAlertsParams { - var ( - activeDefault = bool(true) - inhibitedDefault = bool(true) - silencedDefault = bool(true) - unprocessedDefault = bool(true) - ) return &GetAlertsParams{ - Active: &activeDefault, - Inhibited: &inhibitedDefault, - Silenced: &silencedDefault, - Unprocessed: &unprocessedDefault, - timeout: timeout, } } // NewGetAlertsParamsWithContext creates a new GetAlertsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAlertsParamsWithContext(ctx context.Context) *GetAlertsParams { - var ( - activeDefault = bool(true) - inhibitedDefault = bool(true) - silencedDefault = bool(true) - unprocessedDefault = bool(true) - ) return &GetAlertsParams{ - Active: &activeDefault, - Inhibited: &inhibitedDefault, - Silenced: &silencedDefault, - Unprocessed: &unprocessedDefault, - Context: ctx, } } // NewGetAlertsParamsWithHTTPClient creates a new GetAlertsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAlertsParamsWithHTTPClient(client *http.Client) *GetAlertsParams { - var ( - activeDefault = bool(true) - inhibitedDefault = bool(true) - silencedDefault = bool(true) - unprocessedDefault = bool(true) - ) return &GetAlertsParams{ - Active: &activeDefault, - Inhibited: &inhibitedDefault, - Silenced: &silencedDefault, - Unprocessed: &unprocessedDefault, - HTTPClient: client, + HTTPClient: client, } } -/*GetAlertsParams contains all the parameters to send to the API endpoint -for the get alerts operation typically these are written to a http.Request +/* GetAlertsParams contains all the parameters to send to the API endpoint + for the get alerts operation. + + Typically these are written to a http.Request. */ type GetAlertsParams struct { - /*Active - Show active alerts + /* Active. + Show active alerts + + Default: true */ Active *bool - /*Filter - A list of matchers to filter alerts by + /* Filter. + + A list of matchers to filter alerts by */ Filter []string - /*Inhibited - Show inhibited alerts + /* Inhibited. + + Show inhibited alerts + + Default: true */ Inhibited *bool - /*Receiver - A regex matching receivers to filter alerts by + /* Receiver. + + A regex matching receivers to filter alerts by */ Receiver *string - /*Silenced - Show silenced alerts + /* Silenced. + + Show silenced alerts + + Default: true */ Silenced *bool - /*Unprocessed - Show unprocessed alerts + /* Unprocessed. + + Show unprocessed alerts + + Default: true */ Unprocessed *bool @@ -133,6 +109,41 @@ type GetAlertsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAlertsParams) WithDefaults() *GetAlertsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAlertsParams) SetDefaults() { + var ( + activeDefault = bool(true) + + inhibitedDefault = bool(true) + + silencedDefault = bool(true) + + unprocessedDefault = bool(true) + ) + + val := GetAlertsParams{ + Active: &activeDefault, + Inhibited: &inhibitedDefault, + Silenced: &silencedDefault, + Unprocessed: &unprocessedDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + // WithTimeout adds the timeout to the get alerts params func (o *GetAlertsParams) WithTimeout(timeout time.Duration) *GetAlertsParams { o.SetTimeout(timeout) @@ -244,88 +255,96 @@ func (o *GetAlertsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg // query param active var qrActive bool + if o.Active != nil { qrActive = *o.Active } qActive := swag.FormatBool(qrActive) if qActive != "" { + if err := r.SetQueryParam("active", qActive); err != nil { return err } } - } - valuesFilter := o.Filter + if o.Filter != nil { - joinedFilter := swag.JoinByFormat(valuesFilter, "multi") - // query array param filter - if err := r.SetQueryParam("filter", joinedFilter...); err != nil { - return err + // binding items for filter + joinedFilter := o.bindParamFilter(reg) + + // query array param filter + if err := r.SetQueryParam("filter", joinedFilter...); err != nil { + return err + } } if o.Inhibited != nil { // query param inhibited var qrInhibited bool + if o.Inhibited != nil { qrInhibited = *o.Inhibited } qInhibited := swag.FormatBool(qrInhibited) if qInhibited != "" { + if err := r.SetQueryParam("inhibited", qInhibited); err != nil { return err } } - } if o.Receiver != nil { // query param receiver var qrReceiver string + if o.Receiver != nil { qrReceiver = *o.Receiver } qReceiver := qrReceiver if qReceiver != "" { + if err := r.SetQueryParam("receiver", qReceiver); err != nil { return err } } - } if o.Silenced != nil { // query param silenced var qrSilenced bool + if o.Silenced != nil { qrSilenced = *o.Silenced } qSilenced := swag.FormatBool(qrSilenced) if qSilenced != "" { + if err := r.SetQueryParam("silenced", qSilenced); err != nil { return err } } - } if o.Unprocessed != nil { // query param unprocessed var qrUnprocessed bool + if o.Unprocessed != nil { qrUnprocessed = *o.Unprocessed } qUnprocessed := swag.FormatBool(qrUnprocessed) if qUnprocessed != "" { + if err := r.SetQueryParam("unprocessed", qUnprocessed); err != nil { return err } } - } if len(res) > 0 { @@ -333,3 +352,20 @@ func (o *GetAlertsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg } return nil } + +// bindParamGetAlerts binds the parameter filter +func (o *GetAlertsParams) bindParamFilter(formats strfmt.Registry) []string { + filterIR := o.Filter + + var filterIC []string + for _, filterIIR := range filterIR { // explode []string + + filterIIV := filterIIR // string as string + filterIC = append(filterIC, filterIIV) + } + + // items.CollectionFormat: "multi" + filterIS := swag.JoinByFormat(filterIC, "multi") + + return filterIS +} diff --git a/api/alertmanager/amclient/alert/get_alerts_responses.go b/api/alertmanager/amclient/alert/get_alerts_responses.go index 7e0a172f6d..eb6a3d5c22 100644 --- a/api/alertmanager/amclient/alert/get_alerts_responses.go +++ b/api/alertmanager/amclient/alert/get_alerts_responses.go @@ -41,9 +41,8 @@ func (o *GetAlertsReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewGetAlertsOK() *GetAlertsOK { return &GetAlertsOK{} } -/*GetAlertsOK handles this case with default header values. +/* GetAlertsOK describes a response with status code 200, with default header values. Get alerts response */ @@ -63,7 +62,6 @@ type GetAlertsOK struct { func (o *GetAlertsOK) Error() string { return fmt.Sprintf("[GET /alerts][%d] getAlertsOK %+v", 200, o.Payload) } - func (o *GetAlertsOK) GetPayload() ammodels.GettableAlerts { return o.Payload } @@ -83,7 +81,7 @@ func NewGetAlertsBadRequest() *GetAlertsBadRequest { return &GetAlertsBadRequest{} } -/*GetAlertsBadRequest handles this case with default header values. +/* GetAlertsBadRequest describes a response with status code 400, with default header values. Bad request */ @@ -94,7 +92,6 @@ type GetAlertsBadRequest struct { func (o *GetAlertsBadRequest) Error() string { return fmt.Sprintf("[GET /alerts][%d] getAlertsBadRequest %+v", 400, o.Payload) } - func (o *GetAlertsBadRequest) GetPayload() string { return o.Payload } @@ -114,7 +111,7 @@ func NewGetAlertsInternalServerError() *GetAlertsInternalServerError { return &GetAlertsInternalServerError{} } -/*GetAlertsInternalServerError handles this case with default header values. +/* GetAlertsInternalServerError describes a response with status code 500, with default header values. Internal server error */ @@ -125,7 +122,6 @@ type GetAlertsInternalServerError struct { func (o *GetAlertsInternalServerError) Error() string { return fmt.Sprintf("[GET /alerts][%d] getAlertsInternalServerError %+v", 500, o.Payload) } - func (o *GetAlertsInternalServerError) GetPayload() string { return o.Payload } diff --git a/api/alertmanager/amclient/alert/post_alerts_parameters.go b/api/alertmanager/amclient/alert/post_alerts_parameters.go index 9cab3eea01..4f2aa4564d 100644 --- a/api/alertmanager/amclient/alert/post_alerts_parameters.go +++ b/api/alertmanager/amclient/alert/post_alerts_parameters.go @@ -18,53 +18,52 @@ import ( "github.com/percona/pmm/api/alertmanager/ammodels" ) -// NewPostAlertsParams creates a new PostAlertsParams object -// with the default values initialized. +// NewPostAlertsParams creates a new PostAlertsParams 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 NewPostAlertsParams() *PostAlertsParams { - var () return &PostAlertsParams{ - timeout: cr.DefaultTimeout, } } // NewPostAlertsParamsWithTimeout creates a new PostAlertsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPostAlertsParamsWithTimeout(timeout time.Duration) *PostAlertsParams { - var () return &PostAlertsParams{ - timeout: timeout, } } // NewPostAlertsParamsWithContext creates a new PostAlertsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPostAlertsParamsWithContext(ctx context.Context) *PostAlertsParams { - var () return &PostAlertsParams{ - Context: ctx, } } // NewPostAlertsParamsWithHTTPClient creates a new PostAlertsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPostAlertsParamsWithHTTPClient(client *http.Client) *PostAlertsParams { - var () return &PostAlertsParams{ HTTPClient: client, } } -/*PostAlertsParams contains all the parameters to send to the API endpoint -for the post alerts operation typically these are written to a http.Request +/* PostAlertsParams contains all the parameters to send to the API endpoint + for the post alerts operation. + + Typically these are written to a http.Request. */ type PostAlertsParams struct { - /*Alerts - The alerts to create + /* Alerts. + The alerts to create */ Alerts ammodels.PostableAlerts @@ -73,6 +72,21 @@ type PostAlertsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the post alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAlertsParams) WithDefaults() *PostAlertsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostAlertsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the post alerts params func (o *PostAlertsParams) WithTimeout(timeout time.Duration) *PostAlertsParams { o.SetTimeout(timeout) @@ -124,7 +138,6 @@ func (o *PostAlertsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Re return err } var res []error - if o.Alerts != nil { if err := r.SetBodyParam(o.Alerts); err != nil { return err diff --git a/api/alertmanager/amclient/alert/post_alerts_responses.go b/api/alertmanager/amclient/alert/post_alerts_responses.go index f490efd959..2f575918ac 100644 --- a/api/alertmanager/amclient/alert/post_alerts_responses.go +++ b/api/alertmanager/amclient/alert/post_alerts_responses.go @@ -39,9 +39,8 @@ func (o *PostAlertsReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -50,7 +49,7 @@ func NewPostAlertsOK() *PostAlertsOK { return &PostAlertsOK{} } -/*PostAlertsOK handles this case with default header values. +/* PostAlertsOK describes a response with status code 200, with default header values. Create alerts response */ @@ -71,7 +70,7 @@ func NewPostAlertsBadRequest() *PostAlertsBadRequest { return &PostAlertsBadRequest{} } -/*PostAlertsBadRequest handles this case with default header values. +/* PostAlertsBadRequest describes a response with status code 400, with default header values. Bad request */ @@ -82,7 +81,6 @@ type PostAlertsBadRequest struct { func (o *PostAlertsBadRequest) Error() string { return fmt.Sprintf("[POST /alerts][%d] postAlertsBadRequest %+v", 400, o.Payload) } - func (o *PostAlertsBadRequest) GetPayload() string { return o.Payload } @@ -102,7 +100,7 @@ func NewPostAlertsInternalServerError() *PostAlertsInternalServerError { return &PostAlertsInternalServerError{} } -/*PostAlertsInternalServerError handles this case with default header values. +/* PostAlertsInternalServerError describes a response with status code 500, with default header values. Internal server error */ @@ -113,7 +111,6 @@ type PostAlertsInternalServerError struct { func (o *PostAlertsInternalServerError) Error() string { return fmt.Sprintf("[POST /alerts][%d] postAlertsInternalServerError %+v", 500, o.Payload) } - func (o *PostAlertsInternalServerError) GetPayload() string { return o.Payload } diff --git a/api/alertmanager/amclient/alertgroup/alertgroup_client.go b/api/alertmanager/amclient/alertgroup/alertgroup_client.go index 1e06b3b90d..3d7c8f9775 100644 --- a/api/alertmanager/amclient/alertgroup/alertgroup_client.go +++ b/api/alertmanager/amclient/alertgroup/alertgroup_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetAlertGroups(params *GetAlertGroupsParams) (*GetAlertGroupsOK, error) + GetAlertGroups(params *GetAlertGroupsParams, opts ...ClientOption) (*GetAlertGroupsOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { /* GetAlertGroups Get a list of alert groups */ -func (a *Client) GetAlertGroups(params *GetAlertGroupsParams) (*GetAlertGroupsOK, error) { +func (a *Client) GetAlertGroups(params *GetAlertGroupsParams, opts ...ClientOption) (*GetAlertGroupsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetAlertGroupsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getAlertGroups", Method: "GET", PathPattern: "/alerts/groups", @@ -52,7 +54,12 @@ func (a *Client) GetAlertGroups(params *GetAlertGroupsParams) (*GetAlertGroupsOK Reader: &GetAlertGroupsReader{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 } diff --git a/api/alertmanager/amclient/alertgroup/get_alert_groups_parameters.go b/api/alertmanager/amclient/alertgroup/get_alert_groups_parameters.go index 49d810ed6f..4cd073864c 100644 --- a/api/alertmanager/amclient/alertgroup/get_alert_groups_parameters.go +++ b/api/alertmanager/amclient/alertgroup/get_alert_groups_parameters.go @@ -17,101 +17,82 @@ import ( "github.com/go-openapi/swag" ) -// NewGetAlertGroupsParams creates a new GetAlertGroupsParams object -// with the default values initialized. +// NewGetAlertGroupsParams creates a new GetAlertGroupsParams 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 NewGetAlertGroupsParams() *GetAlertGroupsParams { - var ( - activeDefault = bool(true) - inhibitedDefault = bool(true) - silencedDefault = bool(true) - ) return &GetAlertGroupsParams{ - Active: &activeDefault, - Inhibited: &inhibitedDefault, - Silenced: &silencedDefault, - timeout: cr.DefaultTimeout, } } // NewGetAlertGroupsParamsWithTimeout creates a new GetAlertGroupsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetAlertGroupsParamsWithTimeout(timeout time.Duration) *GetAlertGroupsParams { - var ( - activeDefault = bool(true) - inhibitedDefault = bool(true) - silencedDefault = bool(true) - ) return &GetAlertGroupsParams{ - Active: &activeDefault, - Inhibited: &inhibitedDefault, - Silenced: &silencedDefault, - timeout: timeout, } } // NewGetAlertGroupsParamsWithContext creates a new GetAlertGroupsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetAlertGroupsParamsWithContext(ctx context.Context) *GetAlertGroupsParams { - var ( - activeDefault = bool(true) - inhibitedDefault = bool(true) - silencedDefault = bool(true) - ) return &GetAlertGroupsParams{ - Active: &activeDefault, - Inhibited: &inhibitedDefault, - Silenced: &silencedDefault, - Context: ctx, } } // NewGetAlertGroupsParamsWithHTTPClient creates a new GetAlertGroupsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetAlertGroupsParamsWithHTTPClient(client *http.Client) *GetAlertGroupsParams { - var ( - activeDefault = bool(true) - inhibitedDefault = bool(true) - silencedDefault = bool(true) - ) return &GetAlertGroupsParams{ - Active: &activeDefault, - Inhibited: &inhibitedDefault, - Silenced: &silencedDefault, HTTPClient: client, } } -/*GetAlertGroupsParams contains all the parameters to send to the API endpoint -for the get alert groups operation typically these are written to a http.Request +/* GetAlertGroupsParams contains all the parameters to send to the API endpoint + for the get alert groups operation. + + Typically these are written to a http.Request. */ type GetAlertGroupsParams struct { - /*Active - Show active alerts + /* Active. + Show active alerts + + Default: true */ Active *bool - /*Filter - A list of matchers to filter alerts by + /* Filter. + + A list of matchers to filter alerts by */ Filter []string - /*Inhibited - Show inhibited alerts + /* Inhibited. + + Show inhibited alerts + + Default: true */ Inhibited *bool - /*Receiver - A regex matching receivers to filter alerts by + /* Receiver. + + A regex matching receivers to filter alerts by */ Receiver *string - /*Silenced - Show silenced alerts + /* Silenced. + + Show silenced alerts + + Default: true */ Silenced *bool @@ -120,6 +101,38 @@ type GetAlertGroupsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get alert groups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAlertGroupsParams) WithDefaults() *GetAlertGroupsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get alert groups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAlertGroupsParams) SetDefaults() { + var ( + activeDefault = bool(true) + + inhibitedDefault = bool(true) + + silencedDefault = bool(true) + ) + + val := GetAlertGroupsParams{ + Active: &activeDefault, + Inhibited: &inhibitedDefault, + Silenced: &silencedDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + // WithTimeout adds the timeout to the get alert groups params func (o *GetAlertGroupsParams) WithTimeout(timeout time.Duration) *GetAlertGroupsParams { o.SetTimeout(timeout) @@ -220,72 +233,79 @@ func (o *GetAlertGroupsParams) WriteToRequest(r runtime.ClientRequest, reg strfm // query param active var qrActive bool + if o.Active != nil { qrActive = *o.Active } qActive := swag.FormatBool(qrActive) if qActive != "" { + if err := r.SetQueryParam("active", qActive); err != nil { return err } } - } - valuesFilter := o.Filter + if o.Filter != nil { - joinedFilter := swag.JoinByFormat(valuesFilter, "multi") - // query array param filter - if err := r.SetQueryParam("filter", joinedFilter...); err != nil { - return err + // binding items for filter + joinedFilter := o.bindParamFilter(reg) + + // query array param filter + if err := r.SetQueryParam("filter", joinedFilter...); err != nil { + return err + } } if o.Inhibited != nil { // query param inhibited var qrInhibited bool + if o.Inhibited != nil { qrInhibited = *o.Inhibited } qInhibited := swag.FormatBool(qrInhibited) if qInhibited != "" { + if err := r.SetQueryParam("inhibited", qInhibited); err != nil { return err } } - } if o.Receiver != nil { // query param receiver var qrReceiver string + if o.Receiver != nil { qrReceiver = *o.Receiver } qReceiver := qrReceiver if qReceiver != "" { + if err := r.SetQueryParam("receiver", qReceiver); err != nil { return err } } - } if o.Silenced != nil { // query param silenced var qrSilenced bool + if o.Silenced != nil { qrSilenced = *o.Silenced } qSilenced := swag.FormatBool(qrSilenced) if qSilenced != "" { + if err := r.SetQueryParam("silenced", qSilenced); err != nil { return err } } - } if len(res) > 0 { @@ -293,3 +313,20 @@ func (o *GetAlertGroupsParams) WriteToRequest(r runtime.ClientRequest, reg strfm } return nil } + +// bindParamGetAlertGroups binds the parameter filter +func (o *GetAlertGroupsParams) bindParamFilter(formats strfmt.Registry) []string { + filterIR := o.Filter + + var filterIC []string + for _, filterIIR := range filterIR { // explode []string + + filterIIV := filterIIR // string as string + filterIC = append(filterIC, filterIIV) + } + + // items.CollectionFormat: "multi" + filterIS := swag.JoinByFormat(filterIC, "multi") + + return filterIS +} diff --git a/api/alertmanager/amclient/alertgroup/get_alert_groups_responses.go b/api/alertmanager/amclient/alertgroup/get_alert_groups_responses.go index 4020f78e88..facac9ea62 100644 --- a/api/alertmanager/amclient/alertgroup/get_alert_groups_responses.go +++ b/api/alertmanager/amclient/alertgroup/get_alert_groups_responses.go @@ -41,9 +41,8 @@ func (o *GetAlertGroupsReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewGetAlertGroupsOK() *GetAlertGroupsOK { return &GetAlertGroupsOK{} } -/*GetAlertGroupsOK handles this case with default header values. +/* GetAlertGroupsOK describes a response with status code 200, with default header values. Get alert groups response */ @@ -63,7 +62,6 @@ type GetAlertGroupsOK struct { func (o *GetAlertGroupsOK) Error() string { return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsOK %+v", 200, o.Payload) } - func (o *GetAlertGroupsOK) GetPayload() ammodels.AlertGroups { return o.Payload } @@ -83,7 +81,7 @@ func NewGetAlertGroupsBadRequest() *GetAlertGroupsBadRequest { return &GetAlertGroupsBadRequest{} } -/*GetAlertGroupsBadRequest handles this case with default header values. +/* GetAlertGroupsBadRequest describes a response with status code 400, with default header values. Bad request */ @@ -94,7 +92,6 @@ type GetAlertGroupsBadRequest struct { func (o *GetAlertGroupsBadRequest) Error() string { return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsBadRequest %+v", 400, o.Payload) } - func (o *GetAlertGroupsBadRequest) GetPayload() string { return o.Payload } @@ -114,7 +111,7 @@ func NewGetAlertGroupsInternalServerError() *GetAlertGroupsInternalServerError { return &GetAlertGroupsInternalServerError{} } -/*GetAlertGroupsInternalServerError handles this case with default header values. +/* GetAlertGroupsInternalServerError describes a response with status code 500, with default header values. Internal server error */ @@ -125,7 +122,6 @@ type GetAlertGroupsInternalServerError struct { func (o *GetAlertGroupsInternalServerError) Error() string { return fmt.Sprintf("[GET /alerts/groups][%d] getAlertGroupsInternalServerError %+v", 500, o.Payload) } - func (o *GetAlertGroupsInternalServerError) GetPayload() string { return o.Payload } diff --git a/api/alertmanager/amclient/alertmanager_client.go b/api/alertmanager/amclient/alertmanager_api_client.go similarity index 86% rename from api/alertmanager/amclient/alertmanager_client.go rename to api/alertmanager/amclient/alertmanager_api_client.go index b36dacf544..c0a5feecec 100644 --- a/api/alertmanager/amclient/alertmanager_client.go +++ b/api/alertmanager/amclient/alertmanager_api_client.go @@ -17,7 +17,7 @@ import ( "github.com/percona/pmm/api/alertmanager/amclient/silence" ) -// Default alertmanager HTTP client. +// Default alertmanager API HTTP client. var Default = NewHTTPClient(nil) const ( @@ -32,14 +32,14 @@ const ( // DefaultSchemes are the default schemes found in Meta (info) section of spec file var DefaultSchemes = []string{"http"} -// NewHTTPClient creates a new alertmanager HTTP client. -func NewHTTPClient(formats strfmt.Registry) *Alertmanager { +// NewHTTPClient creates a new alertmanager API HTTP client. +func NewHTTPClient(formats strfmt.Registry) *AlertmanagerAPI { return NewHTTPClientWithConfig(formats, nil) } -// NewHTTPClientWithConfig creates a new alertmanager HTTP client, +// NewHTTPClientWithConfig creates a new alertmanager API HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Alertmanager { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *AlertmanagerAPI { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -50,14 +50,14 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Ale return New(transport, formats) } -// New creates a new alertmanager client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Alertmanager { +// New creates a new alertmanager API client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *AlertmanagerAPI { // ensure nullable parameters have default if formats == nil { formats = strfmt.Default } - cli := new(Alertmanager) + cli := new(AlertmanagerAPI) cli.Transport = transport cli.Alert = alert.New(transport, formats) cli.Alertgroup = alertgroup.New(transport, formats) @@ -106,8 +106,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// Alertmanager is a client for alertmanager -type Alertmanager struct { +// AlertmanagerAPI is a client for alertmanager API +type AlertmanagerAPI struct { Alert alert.ClientService Alertgroup alertgroup.ClientService @@ -122,7 +122,7 @@ type Alertmanager struct { } // SetTransport changes the transport on the client and all its subresources -func (c *Alertmanager) SetTransport(transport runtime.ClientTransport) { +func (c *AlertmanagerAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Alert.SetTransport(transport) c.Alertgroup.SetTransport(transport) diff --git a/api/alertmanager/amclient/general/general_client.go b/api/alertmanager/amclient/general/general_client.go index a8d6b11884..e48d2a30e2 100644 --- a/api/alertmanager/amclient/general/general_client.go +++ b/api/alertmanager/amclient/general/general_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetStatus(params *GetStatusParams) (*GetStatusOK, error) + GetStatus(params *GetStatusParams, opts ...ClientOption) (*GetStatusOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { /* GetStatus Get current status of an Alertmanager instance and its cluster */ -func (a *Client) GetStatus(params *GetStatusParams) (*GetStatusOK, error) { +func (a *Client) GetStatus(params *GetStatusParams, opts ...ClientOption) (*GetStatusOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetStatusParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getStatus", Method: "GET", PathPattern: "/status", @@ -52,7 +54,12 @@ func (a *Client) GetStatus(params *GetStatusParams) (*GetStatusOK, error) { Reader: &GetStatusReader{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 } diff --git a/api/alertmanager/amclient/general/get_status_parameters.go b/api/alertmanager/amclient/general/get_status_parameters.go index 3b3408bd5f..2428f0a93a 100644 --- a/api/alertmanager/amclient/general/get_status_parameters.go +++ b/api/alertmanager/amclient/general/get_status_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetStatusParams creates a new GetStatusParams object -// with the default values initialized. +// NewGetStatusParams creates a new GetStatusParams 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 NewGetStatusParams() *GetStatusParams { - return &GetStatusParams{ - timeout: cr.DefaultTimeout, } } // NewGetStatusParamsWithTimeout creates a new GetStatusParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetStatusParamsWithTimeout(timeout time.Duration) *GetStatusParams { - return &GetStatusParams{ - timeout: timeout, } } // NewGetStatusParamsWithContext creates a new GetStatusParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetStatusParamsWithContext(ctx context.Context) *GetStatusParams { - return &GetStatusParams{ - Context: ctx, } } // NewGetStatusParamsWithHTTPClient creates a new GetStatusParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetStatusParamsWithHTTPClient(client *http.Client) *GetStatusParams { - return &GetStatusParams{ HTTPClient: client, } } -/*GetStatusParams contains all the parameters to send to the API endpoint -for the get status operation typically these are written to a http.Request +/* GetStatusParams contains all the parameters to send to the API endpoint + for the get status operation. + + Typically these are written to a http.Request. */ type GetStatusParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type GetStatusParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetStatusParams) WithDefaults() *GetStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetStatusParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get status params func (o *GetStatusParams) WithTimeout(timeout time.Duration) *GetStatusParams { o.SetTimeout(timeout) diff --git a/api/alertmanager/amclient/general/get_status_responses.go b/api/alertmanager/amclient/general/get_status_responses.go index da18a4e790..0f7d88fcec 100644 --- a/api/alertmanager/amclient/general/get_status_responses.go +++ b/api/alertmanager/amclient/general/get_status_responses.go @@ -29,9 +29,8 @@ func (o *GetStatusReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return result, nil - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -40,7 +39,7 @@ func NewGetStatusOK() *GetStatusOK { return &GetStatusOK{} } -/*GetStatusOK handles this case with default header values. +/* GetStatusOK describes a response with status code 200, with default header values. Get status response */ @@ -51,7 +50,6 @@ type GetStatusOK struct { func (o *GetStatusOK) Error() string { return fmt.Sprintf("[GET /status][%d] getStatusOK %+v", 200, o.Payload) } - func (o *GetStatusOK) GetPayload() *ammodels.AlertmanagerStatus { return o.Payload } diff --git a/api/alertmanager/amclient/receiver/get_receivers_parameters.go b/api/alertmanager/amclient/receiver/get_receivers_parameters.go index 0a01ce8669..8fc8c264d8 100644 --- a/api/alertmanager/amclient/receiver/get_receivers_parameters.go +++ b/api/alertmanager/amclient/receiver/get_receivers_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetReceiversParams creates a new GetReceiversParams object -// with the default values initialized. +// NewGetReceiversParams creates a new GetReceiversParams 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 NewGetReceiversParams() *GetReceiversParams { - return &GetReceiversParams{ - timeout: cr.DefaultTimeout, } } // NewGetReceiversParamsWithTimeout creates a new GetReceiversParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetReceiversParamsWithTimeout(timeout time.Duration) *GetReceiversParams { - return &GetReceiversParams{ - timeout: timeout, } } // NewGetReceiversParamsWithContext creates a new GetReceiversParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetReceiversParamsWithContext(ctx context.Context) *GetReceiversParams { - return &GetReceiversParams{ - Context: ctx, } } // NewGetReceiversParamsWithHTTPClient creates a new GetReceiversParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetReceiversParamsWithHTTPClient(client *http.Client) *GetReceiversParams { - return &GetReceiversParams{ HTTPClient: client, } } -/*GetReceiversParams contains all the parameters to send to the API endpoint -for the get receivers operation typically these are written to a http.Request +/* GetReceiversParams contains all the parameters to send to the API endpoint + for the get receivers operation. + + Typically these are written to a http.Request. */ type GetReceiversParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type GetReceiversParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get receivers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetReceiversParams) WithDefaults() *GetReceiversParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get receivers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetReceiversParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get receivers params func (o *GetReceiversParams) WithTimeout(timeout time.Duration) *GetReceiversParams { o.SetTimeout(timeout) diff --git a/api/alertmanager/amclient/receiver/get_receivers_responses.go b/api/alertmanager/amclient/receiver/get_receivers_responses.go index c0d7a42bff..0f5571704b 100644 --- a/api/alertmanager/amclient/receiver/get_receivers_responses.go +++ b/api/alertmanager/amclient/receiver/get_receivers_responses.go @@ -29,9 +29,8 @@ func (o *GetReceiversReader) ReadResponse(response runtime.ClientResponse, consu return nil, err } return result, nil - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -40,7 +39,7 @@ func NewGetReceiversOK() *GetReceiversOK { return &GetReceiversOK{} } -/*GetReceiversOK handles this case with default header values. +/* GetReceiversOK describes a response with status code 200, with default header values. Get receivers response */ @@ -51,7 +50,6 @@ type GetReceiversOK struct { func (o *GetReceiversOK) Error() string { return fmt.Sprintf("[GET /receivers][%d] getReceiversOK %+v", 200, o.Payload) } - func (o *GetReceiversOK) GetPayload() []*ammodels.Receiver { return o.Payload } diff --git a/api/alertmanager/amclient/receiver/receiver_client.go b/api/alertmanager/amclient/receiver/receiver_client.go index 490ce70d9d..2f5da6c4c2 100644 --- a/api/alertmanager/amclient/receiver/receiver_client.go +++ b/api/alertmanager/amclient/receiver/receiver_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - GetReceivers(params *GetReceiversParams) (*GetReceiversOK, error) + GetReceivers(params *GetReceiversParams, opts ...ClientOption) (*GetReceiversOK, error) SetTransport(transport runtime.ClientTransport) } @@ -35,13 +38,12 @@ type ClientService interface { /* GetReceivers Get list of all receivers (name of notification integrations) */ -func (a *Client) GetReceivers(params *GetReceiversParams) (*GetReceiversOK, error) { +func (a *Client) GetReceivers(params *GetReceiversParams, opts ...ClientOption) (*GetReceiversOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetReceiversParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getReceivers", Method: "GET", PathPattern: "/receivers", @@ -52,7 +54,12 @@ func (a *Client) GetReceivers(params *GetReceiversParams) (*GetReceiversOK, erro Reader: &GetReceiversReader{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 } diff --git a/api/alertmanager/amclient/silence/delete_silence_parameters.go b/api/alertmanager/amclient/silence/delete_silence_parameters.go index fda98d7160..358dc68b65 100644 --- a/api/alertmanager/amclient/silence/delete_silence_parameters.go +++ b/api/alertmanager/amclient/silence/delete_silence_parameters.go @@ -16,53 +16,54 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteSilenceParams creates a new DeleteSilenceParams object -// with the default values initialized. +// NewDeleteSilenceParams creates a new DeleteSilenceParams 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 NewDeleteSilenceParams() *DeleteSilenceParams { - var () return &DeleteSilenceParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteSilenceParamsWithTimeout creates a new DeleteSilenceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteSilenceParamsWithTimeout(timeout time.Duration) *DeleteSilenceParams { - var () return &DeleteSilenceParams{ - timeout: timeout, } } // NewDeleteSilenceParamsWithContext creates a new DeleteSilenceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteSilenceParamsWithContext(ctx context.Context) *DeleteSilenceParams { - var () return &DeleteSilenceParams{ - Context: ctx, } } // NewDeleteSilenceParamsWithHTTPClient creates a new DeleteSilenceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteSilenceParamsWithHTTPClient(client *http.Client) *DeleteSilenceParams { - var () return &DeleteSilenceParams{ HTTPClient: client, } } -/*DeleteSilenceParams contains all the parameters to send to the API endpoint -for the delete silence operation typically these are written to a http.Request +/* DeleteSilenceParams contains all the parameters to send to the API endpoint + for the delete silence operation. + + Typically these are written to a http.Request. */ type DeleteSilenceParams struct { - /*SilenceID - ID of the silence to get + /* SilenceID. + + ID of the silence to get + Format: uuid */ SilenceID strfmt.UUID @@ -71,6 +72,21 @@ type DeleteSilenceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete silence params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSilenceParams) WithDefaults() *DeleteSilenceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete silence params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSilenceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete silence params func (o *DeleteSilenceParams) WithTimeout(timeout time.Duration) *DeleteSilenceParams { o.SetTimeout(timeout) diff --git a/api/alertmanager/amclient/silence/delete_silence_responses.go b/api/alertmanager/amclient/silence/delete_silence_responses.go index f6a00ab20d..90badd69de 100644 --- a/api/alertmanager/amclient/silence/delete_silence_responses.go +++ b/api/alertmanager/amclient/silence/delete_silence_responses.go @@ -33,9 +33,8 @@ func (o *DeleteSilenceReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -44,7 +43,7 @@ func NewDeleteSilenceOK() *DeleteSilenceOK { return &DeleteSilenceOK{} } -/*DeleteSilenceOK handles this case with default header values. +/* DeleteSilenceOK describes a response with status code 200, with default header values. Delete silence response */ @@ -65,7 +64,7 @@ func NewDeleteSilenceInternalServerError() *DeleteSilenceInternalServerError { return &DeleteSilenceInternalServerError{} } -/*DeleteSilenceInternalServerError handles this case with default header values. +/* DeleteSilenceInternalServerError describes a response with status code 500, with default header values. Internal server error */ @@ -76,7 +75,6 @@ type DeleteSilenceInternalServerError struct { func (o *DeleteSilenceInternalServerError) Error() string { return fmt.Sprintf("[DELETE /silence/{silenceID}][%d] deleteSilenceInternalServerError %+v", 500, o.Payload) } - func (o *DeleteSilenceInternalServerError) GetPayload() string { return o.Payload } diff --git a/api/alertmanager/amclient/silence/get_silence_parameters.go b/api/alertmanager/amclient/silence/get_silence_parameters.go index 249ec156af..907d00fd9c 100644 --- a/api/alertmanager/amclient/silence/get_silence_parameters.go +++ b/api/alertmanager/amclient/silence/get_silence_parameters.go @@ -16,53 +16,54 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetSilenceParams creates a new GetSilenceParams object -// with the default values initialized. +// NewGetSilenceParams creates a new GetSilenceParams 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 NewGetSilenceParams() *GetSilenceParams { - var () return &GetSilenceParams{ - timeout: cr.DefaultTimeout, } } // NewGetSilenceParamsWithTimeout creates a new GetSilenceParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetSilenceParamsWithTimeout(timeout time.Duration) *GetSilenceParams { - var () return &GetSilenceParams{ - timeout: timeout, } } // NewGetSilenceParamsWithContext creates a new GetSilenceParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetSilenceParamsWithContext(ctx context.Context) *GetSilenceParams { - var () return &GetSilenceParams{ - Context: ctx, } } // NewGetSilenceParamsWithHTTPClient creates a new GetSilenceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetSilenceParamsWithHTTPClient(client *http.Client) *GetSilenceParams { - var () return &GetSilenceParams{ HTTPClient: client, } } -/*GetSilenceParams contains all the parameters to send to the API endpoint -for the get silence operation typically these are written to a http.Request +/* GetSilenceParams contains all the parameters to send to the API endpoint + for the get silence operation. + + Typically these are written to a http.Request. */ type GetSilenceParams struct { - /*SilenceID - ID of the silence to get + /* SilenceID. + + ID of the silence to get + Format: uuid */ SilenceID strfmt.UUID @@ -71,6 +72,21 @@ type GetSilenceParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get silence params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSilenceParams) WithDefaults() *GetSilenceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get silence params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSilenceParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get silence params func (o *GetSilenceParams) WithTimeout(timeout time.Duration) *GetSilenceParams { o.SetTimeout(timeout) diff --git a/api/alertmanager/amclient/silence/get_silence_responses.go b/api/alertmanager/amclient/silence/get_silence_responses.go index 65a3d382d2..ceb9b9aa9e 100644 --- a/api/alertmanager/amclient/silence/get_silence_responses.go +++ b/api/alertmanager/amclient/silence/get_silence_responses.go @@ -41,9 +41,8 @@ func (o *GetSilenceReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewGetSilenceOK() *GetSilenceOK { return &GetSilenceOK{} } -/*GetSilenceOK handles this case with default header values. +/* GetSilenceOK describes a response with status code 200, with default header values. Get silence response */ @@ -63,7 +62,6 @@ type GetSilenceOK struct { func (o *GetSilenceOK) Error() string { return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceOK %+v", 200, o.Payload) } - func (o *GetSilenceOK) GetPayload() *ammodels.GettableSilence { return o.Payload } @@ -85,7 +83,7 @@ func NewGetSilenceNotFound() *GetSilenceNotFound { return &GetSilenceNotFound{} } -/*GetSilenceNotFound handles this case with default header values. +/* GetSilenceNotFound describes a response with status code 404, with default header values. A silence with the specified ID was not found */ @@ -106,7 +104,7 @@ func NewGetSilenceInternalServerError() *GetSilenceInternalServerError { return &GetSilenceInternalServerError{} } -/*GetSilenceInternalServerError handles this case with default header values. +/* GetSilenceInternalServerError describes a response with status code 500, with default header values. Internal server error */ @@ -117,7 +115,6 @@ type GetSilenceInternalServerError struct { func (o *GetSilenceInternalServerError) Error() string { return fmt.Sprintf("[GET /silence/{silenceID}][%d] getSilenceInternalServerError %+v", 500, o.Payload) } - func (o *GetSilenceInternalServerError) GetPayload() string { return o.Payload } diff --git a/api/alertmanager/amclient/silence/get_silences_parameters.go b/api/alertmanager/amclient/silence/get_silences_parameters.go index c1d50ff4ce..d6aa61045c 100644 --- a/api/alertmanager/amclient/silence/get_silences_parameters.go +++ b/api/alertmanager/amclient/silence/get_silences_parameters.go @@ -17,53 +17,52 @@ import ( "github.com/go-openapi/swag" ) -// NewGetSilencesParams creates a new GetSilencesParams object -// with the default values initialized. +// NewGetSilencesParams creates a new GetSilencesParams 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 NewGetSilencesParams() *GetSilencesParams { - var () return &GetSilencesParams{ - timeout: cr.DefaultTimeout, } } // NewGetSilencesParamsWithTimeout creates a new GetSilencesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetSilencesParamsWithTimeout(timeout time.Duration) *GetSilencesParams { - var () return &GetSilencesParams{ - timeout: timeout, } } // NewGetSilencesParamsWithContext creates a new GetSilencesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetSilencesParamsWithContext(ctx context.Context) *GetSilencesParams { - var () return &GetSilencesParams{ - Context: ctx, } } // NewGetSilencesParamsWithHTTPClient creates a new GetSilencesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetSilencesParamsWithHTTPClient(client *http.Client) *GetSilencesParams { - var () return &GetSilencesParams{ HTTPClient: client, } } -/*GetSilencesParams contains all the parameters to send to the API endpoint -for the get silences operation typically these are written to a http.Request +/* GetSilencesParams contains all the parameters to send to the API endpoint + for the get silences operation. + + Typically these are written to a http.Request. */ type GetSilencesParams struct { - /*Filter - A list of matchers to filter silences by + /* Filter. + A list of matchers to filter silences by */ Filter []string @@ -72,6 +71,21 @@ type GetSilencesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get silences params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSilencesParams) WithDefaults() *GetSilencesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get silences params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSilencesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get silences params func (o *GetSilencesParams) WithTimeout(timeout time.Duration) *GetSilencesParams { o.SetTimeout(timeout) @@ -124,12 +138,15 @@ func (o *GetSilencesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R } var res []error - valuesFilter := o.Filter + if o.Filter != nil { - joinedFilter := swag.JoinByFormat(valuesFilter, "multi") - // query array param filter - if err := r.SetQueryParam("filter", joinedFilter...); err != nil { - return err + // binding items for filter + joinedFilter := o.bindParamFilter(reg) + + // query array param filter + if err := r.SetQueryParam("filter", joinedFilter...); err != nil { + return err + } } if len(res) > 0 { @@ -137,3 +154,20 @@ func (o *GetSilencesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R } return nil } + +// bindParamGetSilences binds the parameter filter +func (o *GetSilencesParams) bindParamFilter(formats strfmt.Registry) []string { + filterIR := o.Filter + + var filterIC []string + for _, filterIIR := range filterIR { // explode []string + + filterIIV := filterIIR // string as string + filterIC = append(filterIC, filterIIV) + } + + // items.CollectionFormat: "multi" + filterIS := swag.JoinByFormat(filterIC, "multi") + + return filterIS +} diff --git a/api/alertmanager/amclient/silence/get_silences_responses.go b/api/alertmanager/amclient/silence/get_silences_responses.go index c217771a10..b7a2896fd9 100644 --- a/api/alertmanager/amclient/silence/get_silences_responses.go +++ b/api/alertmanager/amclient/silence/get_silences_responses.go @@ -35,9 +35,8 @@ func (o *GetSilencesReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -46,7 +45,7 @@ func NewGetSilencesOK() *GetSilencesOK { return &GetSilencesOK{} } -/*GetSilencesOK handles this case with default header values. +/* GetSilencesOK describes a response with status code 200, with default header values. Get silences response */ @@ -57,7 +56,6 @@ type GetSilencesOK struct { func (o *GetSilencesOK) Error() string { return fmt.Sprintf("[GET /silences][%d] getSilencesOK %+v", 200, o.Payload) } - func (o *GetSilencesOK) GetPayload() ammodels.GettableSilences { return o.Payload } @@ -77,7 +75,7 @@ func NewGetSilencesInternalServerError() *GetSilencesInternalServerError { return &GetSilencesInternalServerError{} } -/*GetSilencesInternalServerError handles this case with default header values. +/* GetSilencesInternalServerError describes a response with status code 500, with default header values. Internal server error */ @@ -88,7 +86,6 @@ type GetSilencesInternalServerError struct { func (o *GetSilencesInternalServerError) Error() string { return fmt.Sprintf("[GET /silences][%d] getSilencesInternalServerError %+v", 500, o.Payload) } - func (o *GetSilencesInternalServerError) GetPayload() string { return o.Payload } diff --git a/api/alertmanager/amclient/silence/post_silences_parameters.go b/api/alertmanager/amclient/silence/post_silences_parameters.go index 7ef427f797..8ce84f8991 100644 --- a/api/alertmanager/amclient/silence/post_silences_parameters.go +++ b/api/alertmanager/amclient/silence/post_silences_parameters.go @@ -18,53 +18,52 @@ import ( "github.com/percona/pmm/api/alertmanager/ammodels" ) -// NewPostSilencesParams creates a new PostSilencesParams object -// with the default values initialized. +// NewPostSilencesParams creates a new PostSilencesParams 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 NewPostSilencesParams() *PostSilencesParams { - var () return &PostSilencesParams{ - timeout: cr.DefaultTimeout, } } // NewPostSilencesParamsWithTimeout creates a new PostSilencesParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPostSilencesParamsWithTimeout(timeout time.Duration) *PostSilencesParams { - var () return &PostSilencesParams{ - timeout: timeout, } } // NewPostSilencesParamsWithContext creates a new PostSilencesParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPostSilencesParamsWithContext(ctx context.Context) *PostSilencesParams { - var () return &PostSilencesParams{ - Context: ctx, } } // NewPostSilencesParamsWithHTTPClient creates a new PostSilencesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPostSilencesParamsWithHTTPClient(client *http.Client) *PostSilencesParams { - var () return &PostSilencesParams{ HTTPClient: client, } } -/*PostSilencesParams contains all the parameters to send to the API endpoint -for the post silences operation typically these are written to a http.Request +/* PostSilencesParams contains all the parameters to send to the API endpoint + for the post silences operation. + + Typically these are written to a http.Request. */ type PostSilencesParams struct { - /*Silence - The silence to create + /* Silence. + The silence to create */ Silence *ammodels.PostableSilence @@ -73,6 +72,21 @@ type PostSilencesParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the post silences params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostSilencesParams) WithDefaults() *PostSilencesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post silences params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostSilencesParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the post silences params func (o *PostSilencesParams) WithTimeout(timeout time.Duration) *PostSilencesParams { o.SetTimeout(timeout) @@ -124,7 +138,6 @@ func (o *PostSilencesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. return err } var res []error - if o.Silence != nil { if err := r.SetBodyParam(o.Silence); err != nil { return err diff --git a/api/alertmanager/amclient/silence/post_silences_responses.go b/api/alertmanager/amclient/silence/post_silences_responses.go index a5d2a7e42b..c6f426d45f 100644 --- a/api/alertmanager/amclient/silence/post_silences_responses.go +++ b/api/alertmanager/amclient/silence/post_silences_responses.go @@ -6,6 +6,7 @@ package silence // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" @@ -40,9 +41,8 @@ func (o *PostSilencesReader) ReadResponse(response runtime.ClientResponse, consu return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -51,7 +51,7 @@ func NewPostSilencesOK() *PostSilencesOK { return &PostSilencesOK{} } -/*PostSilencesOK handles this case with default header values. +/* PostSilencesOK describes a response with status code 200, with default header values. Create / update silence response */ @@ -62,7 +62,6 @@ type PostSilencesOK struct { func (o *PostSilencesOK) Error() string { return fmt.Sprintf("[POST /silences][%d] postSilencesOK %+v", 200, o.Payload) } - func (o *PostSilencesOK) GetPayload() *PostSilencesOKBody { return o.Payload } @@ -84,7 +83,7 @@ func NewPostSilencesBadRequest() *PostSilencesBadRequest { return &PostSilencesBadRequest{} } -/*PostSilencesBadRequest handles this case with default header values. +/* PostSilencesBadRequest describes a response with status code 400, with default header values. Bad request */ @@ -95,7 +94,6 @@ type PostSilencesBadRequest struct { func (o *PostSilencesBadRequest) Error() string { return fmt.Sprintf("[POST /silences][%d] postSilencesBadRequest %+v", 400, o.Payload) } - func (o *PostSilencesBadRequest) GetPayload() string { return o.Payload } @@ -115,7 +113,7 @@ func NewPostSilencesNotFound() *PostSilencesNotFound { return &PostSilencesNotFound{} } -/*PostSilencesNotFound handles this case with default header values. +/* PostSilencesNotFound describes a response with status code 404, with default header values. A silence with the specified ID was not found */ @@ -126,7 +124,6 @@ type PostSilencesNotFound struct { func (o *PostSilencesNotFound) Error() string { return fmt.Sprintf("[POST /silences][%d] postSilencesNotFound %+v", 404, o.Payload) } - func (o *PostSilencesNotFound) GetPayload() string { return o.Payload } @@ -155,6 +152,11 @@ func (o *PostSilencesOKBody) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this post silences o k body based on context it is used +func (o *PostSilencesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *PostSilencesOKBody) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/api/alertmanager/amclient/silence/silence_client.go b/api/alertmanager/amclient/silence/silence_client.go index ddebc436bc..b22e163cf5 100644 --- a/api/alertmanager/amclient/silence/silence_client.go +++ b/api/alertmanager/amclient/silence/silence_client.go @@ -25,15 +25,18 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - DeleteSilence(params *DeleteSilenceParams) (*DeleteSilenceOK, error) + DeleteSilence(params *DeleteSilenceParams, opts ...ClientOption) (*DeleteSilenceOK, error) - GetSilence(params *GetSilenceParams) (*GetSilenceOK, error) + GetSilence(params *GetSilenceParams, opts ...ClientOption) (*GetSilenceOK, error) - GetSilences(params *GetSilencesParams) (*GetSilencesOK, error) + GetSilences(params *GetSilencesParams, opts ...ClientOption) (*GetSilencesOK, error) - PostSilences(params *PostSilencesParams) (*PostSilencesOK, error) + PostSilences(params *PostSilencesParams, opts ...ClientOption) (*PostSilencesOK, error) SetTransport(transport runtime.ClientTransport) } @@ -41,13 +44,12 @@ type ClientService interface { /* DeleteSilence Delete a silence by its ID */ -func (a *Client) DeleteSilence(params *DeleteSilenceParams) (*DeleteSilenceOK, error) { +func (a *Client) DeleteSilence(params *DeleteSilenceParams, opts ...ClientOption) (*DeleteSilenceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteSilenceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteSilence", Method: "DELETE", PathPattern: "/silence/{silenceID}", @@ -58,7 +60,12 @@ func (a *Client) DeleteSilence(params *DeleteSilenceParams) (*DeleteSilenceOK, e Reader: &DeleteSilenceReader{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 } @@ -75,13 +82,12 @@ func (a *Client) DeleteSilence(params *DeleteSilenceParams) (*DeleteSilenceOK, e /* GetSilence Get a silence by its ID */ -func (a *Client) GetSilence(params *GetSilenceParams) (*GetSilenceOK, error) { +func (a *Client) GetSilence(params *GetSilenceParams, opts ...ClientOption) (*GetSilenceOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetSilenceParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getSilence", Method: "GET", PathPattern: "/silence/{silenceID}", @@ -92,7 +98,12 @@ func (a *Client) GetSilence(params *GetSilenceParams) (*GetSilenceOK, error) { Reader: &GetSilenceReader{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 } @@ -109,13 +120,12 @@ func (a *Client) GetSilence(params *GetSilenceParams) (*GetSilenceOK, error) { /* GetSilences Get a list of silences */ -func (a *Client) GetSilences(params *GetSilencesParams) (*GetSilencesOK, error) { +func (a *Client) GetSilences(params *GetSilencesParams, opts ...ClientOption) (*GetSilencesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetSilencesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getSilences", Method: "GET", PathPattern: "/silences", @@ -126,7 +136,12 @@ func (a *Client) GetSilences(params *GetSilencesParams) (*GetSilencesOK, error) Reader: &GetSilencesReader{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 } @@ -143,13 +158,12 @@ func (a *Client) GetSilences(params *GetSilencesParams) (*GetSilencesOK, error) /* PostSilences Post a new silence or update an existing one */ -func (a *Client) PostSilences(params *PostSilencesParams) (*PostSilencesOK, error) { +func (a *Client) PostSilences(params *PostSilencesParams, opts ...ClientOption) (*PostSilencesOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPostSilencesParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "postSilences", Method: "POST", PathPattern: "/silences", @@ -160,7 +174,12 @@ func (a *Client) PostSilences(params *PostSilencesParams) (*PostSilencesOK, erro Reader: &PostSilencesReader{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 } diff --git a/api/alertmanager/ammodels/alert.go b/api/alertmanager/ammodels/alert.go index 0392a7435a..c285ee068a 100644 --- a/api/alertmanager/ammodels/alert.go +++ b/api/alertmanager/ammodels/alert.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -45,7 +47,6 @@ func (m *Alert) Validate(formats strfmt.Registry) error { } func (m *Alert) validateGeneratorURL(formats strfmt.Registry) error { - if swag.IsZero(m.GeneratorURL) { // not required return nil } @@ -59,9 +60,45 @@ func (m *Alert) validateGeneratorURL(formats strfmt.Registry) error { func (m *Alert) validateLabels(formats strfmt.Registry) error { - if err := m.Labels.Validate(formats); err != nil { + if err := validate.Required("labels", "body", m.Labels); err != nil { + return err + } + + if m.Labels != nil { + if err := m.Labels.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("labels") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("labels") + } + return err + } + } + + return nil +} + +// ContextValidate validate this alert based on the context it is used +func (m *Alert) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateLabels(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Alert) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Labels.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("labels") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("labels") } return err } diff --git a/api/alertmanager/ammodels/alert_group.go b/api/alertmanager/ammodels/alert_group.go index 83f1be4e6c..c8006eab14 100644 --- a/api/alertmanager/ammodels/alert_group.go +++ b/api/alertmanager/ammodels/alert_group.go @@ -6,6 +6,7 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -69,6 +70,8 @@ func (m *AlertGroup) validateAlerts(formats strfmt.Registry) error { if err := m.Alerts[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("alerts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("alerts" + "." + strconv.Itoa(i)) } return err } @@ -81,13 +84,21 @@ func (m *AlertGroup) validateAlerts(formats strfmt.Registry) error { func (m *AlertGroup) validateLabels(formats strfmt.Registry) error { - if err := m.Labels.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("labels") - } + if err := validate.Required("labels", "body", m.Labels); err != nil { return err } + if m.Labels != nil { + if err := m.Labels.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("labels") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("labels") + } + return err + } + } + return nil } @@ -101,6 +112,80 @@ func (m *AlertGroup) validateReceiver(formats strfmt.Registry) error { if err := m.Receiver.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("receiver") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receiver") + } + return err + } + } + + return nil +} + +// ContextValidate validate this alert group based on the context it is used +func (m *AlertGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAlerts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLabels(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReceiver(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AlertGroup) contextValidateAlerts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Alerts); i++ { + + if m.Alerts[i] != nil { + if err := m.Alerts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("alerts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("alerts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AlertGroup) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Labels.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("labels") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("labels") + } + return err + } + + return nil +} + +func (m *AlertGroup) contextValidateReceiver(ctx context.Context, formats strfmt.Registry) error { + + if m.Receiver != nil { + if err := m.Receiver.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receiver") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receiver") } return err } diff --git a/api/alertmanager/ammodels/alert_groups.go b/api/alertmanager/ammodels/alert_groups.go index 30270f749f..35b05c9efb 100644 --- a/api/alertmanager/ammodels/alert_groups.go +++ b/api/alertmanager/ammodels/alert_groups.go @@ -6,6 +6,7 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -31,6 +32,33 @@ func (m AlertGroups) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this alert groups based on the context it is used +func (m AlertGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/api/alertmanager/ammodels/alert_status.go b/api/alertmanager/ammodels/alert_status.go index 9793aa2f65..2b7538aaf3 100644 --- a/api/alertmanager/ammodels/alert_status.go +++ b/api/alertmanager/ammodels/alert_status.go @@ -6,6 +6,7 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -119,6 +120,11 @@ func (m *AlertStatus) validateState(formats strfmt.Registry) error { return nil } +// ContextValidate validates this alert status based on context it is used +func (m *AlertStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *AlertStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/alertmanager_config.go b/api/alertmanager/ammodels/alertmanager_config.go index edc791e55d..c2dd51af8b 100644 --- a/api/alertmanager/ammodels/alertmanager_config.go +++ b/api/alertmanager/ammodels/alertmanager_config.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -45,6 +47,11 @@ func (m *AlertmanagerConfig) validateOriginal(formats strfmt.Registry) error { return nil } +// ContextValidate validates this alertmanager config based on context it is used +func (m *AlertmanagerConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *AlertmanagerConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/alertmanager_status.go b/api/alertmanager/ammodels/alertmanager_status.go index 0c3c36e001..b9f3d691ad 100644 --- a/api/alertmanager/ammodels/alertmanager_status.go +++ b/api/alertmanager/ammodels/alertmanager_status.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -71,6 +73,8 @@ func (m *AlertmanagerStatus) validateCluster(formats strfmt.Registry) error { if err := m.Cluster.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cluster") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") } return err } @@ -89,6 +93,8 @@ func (m *AlertmanagerStatus) validateConfig(formats strfmt.Registry) error { if err := m.Config.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("config") } return err } @@ -120,6 +126,78 @@ func (m *AlertmanagerStatus) validateVersionInfo(formats strfmt.Registry) error if err := m.VersionInfo.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("versionInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("versionInfo") + } + return err + } + } + + return nil +} + +// ContextValidate validate this alertmanager status based on the context it is used +func (m *AlertmanagerStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCluster(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVersionInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AlertmanagerStatus) contextValidateCluster(ctx context.Context, formats strfmt.Registry) error { + + if m.Cluster != nil { + if err := m.Cluster.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +func (m *AlertmanagerStatus) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.Config != nil { + if err := m.Config.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("config") + } + return err + } + } + + return nil +} + +func (m *AlertmanagerStatus) contextValidateVersionInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.VersionInfo != nil { + if err := m.VersionInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("versionInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("versionInfo") } return err } diff --git a/api/alertmanager/ammodels/cluster_status.go b/api/alertmanager/ammodels/cluster_status.go index 87a7158f5b..051ebfed8e 100644 --- a/api/alertmanager/ammodels/cluster_status.go +++ b/api/alertmanager/ammodels/cluster_status.go @@ -6,6 +6,7 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "strconv" @@ -51,7 +52,6 @@ func (m *ClusterStatus) Validate(formats strfmt.Registry) error { } func (m *ClusterStatus) validatePeers(formats strfmt.Registry) error { - if swag.IsZero(m.Peers) { // not required return nil } @@ -65,6 +65,8 @@ func (m *ClusterStatus) validatePeers(formats strfmt.Registry) error { if err := m.Peers[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("peers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peers" + "." + strconv.Itoa(i)) } return err } @@ -121,6 +123,40 @@ func (m *ClusterStatus) validateStatus(formats strfmt.Registry) error { return nil } +// ContextValidate validate this cluster status based on the context it is used +func (m *ClusterStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePeers(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterStatus) contextValidatePeers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Peers); i++ { + + if m.Peers[i] != nil { + if err := m.Peers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("peers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("peers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ClusterStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/gettable_alert.go b/api/alertmanager/ammodels/gettable_alert.go index 13a28bbab1..a51da43879 100644 --- a/api/alertmanager/ammodels/gettable_alert.go +++ b/api/alertmanager/ammodels/gettable_alert.go @@ -6,6 +6,7 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -192,13 +193,21 @@ func (m *GettableAlert) Validate(formats strfmt.Registry) error { func (m *GettableAlert) validateAnnotations(formats strfmt.Registry) error { - if err := m.Annotations.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("annotations") - } + if err := validate.Required("annotations", "body", m.Annotations); err != nil { return err } + if m.Annotations != nil { + if err := m.Annotations.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("annotations") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("annotations") + } + return err + } + } + return nil } @@ -239,6 +248,8 @@ func (m *GettableAlert) validateReceivers(formats strfmt.Registry) error { if err := m.Receivers[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("receivers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receivers" + "." + strconv.Itoa(i)) } return err } @@ -272,6 +283,8 @@ func (m *GettableAlert) validateStatus(formats strfmt.Registry) error { if err := m.Status.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") } return err } @@ -293,6 +306,83 @@ func (m *GettableAlert) validateUpdatedAt(formats strfmt.Registry) error { return nil } +// ContextValidate validate this gettable alert based on the context it is used +func (m *GettableAlert) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAnnotations(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReceivers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + // validation for a type composition with Alert + if err := m.Alert.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GettableAlert) contextValidateAnnotations(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Annotations.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("annotations") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("annotations") + } + return err + } + + return nil +} + +func (m *GettableAlert) contextValidateReceivers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Receivers); i++ { + + if m.Receivers[i] != nil { + if err := m.Receivers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receivers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("receivers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *GettableAlert) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *GettableAlert) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/gettable_alerts.go b/api/alertmanager/ammodels/gettable_alerts.go index c733ddf796..abbb6e2941 100644 --- a/api/alertmanager/ammodels/gettable_alerts.go +++ b/api/alertmanager/ammodels/gettable_alerts.go @@ -6,6 +6,7 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -31,6 +32,33 @@ func (m GettableAlerts) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this gettable alerts based on the context it is used +func (m GettableAlerts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/api/alertmanager/ammodels/gettable_silence.go b/api/alertmanager/ammodels/gettable_silence.go index 6271e47338..1a19941f71 100644 --- a/api/alertmanager/ammodels/gettable_silence.go +++ b/api/alertmanager/ammodels/gettable_silence.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -141,6 +143,8 @@ func (m *GettableSilence) validateStatus(formats strfmt.Registry) error { if err := m.Status.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") } return err } @@ -162,6 +166,41 @@ func (m *GettableSilence) validateUpdatedAt(formats strfmt.Registry) error { return nil } +// ContextValidate validate this gettable silence based on the context it is used +func (m *GettableSilence) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + // validation for a type composition with Silence + if err := m.Silence.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GettableSilence) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *GettableSilence) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/gettable_silences.go b/api/alertmanager/ammodels/gettable_silences.go index eb46c9fb13..0528f03aaf 100644 --- a/api/alertmanager/ammodels/gettable_silences.go +++ b/api/alertmanager/ammodels/gettable_silences.go @@ -6,6 +6,7 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -31,6 +32,33 @@ func (m GettableSilences) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this gettable silences based on the context it is used +func (m GettableSilences) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/api/alertmanager/ammodels/label_set.go b/api/alertmanager/ammodels/label_set.go index 35601490c1..2112083a00 100644 --- a/api/alertmanager/ammodels/label_set.go +++ b/api/alertmanager/ammodels/label_set.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -18,3 +20,8 @@ type LabelSet map[string]string func (m LabelSet) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this label set based on context it is used +func (m LabelSet) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/api/alertmanager/ammodels/matcher.go b/api/alertmanager/ammodels/matcher.go index 052888a5de..108f02179e 100644 --- a/api/alertmanager/ammodels/matcher.go +++ b/api/alertmanager/ammodels/matcher.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -79,6 +81,11 @@ func (m *Matcher) validateValue(formats strfmt.Registry) error { return nil } +// ContextValidate validates this matcher based on context it is used +func (m *Matcher) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Matcher) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/matchers.go b/api/alertmanager/ammodels/matchers.go index 57aa62d473..9980f461d1 100644 --- a/api/alertmanager/ammodels/matchers.go +++ b/api/alertmanager/ammodels/matchers.go @@ -6,6 +6,7 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -38,6 +39,33 @@ func (m Matchers) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this matchers based on the context it is used +func (m Matchers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/api/alertmanager/ammodels/peer_status.go b/api/alertmanager/ammodels/peer_status.go index 9534228af1..0c48be4177 100644 --- a/api/alertmanager/ammodels/peer_status.go +++ b/api/alertmanager/ammodels/peer_status.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -62,6 +64,11 @@ func (m *PeerStatus) validateName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this peer status based on context it is used +func (m *PeerStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PeerStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/postable_alert.go b/api/alertmanager/ammodels/postable_alert.go index b89b4e2eb2..27e90b17f1 100644 --- a/api/alertmanager/ammodels/postable_alert.go +++ b/api/alertmanager/ammodels/postable_alert.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -126,11 +128,15 @@ func (m *PostableAlert) validateAnnotations(formats strfmt.Registry) error { return nil } - if err := m.Annotations.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("annotations") + if m.Annotations != nil { + if err := m.Annotations.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("annotations") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("annotations") + } + return err } - return err } return nil @@ -162,6 +168,39 @@ func (m *PostableAlert) validateStartsAt(formats strfmt.Registry) error { return nil } +// ContextValidate validate this postable alert based on the context it is used +func (m *PostableAlert) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAnnotations(ctx, formats); err != nil { + res = append(res, err) + } + + // validation for a type composition with Alert + if err := m.Alert.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PostableAlert) contextValidateAnnotations(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Annotations.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("annotations") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("annotations") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *PostableAlert) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/postable_alerts.go b/api/alertmanager/ammodels/postable_alerts.go index 8ccf37f17d..9a1c77dea3 100644 --- a/api/alertmanager/ammodels/postable_alerts.go +++ b/api/alertmanager/ammodels/postable_alerts.go @@ -6,6 +6,7 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -31,6 +32,33 @@ func (m PostableAlerts) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this postable alerts based on the context it is used +func (m PostableAlerts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/api/alertmanager/ammodels/postable_silence.go b/api/alertmanager/ammodels/postable_silence.go index c8c2f13b89..51f7afe0aa 100644 --- a/api/alertmanager/ammodels/postable_silence.go +++ b/api/alertmanager/ammodels/postable_silence.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -83,6 +85,21 @@ func (m *PostableSilence) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validate this postable silence based on the context it is used +func (m *PostableSilence) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with Silence + if err := m.Silence.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + // MarshalBinary interface implementation func (m *PostableSilence) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/receiver.go b/api/alertmanager/ammodels/receiver.go index bc74eeddb7..70d536db53 100644 --- a/api/alertmanager/ammodels/receiver.go +++ b/api/alertmanager/ammodels/receiver.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -45,6 +47,11 @@ func (m *Receiver) validateName(formats strfmt.Registry) error { return nil } +// ContextValidate validates this receiver based on context it is used +func (m *Receiver) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Receiver) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/silence.go b/api/alertmanager/ammodels/silence.go index 1869586be8..d61568011c 100644 --- a/api/alertmanager/ammodels/silence.go +++ b/api/alertmanager/ammodels/silence.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -110,6 +112,8 @@ func (m *Silence) validateMatchers(formats strfmt.Registry) error { if err := m.Matchers.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("matchers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matchers") } return err } @@ -130,6 +134,34 @@ func (m *Silence) validateStartsAt(formats strfmt.Registry) error { return nil } +// ContextValidate validate this silence based on the context it is used +func (m *Silence) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMatchers(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Silence) contextValidateMatchers(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Matchers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("matchers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("matchers") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *Silence) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/silence_status.go b/api/alertmanager/ammodels/silence_status.go index 8a853cd7b7..e1a1586ad9 100644 --- a/api/alertmanager/ammodels/silence_status.go +++ b/api/alertmanager/ammodels/silence_status.go @@ -6,6 +6,7 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "encoding/json" "github.com/go-openapi/errors" @@ -85,6 +86,11 @@ func (m *SilenceStatus) validateState(formats strfmt.Registry) error { return nil } +// ContextValidate validates this silence status based on context it is used +func (m *SilenceStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *SilenceStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/alertmanager/ammodels/version_info.go b/api/alertmanager/ammodels/version_info.go index dde1770467..038791f980 100644 --- a/api/alertmanager/ammodels/version_info.go +++ b/api/alertmanager/ammodels/version_info.go @@ -6,6 +6,8 @@ package ammodels // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -130,6 +132,11 @@ func (m *VersionInfo) validateVersion(formats strfmt.Registry) error { return nil } +// ContextValidate validates this version info based on context it is used +func (m *VersionInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VersionInfo) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/api/platformpb/json/client/platform/connect_parameters.go b/api/platformpb/json/client/platform/connect_parameters.go new file mode 100644 index 0000000000..5046f838b3 --- /dev/null +++ b/api/platformpb/json/client/platform/connect_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// 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/platformpb/json/client/platform/connect_responses.go b/api/platformpb/json/client/platform/connect_responses.go new file mode 100644 index 0000000000..2c7a2b0de5 --- /dev/null +++ b/api/platformpb/json/client/platform/connect_responses.go @@ -0,0 +1,312 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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) (interface{}, 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 interface{} +} + +func (o *ConnectOK) Error() string { + return fmt.Sprintf("[POST /v1/Platform/Connect][%d] connectOk %+v", 200, o.Payload) +} +func (o *ConnectOK) GetPayload() interface{} { + 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 && 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 +} + +// Code gets the status code for the connect default response +func (o *ConnectDefault) Code() int { + return o._statusCode +} + +func (o *ConnectDefault) Error() string { + return fmt.Sprintf("[POST /v1/Platform/Connect][%d] Connect default %+v", o._statusCode, o.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 && 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"` + + // Existing Percona Platform user's email. + Email string `json:"email,omitempty"` + + // Existing Percona Platform user's password. + Password string `json:"password,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 { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Connect default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Connect default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/platformpb/json/client/platform/disconnect_parameters.go b/api/platformpb/json/client/platform/disconnect_parameters.go new file mode 100644 index 0000000000..8dda4fbad1 --- /dev/null +++ b/api/platformpb/json/client/platform/disconnect_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// 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 interface{} + + 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 interface{}) *DisconnectParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the disconnect params +func (o *DisconnectParams) SetBody(body interface{}) { + 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 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/platformpb/json/client/platform/disconnect_responses.go b/api/platformpb/json/client/platform/disconnect_responses.go new file mode 100644 index 0000000000..f4b537bb1a --- /dev/null +++ b/api/platformpb/json/client/platform/disconnect_responses.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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) (interface{}, 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 interface{} +} + +func (o *DisconnectOK) Error() string { + return fmt.Sprintf("[POST /v1/Platform/Disconnect][%d] disconnectOk %+v", 200, o.Payload) +} +func (o *DisconnectOK) GetPayload() interface{} { + 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 && 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 +} + +// Code gets the status code for the disconnect default response +func (o *DisconnectDefault) Code() int { + return o._statusCode +} + +func (o *DisconnectDefault) Error() string { + return fmt.Sprintf("[POST /v1/Platform/Disconnect][%d] Disconnect default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*DisconnectDefaultBody disconnect default body +swagger:model DisconnectDefaultBody +*/ +type DisconnectDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Disconnect default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Disconnect default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/platformpb/json/client/platform/platform_client.go b/api/platformpb/json/client/platform/platform_client.go new file mode 100644 index 0000000000..113239c324 --- /dev/null +++ b/api/platformpb/json/client/platform/platform_client.go @@ -0,0 +1,283 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// 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" + "github.com/go-openapi/strfmt" +) + +// New creates a new platform API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for platform API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for 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) + + 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 + + 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) { + // TODO: Validate the params 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 + } + success, ok := result.(*ConnectOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ConnectDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + Disconnect disconnects + + Disconnect a PMM server from the organization created on Percona Portal. +*/ +func (a *Client) Disconnect(params *DisconnectParams, opts ...ClientOption) (*DisconnectOK, error) { + // TODO: Validate the params 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 + } + success, ok := result.(*DisconnectOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DisconnectDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + SearchOrganizationEntitlements searches organization entitlements + + SearchOrganizationEntitlements fetches details of the entitlement's available to the Portal organization that the PMM server is connected to. +*/ +func (a *Client) SearchOrganizationEntitlements(params *SearchOrganizationEntitlementsParams, opts ...ClientOption) (*SearchOrganizationEntitlementsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSearchOrganizationEntitlementsParams() + } + op := &runtime.ClientOperation{ + ID: "SearchOrganizationEntitlements", + Method: "POST", + PathPattern: "/v1/Platform/SearchOrganizationEntitlements", + 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 + } + success, ok := result.(*SearchOrganizationEntitlementsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SearchOrganizationEntitlementsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + SearchOrganizationTickets searches organization tickets + + SearchOrganizationTickets searches 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) { + // TODO: Validate the params before sending + if params == nil { + params = NewSearchOrganizationTicketsParams() + } + op := &runtime.ClientOperation{ + ID: "SearchOrganizationTickets", + Method: "POST", + PathPattern: "/v1/Platform/SearchOrganizationTickets", + 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 + } + success, ok := result.(*SearchOrganizationTicketsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SearchOrganizationTicketsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + ServerInfo servers info + + ServerInfo returns PMM server ID and name. +*/ +func (a *Client) ServerInfo(params *ServerInfoParams, opts ...ClientOption) (*ServerInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewServerInfoParams() + } + op := &runtime.ClientOperation{ + ID: "ServerInfo", + Method: "POST", + PathPattern: "/v1/Platform/ServerInfo", + 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 + } + success, ok := result.(*ServerInfoOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ServerInfoDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + UserStatus users status + + UserStatus returns a boolean indicating whether the current user is logged in with their Percona Account or not. +*/ +func (a *Client) UserStatus(params *UserStatusParams, opts ...ClientOption) (*UserStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUserStatusParams() + } + op := &runtime.ClientOperation{ + ID: "UserStatus", + Method: "POST", + PathPattern: "/v1/Platform/UserStatus", + 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 + } + success, ok := result.(*UserStatusOK) + if ok { + return success, nil + } + // unexpected success response + 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/platformpb/json/client/platform/search_organization_entitlements_parameters.go b/api/platformpb/json/client/platform/search_organization_entitlements_parameters.go new file mode 100644 index 0000000000..036dd0c9ab --- /dev/null +++ b/api/platformpb/json/client/platform/search_organization_entitlements_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// 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 { + + // Body. + Body interface{} + + 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 +} + +// WithBody adds the body to the search organization entitlements params +func (o *SearchOrganizationEntitlementsParams) WithBody(body interface{}) *SearchOrganizationEntitlementsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the search organization entitlements params +func (o *SearchOrganizationEntitlementsParams) SetBody(body interface{}) { + o.Body = body +} + +// 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 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/platformpb/json/client/platform/search_organization_entitlements_responses.go b/api/platformpb/json/client/platform/search_organization_entitlements_responses.go new file mode 100644 index 0000000000..3fc00550eb --- /dev/null +++ b/api/platformpb/json/client/platform/search_organization_entitlements_responses.go @@ -0,0 +1,566 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "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) (interface{}, 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 +} + +func (o *SearchOrganizationEntitlementsOK) Error() string { + return fmt.Sprintf("[POST /v1/Platform/SearchOrganizationEntitlements][%d] searchOrganizationEntitlementsOk %+v", 200, o.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 && 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 +} + +// 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 { + return fmt.Sprintf("[POST /v1/Platform/SearchOrganizationEntitlements][%d] SearchOrganizationEntitlements default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*SearchOrganizationEntitlementsDefaultBody search organization entitlements default body +swagger:model SearchOrganizationEntitlementsDefaultBody +*/ +type SearchOrganizationEntitlementsDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SearchOrganizationEntitlements default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SearchOrganizationEntitlements default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("searchOrganizationEntitlementsOk" + "." + "entitlements" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Entitlements[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("searchOrganizationEntitlementsOk" + "." + "entitlements" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("platform") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Platform.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("platform") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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/platformpb/json/client/platform/search_organization_tickets_parameters.go b/api/platformpb/json/client/platform/search_organization_tickets_parameters.go new file mode 100644 index 0000000000..e283101ca0 --- /dev/null +++ b/api/platformpb/json/client/platform/search_organization_tickets_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// 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 { + + // Body. + Body interface{} + + 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 +} + +// WithBody adds the body to the search organization tickets params +func (o *SearchOrganizationTicketsParams) WithBody(body interface{}) *SearchOrganizationTicketsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the search organization tickets params +func (o *SearchOrganizationTicketsParams) SetBody(body interface{}) { + o.Body = body +} + +// 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 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/platformpb/json/client/platform/search_organization_tickets_responses.go b/api/platformpb/json/client/platform/search_organization_tickets_responses.go new file mode 100644 index 0000000000..22e05728eb --- /dev/null +++ b/api/platformpb/json/client/platform/search_organization_tickets_responses.go @@ -0,0 +1,453 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "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) (interface{}, 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 +} + +func (o *SearchOrganizationTicketsOK) Error() string { + return fmt.Sprintf("[POST /v1/Platform/SearchOrganizationTickets][%d] searchOrganizationTicketsOk %+v", 200, o.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 && 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 +} + +// 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 { + return fmt.Sprintf("[POST /v1/Platform/SearchOrganizationTickets][%d] SearchOrganizationTickets default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*SearchOrganizationTicketsDefaultBody search organization tickets default body +swagger:model SearchOrganizationTicketsDefaultBody +*/ +type SearchOrganizationTicketsDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SearchOrganizationTickets default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SearchOrganizationTickets default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("searchOrganizationTicketsOk" + "." + "tickets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Tickets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("searchOrganizationTicketsOk" + "." + "tickets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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/platformpb/json/client/platform/server_info_parameters.go b/api/platformpb/json/client/platform/server_info_parameters.go new file mode 100644 index 0000000000..54b44a2fc9 --- /dev/null +++ b/api/platformpb/json/client/platform/server_info_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// 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 { + + // Body. + Body interface{} + + 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 +} + +// WithBody adds the body to the server info params +func (o *ServerInfoParams) WithBody(body interface{}) *ServerInfoParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the server info params +func (o *ServerInfoParams) SetBody(body interface{}) { + o.Body = body +} + +// 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 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/platformpb/json/client/platform/server_info_responses.go b/api/platformpb/json/client/platform/server_info_responses.go new file mode 100644 index 0000000000..4c76b80fe5 --- /dev/null +++ b/api/platformpb/json/client/platform/server_info_responses.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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) (interface{}, 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 +} + +func (o *ServerInfoOK) Error() string { + return fmt.Sprintf("[POST /v1/Platform/ServerInfo][%d] serverInfoOk %+v", 200, o.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 && 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 +} + +// Code gets the status code for the server info default response +func (o *ServerInfoDefault) Code() int { + return o._statusCode +} + +func (o *ServerInfoDefault) Error() string { + return fmt.Sprintf("[POST /v1/Platform/ServerInfo][%d] ServerInfo default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*ServerInfoDefaultBody server info default body +swagger:model ServerInfoDefaultBody +*/ +type ServerInfoDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ServerInfo default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ServerInfo default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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"` +} + +// 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/platformpb/json/client/platform/user_status_parameters.go b/api/platformpb/json/client/platform/user_status_parameters.go new file mode 100644 index 0000000000..22c2d376d4 --- /dev/null +++ b/api/platformpb/json/client/platform/user_status_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// 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 { + + // Body. + Body interface{} + + 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 +} + +// WithBody adds the body to the user status params +func (o *UserStatusParams) WithBody(body interface{}) *UserStatusParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the user status params +func (o *UserStatusParams) SetBody(body interface{}) { + o.Body = body +} + +// 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 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/platformpb/json/client/platform/user_status_responses.go b/api/platformpb/json/client/platform/user_status_responses.go new file mode 100644 index 0000000000..0c3c48a62b --- /dev/null +++ b/api/platformpb/json/client/platform/user_status_responses.go @@ -0,0 +1,305 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package platform + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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) (interface{}, 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 +} + +func (o *UserStatusOK) Error() string { + return fmt.Sprintf("[POST /v1/Platform/UserStatus][%d] userStatusOk %+v", 200, o.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 && 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 +} + +// Code gets the status code for the user status default response +func (o *UserStatusDefault) Code() int { + return o._statusCode +} + +func (o *UserStatusDefault) Error() string { + return fmt.Sprintf("[POST /v1/Platform/UserStatus][%d] UserStatus default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*UserStatusDefaultBody user status default body +swagger:model UserStatusDefaultBody +*/ +type UserStatusDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UserStatus default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UserStatus default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/platformpb/json/client/pmm_platform_api_client.go b/api/platformpb/json/client/pmm_platform_api_client.go new file mode 100644 index 0000000000..6c5bed4fdd --- /dev/null +++ b/api/platformpb/json/client/pmm_platform_api_client.go @@ -0,0 +1,112 @@ +// 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/platformpb/json/client/platform" +) + +// 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.Platform = platform.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 { + Platform platform.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.Platform.SetTransport(transport) +} diff --git a/api/platformpb/json/platformpb.json b/api/platformpb/json/platformpb.json new file mode 100644 index 0000000000..9f5afad744 --- /dev/null +++ b/api/platformpb/json/platformpb.json @@ -0,0 +1,601 @@ +{ + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "https", + "http" + ], + "swagger": "2.0", + "info": { + "title": "PMM Platform API", + "version": "v0" + }, + "paths": { + "/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": [ + "Platform" + ], + "summary": "Connect", + "operationId": "Connect", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "email": { + "description": "Existing Percona Platform user's email.", + "type": "string", + "x-order": 1 + }, + "password": { + "description": "Existing Percona Platform user's password.", + "type": "string", + "x-order": 2 + }, + "personal_access_token": { + "description": "Personal Access Token that the user obtains from Percona Portal.", + "type": "string", + "x-order": 3 + }, + "server_name": { + "description": "User defined human readable PMM Server Name.", + "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": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "error": { + "type": "string", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/Platform/Disconnect": { + "post": { + "description": "Disconnect a PMM server from the organization created on Percona Portal.", + "tags": [ + "Platform" + ], + "summary": "Disconnect", + "operationId": "Disconnect", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "error": { + "type": "string", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/Platform/SearchOrganizationEntitlements": { + "post": { + "description": "SearchOrganizationEntitlements fetches details of the entitlement's available to the Portal organization that the PMM server is connected to.", + "tags": [ + "Platform" + ], + "summary": "SearchOrganizationEntitlements", + "operationId": "SearchOrganizationEntitlements", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "entitlements": { + "type": "array", + "items": { + "description": "OrganizationEntitlement contains information about Organization entitlement.", + "type": "object", + "properties": { + "end_date": { + "description": "Entitlement end date.\nNote: only date is used here but not time.", + "type": "string", + "format": "date-time", + "x-order": 9 + }, + "name": { + "description": "Entitlement name.", + "type": "string", + "x-order": 1 + }, + "number": { + "description": "Entitlement number.", + "type": "string", + "x-order": 0 + }, + "platform": { + "description": "Platform indicates platform specific entitlements.", + "type": "object", + "properties": { + "config_advisor": { + "description": "Flag indicates that config advisors are covered by this entitlement.", + "type": "string", + "x-order": 1 + }, + "security_advisor": { + "description": "Flag indicates that security advisors are covered by this entitlement.", + "type": "string", + "x-order": 0 + } + } + }, + "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 + }, + "summary": { + "description": "Entitlement short summary.", + "type": "string", + "x-order": 2 + }, + "support_level": { + "description": "Support level covered by this entitlement.", + "type": "string", + "x-order": 6 + }, + "tier": { + "description": "Entitlement tier.", + "type": "string", + "x-order": 3 + }, + "total_units": { + "description": "Total units covered by this entitlement.", + "type": "string", + "x-order": 4 + }, + "unlimited_units": { + "description": "Flag indicates that unlimited units are covered.", + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "error": { + "type": "string", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/Platform/SearchOrganizationTickets": { + "post": { + "description": "SearchOrganizationTickets searches support tickets belonging to the Percona Portal Organization that the PMM server is connected to.", + "tags": [ + "Platform" + ], + "summary": "SearchOrganizationTickets", + "operationId": "SearchOrganizationTickets", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "create_time": { + "description": "Ticket creation time.", + "type": "string", + "format": "date-time", + "x-order": 4 + }, + "department": { + "description": "Department.", + "type": "string", + "x-order": 5 + }, + "number": { + "description": "Ticket number.", + "type": "string", + "x-order": 0 + }, + "priority": { + "description": "Ticket priority.", + "type": "string", + "x-order": 2 + }, + "requester": { + "description": "Ticket requester.", + "type": "string", + "x-order": 6 + }, + "short_description": { + "description": "Ticket short description.", + "type": "string", + "x-order": 1 + }, + "state": { + "description": "Ticket state.", + "type": "string", + "x-order": 3 + }, + "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": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "error": { + "type": "string", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/Platform/ServerInfo": { + "post": { + "description": "ServerInfo returns PMM server ID and name.", + "tags": [ + "Platform" + ], + "summary": "ServerInfo", + "operationId": "ServerInfo", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "pmm_server_id": { + "type": "string", + "x-order": 1 + }, + "pmm_server_name": { + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "error": { + "type": "string", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/Platform/UserStatus": { + "post": { + "description": "UserStatus returns a boolean indicating whether the current user is logged in with their Percona Account or not.", + "tags": [ + "Platform" + ], + "summary": "UserStatus", + "operationId": "UserStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "error": { + "type": "string", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/api/qanpb/json/client/filters/filters_client.go b/api/qanpb/json/client/filters/filters_client.go new file mode 100644 index 0000000000..9d615cb922 --- /dev/null +++ b/api/qanpb/json/client/filters/filters_client.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package filters + +// 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" + "github.com/go-openapi/strfmt" +) + +// New creates a new filters API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for filters API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + Get(params *GetParams, opts ...ClientOption) (*GetOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + Get gets gets map of metrics names +*/ +func (a *Client) Get(params *GetParams, opts ...ClientOption) (*GetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetParams() + } + op := &runtime.ClientOperation{ + ID: "Get", + Method: "POST", + PathPattern: "/v0/qan/Filters/Get", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/qanpb/json/client/filters/get_parameters.go b/api/qanpb/json/client/filters/get_parameters.go new file mode 100644 index 0000000000..ce9161f6b7 --- /dev/null +++ b/api/qanpb/json/client/filters/get_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package filters + +// 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" +) + +// NewGetParams creates a new GetParams 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 NewGetParams() *GetParams { + return &GetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetParamsWithTimeout creates a new GetParams object +// with the ability to set a timeout on a request. +func NewGetParamsWithTimeout(timeout time.Duration) *GetParams { + return &GetParams{ + timeout: timeout, + } +} + +// NewGetParamsWithContext creates a new GetParams object +// with the ability to set a context for a request. +func NewGetParamsWithContext(ctx context.Context) *GetParams { + return &GetParams{ + Context: ctx, + } +} + +// NewGetParamsWithHTTPClient creates a new GetParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetParamsWithHTTPClient(client *http.Client) *GetParams { + return &GetParams{ + HTTPClient: client, + } +} + +/* GetParams contains all the parameters to send to the API endpoint + for the get operation. + + Typically these are written to a http.Request. +*/ +type GetParams struct { + + // Body. + Body GetBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetParams) WithDefaults() *GetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get params +func (o *GetParams) WithTimeout(timeout time.Duration) *GetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get params +func (o *GetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get params +func (o *GetParams) WithContext(ctx context.Context) *GetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get params +func (o *GetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get params +func (o *GetParams) WithHTTPClient(client *http.Client) *GetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get params +func (o *GetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the get params +func (o *GetParams) WithBody(body GetBody) *GetParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the get params +func (o *GetParams) SetBody(body GetBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *GetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/qanpb/json/client/filters/get_responses.go b/api/qanpb/json/client/filters/get_responses.go new file mode 100644 index 0000000000..94bc30fc99 --- /dev/null +++ b/api/qanpb/json/client/filters/get_responses.go @@ -0,0 +1,694 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package filters + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetReader is a Reader for the Get structure. +type GetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetDefault(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 + } +} + +// NewGetOK creates a GetOK with default headers values +func NewGetOK() *GetOK { + return &GetOK{} +} + +/* GetOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type GetOK struct { + Payload *GetOKBody +} + +func (o *GetOK) Error() string { + return fmt.Sprintf("[POST /v0/qan/Filters/Get][%d] getOk %+v", 200, o.Payload) +} +func (o *GetOK) GetPayload() *GetOKBody { + return o.Payload +} + +func (o *GetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(GetOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDefault creates a GetDefault with default headers values +func NewGetDefault(code int) *GetDefault { + return &GetDefault{ + _statusCode: code, + } +} + +/* GetDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type GetDefault struct { + _statusCode int + + Payload *GetDefaultBody +} + +// Code gets the status code for the get default response +func (o *GetDefault) Code() int { + return o._statusCode +} + +func (o *GetDefault) Error() string { + return fmt.Sprintf("[POST /v0/qan/Filters/Get][%d] Get default %+v", o._statusCode, o.Payload) +} +func (o *GetDefault) GetPayload() *GetDefaultBody { + return o.Payload +} + +func (o *GetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(GetDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*GetBody FiltersRequest contains period for which we need filters. +swagger:model GetBody +*/ +type GetBody 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 []*GetParamsBodyLabelsItems0 `json:"labels"` +} + +// Validate validates this get body +func (o *GetBody) 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 *GetBody) 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 *GetBody) 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 *GetBody) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get body based on the context it is used +func (o *GetBody) 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 *GetBody) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Labels); i++ { + + if o.Labels[i] != nil { + if err := o.Labels[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *GetBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetBody) UnmarshalBinary(b []byte) error { + var res GetBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetDefaultBody get default body +swagger:model GetDefaultBody +*/ +type GetDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*GetDefaultBodyDetailsItems0 `json:"details"` +} + +// Validate validates this get default body +func (o *GetDefaultBody) 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 *GetDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Get default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Get default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get default body based on the context it is used +func (o *GetDefaultBody) 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 *GetDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Details); i++ { + + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Get default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Get default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *GetDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetDefaultBody) UnmarshalBinary(b []byte) error { + var res GetDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetDefaultBodyDetailsItems0 get default body details items0 +swagger:model GetDefaultBodyDetailsItems0 +*/ +type GetDefaultBodyDetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this get default body details items0 +func (o *GetDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get default body details items0 based on context it is used +func (o *GetDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res GetDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetOKBody FiltersReply 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 GetOKBody +*/ +type GetOKBody struct { + + // labels + Labels map[string]GetOKBodyLabelsAnon `json:"labels,omitempty"` +} + +// Validate validates this get OK body +func (o *GetOKBody) 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 *GetOKBody) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getOk" + "." + "labels" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getOk" + "." + "labels" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get OK body based on the context it is used +func (o *GetOKBody) 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 *GetOKBody) 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 *GetOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetOKBody) UnmarshalBinary(b []byte) error { + var res GetOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetOKBodyLabelsAnon ListLabels is list of label's values: duplicates are impossible. +swagger:model GetOKBodyLabelsAnon +*/ +type GetOKBodyLabelsAnon struct { + + // name + Name []*GetOKBodyLabelsAnonNameItems0 `json:"name"` +} + +// Validate validates this get OK body labels anon +func (o *GetOKBodyLabelsAnon) 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 *GetOKBodyLabelsAnon) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("name" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this get OK body labels anon based on the context it is used +func (o *GetOKBodyLabelsAnon) 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 *GetOKBodyLabelsAnon) contextValidateName(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Name); i++ { + + if o.Name[i] != nil { + if err := o.Name[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("name" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *GetOKBodyLabelsAnon) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetOKBodyLabelsAnon) UnmarshalBinary(b []byte) error { + var res GetOKBodyLabelsAnon + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetOKBodyLabelsAnonNameItems0 Values is label values and main metric percent and per second. +swagger:model GetOKBodyLabelsAnonNameItems0 +*/ +type GetOKBodyLabelsAnonNameItems0 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 OK body labels anon name items0 +func (o *GetOKBodyLabelsAnonNameItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get OK body labels anon name items0 based on context it is used +func (o *GetOKBodyLabelsAnonNameItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetOKBodyLabelsAnonNameItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetOKBodyLabelsAnonNameItems0) UnmarshalBinary(b []byte) error { + var res GetOKBodyLabelsAnonNameItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetParamsBodyLabelsItems0 MapFieldEntry allows to pass labels/dimensions in form like {"server": ["db1", "db2"...]}. +swagger:model GetParamsBodyLabelsItems0 +*/ +type GetParamsBodyLabelsItems0 struct { + + // key + Key string `json:"key,omitempty"` + + // value + Value []string `json:"value"` +} + +// Validate validates this get params body labels items0 +func (o *GetParamsBodyLabelsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get params body labels items0 based on context it is used +func (o *GetParamsBodyLabelsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetParamsBodyLabelsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetParamsBodyLabelsItems0) UnmarshalBinary(b []byte) error { + var res GetParamsBodyLabelsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/qanpb/json/client/metrics_names/get_metrics_names_parameters.go b/api/qanpb/json/client/metrics_names/get_metrics_names_parameters.go new file mode 100644 index 0000000000..506d64f2a0 --- /dev/null +++ b/api/qanpb/json/client/metrics_names/get_metrics_names_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package metrics_names + +// 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. + Body interface{} + + 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 interface{}) *GetMetricsNamesParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the get metrics names params +func (o *GetMetricsNamesParams) SetBody(body interface{}) { + 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/qanpb/json/client/metrics_names/get_metrics_names_responses.go b/api/qanpb/json/client/metrics_names/get_metrics_names_responses.go new file mode 100644 index 0000000000..c666fde90f --- /dev/null +++ b/api/qanpb/json/client/metrics_names/get_metrics_names_responses.go @@ -0,0 +1,307 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package metrics_names + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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) (interface{}, 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 +} + +func (o *GetMetricsNamesOK) Error() string { + return fmt.Sprintf("[POST /v0/qan/GetMetricsNames][%d] getMetricsNamesOk %+v", 200, o.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 && 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 +} + +// 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 { + return fmt.Sprintf("[POST /v0/qan/GetMetricsNames][%d] GetMetricsNames default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*GetMetricsNamesDefaultBody get metrics names default body +swagger:model GetMetricsNamesDefaultBody +*/ +type GetMetricsNamesDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetMetricsNames default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetMetricsNames default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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/qanpb/json/client/metrics_names/metrics_names_client.go b/api/qanpb/json/client/metrics_names/metrics_names_client.go new file mode 100644 index 0000000000..07cf9f5b4b --- /dev/null +++ b/api/qanpb/json/client/metrics_names/metrics_names_client.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package metrics_names + +// 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" + "github.com/go-openapi/strfmt" +) + +// New creates a new metrics names API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for metrics names API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetMetricsNames(params *GetMetricsNamesParams, opts ...ClientOption) (*GetMetricsNamesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetMetricsNames gets metrics names gets map of metrics names +*/ +func (a *Client) GetMetricsNames(params *GetMetricsNamesParams, opts ...ClientOption) (*GetMetricsNamesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMetricsNamesParams() + } + op := &runtime.ClientOperation{ + ID: "GetMetricsNames", + Method: "POST", + PathPattern: "/v0/qan/GetMetricsNames", + 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 + } + success, ok := result.(*GetMetricsNamesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetMetricsNamesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/qanpb/json/client/object_details/get_histogram_parameters.go b/api/qanpb/json/client/object_details/get_histogram_parameters.go new file mode 100644 index 0000000000..83d4b061e1 --- /dev/null +++ b/api/qanpb/json/client/object_details/get_histogram_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// 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. + 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/qanpb/json/client/object_details/get_histogram_responses.go b/api/qanpb/json/client/object_details/get_histogram_responses.go new file mode 100644 index 0000000000..7d866b6185 --- /dev/null +++ b/api/qanpb/json/client/object_details/get_histogram_responses.go @@ -0,0 +1,594 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "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) (interface{}, 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 +} + +func (o *GetHistogramOK) Error() string { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetHistogram][%d] getHistogramOk %+v", 200, o.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 && 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 +} + +// Code gets the status code for the get histogram default response +func (o *GetHistogramDefault) Code() int { + return o._statusCode +} + +func (o *GetHistogramDefault) Error() string { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetHistogram][%d] GetHistogram default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*GetHistogramBody HistogramRequest 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Labels[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetHistogram default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetHistogram default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 HistogramReply 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getHistogramOk" + "." + "histogram_items" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.HistogramItems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getHistogramOk" + "." + "histogram_items" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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/qanpb/json/client/object_details/get_labels_parameters.go b/api/qanpb/json/client/object_details/get_labels_parameters.go new file mode 100644 index 0000000000..1fd7bd9025 --- /dev/null +++ b/api/qanpb/json/client/object_details/get_labels_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// 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. + 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/qanpb/json/client/object_details/get_labels_responses.go b/api/qanpb/json/client/object_details/get_labels_responses.go new file mode 100644 index 0000000000..970e26d17f --- /dev/null +++ b/api/qanpb/json/client/object_details/get_labels_responses.go @@ -0,0 +1,488 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "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) (interface{}, 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 +} + +func (o *GetLabelsOK) Error() string { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetLabels][%d] getLabelsOk %+v", 200, o.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 && 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 +} + +// Code gets the status code for the get labels default response +func (o *GetLabelsDefault) Code() int { + return o._statusCode +} + +func (o *GetLabelsDefault) Error() string { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetLabels][%d] GetLabels default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*GetLabelsBody ObjectDetailsLabelsRequest 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 { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetLabels default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetLabels default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 ObjectDetailsLabelsReply 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getLabelsOk" + "." + "labels" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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/qanpb/json/client/object_details/get_metrics_parameters.go b/api/qanpb/json/client/object_details/get_metrics_parameters.go new file mode 100644 index 0000000000..cdb86a72e4 --- /dev/null +++ b/api/qanpb/json/client/object_details/get_metrics_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// 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. + 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/qanpb/json/client/object_details/get_metrics_responses.go b/api/qanpb/json/client/object_details/get_metrics_responses.go new file mode 100644 index 0000000000..77b141b56b --- /dev/null +++ b/api/qanpb/json/client/object_details/get_metrics_responses.go @@ -0,0 +1,1019 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "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) (interface{}, 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 +} + +func (o *GetMetricsOK) Error() string { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetMetrics][%d] getMetricsOk %+v", 200, o.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 && 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 +} + +// Code gets the status code for the get metrics default response +func (o *GetMetricsDefault) Code() int { + return o._statusCode +} + +func (o *GetMetricsDefault) Error() string { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetMetrics][%d] GetMetrics default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*GetMetricsBody MetricsRequest 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Labels[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetMetrics default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetMetrics default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 MetricsReply 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"` +} + +// 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 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getMetricsOk" + "." + "metrics" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getMetricsOk" + "." + "sparkline" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getMetricsOk" + "." + "totals" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("getMetricsOk" + "." + "totals" + "." + k) + } + 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 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 err := o.Sparkline[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getMetricsOk" + "." + "sparkline" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 +} + +// 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 +} + +/*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"` + + // Boolean metrics: + // - *_sum_per_sec - how many times this matric was true. + // + // 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"` + + // MongoDB metrics. + // + // 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"` + + // PostgreSQL metrics. + // + // 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 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"` + + // pg_stat_monitor 0.9 metrics + // + // 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/qanpb/json/client/object_details/get_query_example_parameters.go b/api/qanpb/json/client/object_details/get_query_example_parameters.go new file mode 100644 index 0000000000..8db3256d3d --- /dev/null +++ b/api/qanpb/json/client/object_details/get_query_example_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// 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. + 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/qanpb/json/client/object_details/get_query_example_responses.go b/api/qanpb/json/client/object_details/get_query_example_responses.go new file mode 100644 index 0000000000..86695d435d --- /dev/null +++ b/api/qanpb/json/client/object_details/get_query_example_responses.go @@ -0,0 +1,736 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// 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) (interface{}, 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 +} + +func (o *GetQueryExampleOK) Error() string { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetQueryExample][%d] getQueryExampleOk %+v", 200, o.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 && 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 +} + +// 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 { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetQueryExample][%d] GetQueryExample default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*GetQueryExampleBody QueryExampleRequest 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Labels[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetQueryExample default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetQueryExample default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 QueryExampleReply 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getQueryExampleOk" + "." + "query_examples" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.QueryExamples[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getQueryExampleOk" + "." + "query_examples" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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"` + + // is truncated + IsTruncated int64 `json:"is_truncated,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"` + + // ExampleFormat is format of query example: real or query without values. + // + // Deprecated: is not used, should not be used, should be removed. + // Enum: [EXAMPLE_FORMAT_INVALID EXAMPLE FINGERPRINT] + ExampleFormat *string `json:"example_format,omitempty"` + + // ExampleType is a type of query example selected for this query class in given period of time. + // Enum: [EXAMPLE_TYPE_INVALID RANDOM SLOWEST FASTEST WITH_ERROR] + ExampleType *string `json:"example_type,omitempty"` +} + +// 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.validateExampleFormat(formats); err != nil { + res = append(res, err) + } + + if err := o.validateExampleType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var getQueryExampleOkBodyQueryExamplesItems0TypeExampleFormatPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EXAMPLE_FORMAT_INVALID","EXAMPLE","FINGERPRINT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + getQueryExampleOkBodyQueryExamplesItems0TypeExampleFormatPropEnum = append(getQueryExampleOkBodyQueryExamplesItems0TypeExampleFormatPropEnum, v) + } +} + +const ( + + // GetQueryExampleOKBodyQueryExamplesItems0ExampleFormatEXAMPLEFORMATINVALID captures enum value "EXAMPLE_FORMAT_INVALID" + GetQueryExampleOKBodyQueryExamplesItems0ExampleFormatEXAMPLEFORMATINVALID string = "EXAMPLE_FORMAT_INVALID" + + // GetQueryExampleOKBodyQueryExamplesItems0ExampleFormatEXAMPLE captures enum value "EXAMPLE" + GetQueryExampleOKBodyQueryExamplesItems0ExampleFormatEXAMPLE string = "EXAMPLE" + + // GetQueryExampleOKBodyQueryExamplesItems0ExampleFormatFINGERPRINT captures enum value "FINGERPRINT" + GetQueryExampleOKBodyQueryExamplesItems0ExampleFormatFINGERPRINT string = "FINGERPRINT" +) + +// prop value enum +func (o *GetQueryExampleOKBodyQueryExamplesItems0) validateExampleFormatEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, getQueryExampleOkBodyQueryExamplesItems0TypeExampleFormatPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *GetQueryExampleOKBodyQueryExamplesItems0) validateExampleFormat(formats strfmt.Registry) error { + if swag.IsZero(o.ExampleFormat) { // not required + return nil + } + + // value enum + if err := o.validateExampleFormatEnum("example_format", "body", *o.ExampleFormat); err != nil { + return err + } + + return nil +} + +var getQueryExampleOkBodyQueryExamplesItems0TypeExampleTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EXAMPLE_TYPE_INVALID","RANDOM","SLOWEST","FASTEST","WITH_ERROR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + getQueryExampleOkBodyQueryExamplesItems0TypeExampleTypePropEnum = append(getQueryExampleOkBodyQueryExamplesItems0TypeExampleTypePropEnum, v) + } +} + +const ( + + // GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPEINVALID captures enum value "EXAMPLE_TYPE_INVALID" + GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeEXAMPLETYPEINVALID string = "EXAMPLE_TYPE_INVALID" + + // GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeRANDOM captures enum value "RANDOM" + GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeRANDOM string = "RANDOM" + + // GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeSLOWEST captures enum value "SLOWEST" + GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeSLOWEST string = "SLOWEST" + + // GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeFASTEST captures enum value "FASTEST" + GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeFASTEST string = "FASTEST" + + // GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeWITHERROR captures enum value "WITH_ERROR" + GetQueryExampleOKBodyQueryExamplesItems0ExampleTypeWITHERROR string = "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/qanpb/json/client/object_details/get_query_plan_parameters.go b/api/qanpb/json/client/object_details/get_query_plan_parameters.go new file mode 100644 index 0000000000..c0ecdf2a4d --- /dev/null +++ b/api/qanpb/json/client/object_details/get_query_plan_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// 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 { + + // Body. + Body GetQueryPlanBody + + 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 +} + +// WithBody adds the body to the get query plan params +func (o *GetQueryPlanParams) WithBody(body GetQueryPlanBody) *GetQueryPlanParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the get query plan params +func (o *GetQueryPlanParams) SetBody(body GetQueryPlanBody) { + o.Body = body +} + +// 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 + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/qanpb/json/client/object_details/get_query_plan_responses.go b/api/qanpb/json/client/object_details/get_query_plan_responses.go new file mode 100644 index 0000000000..b72976907f --- /dev/null +++ b/api/qanpb/json/client/object_details/get_query_plan_responses.go @@ -0,0 +1,345 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// 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) (interface{}, 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 +} + +func (o *GetQueryPlanOK) Error() string { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetQueryPlan][%d] getQueryPlanOk %+v", 200, o.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 && 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 +} + +// 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 { + return fmt.Sprintf("[POST /v0/qan/ObjectDetails/GetQueryPlan][%d] GetQueryPlan default %+v", o._statusCode, o.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 && err != io.EOF { + return err + } + + return nil +} + +/*GetQueryPlanBody QueryPlanRequest defines filtering by queryid. +swagger:model GetQueryPlanBody +*/ +type GetQueryPlanBody struct { + + // queryid + Queryid string `json:"queryid,omitempty"` +} + +// Validate validates this get query plan body +func (o *GetQueryPlanBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get query plan body based on context it is used +func (o *GetQueryPlanBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *GetQueryPlanBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *GetQueryPlanBody) UnmarshalBinary(b []byte) error { + var res GetQueryPlanBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*GetQueryPlanDefaultBody get query plan default body +swagger:model GetQueryPlanDefaultBody +*/ +type GetQueryPlanDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetQueryPlan default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetQueryPlan default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 QueryPlanReply 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/qanpb/json/client/object_details/object_details_client.go b/api/qanpb/json/client/object_details/object_details_client.go new file mode 100644 index 0000000000..08c51ad07d --- /dev/null +++ b/api/qanpb/json/client/object_details/object_details_client.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package object_details + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new object details API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for object details API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetHistogram(params *GetHistogramParams, opts ...ClientOption) (*GetHistogramOK, error) + + GetLabels(params *GetLabelsParams, opts ...ClientOption) (*GetLabelsOK, error) + + GetMetrics(params *GetMetricsParams, opts ...ClientOption) (*GetMetricsOK, error) + + GetQueryExample(params *GetQueryExampleParams, opts ...ClientOption) (*GetQueryExampleOK, error) + + GetQueryPlan(params *GetQueryPlanParams, opts ...ClientOption) (*GetQueryPlanOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetHistogram gets histogram gets histogram items for specific filtering +*/ +func (a *Client) GetHistogram(params *GetHistogramParams, opts ...ClientOption) (*GetHistogramOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetHistogramParams() + } + op := &runtime.ClientOperation{ + ID: "GetHistogram", + Method: "POST", + PathPattern: "/v0/qan/ObjectDetails/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 + } + success, ok := result.(*GetHistogramOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetHistogramDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetLabels gets labels gets list of labels for object details +*/ +func (a *Client) GetLabels(params *GetLabelsParams, opts ...ClientOption) (*GetLabelsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetLabelsParams() + } + op := &runtime.ClientOperation{ + ID: "GetLabels", + Method: "POST", + PathPattern: "/v0/qan/ObjectDetails/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 + } + success, ok := result.(*GetLabelsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetLabelsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetMetrics gets metrics gets map of metrics for specific filtering +*/ +func (a *Client) GetMetrics(params *GetMetricsParams, opts ...ClientOption) (*GetMetricsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMetricsParams() + } + op := &runtime.ClientOperation{ + ID: "GetMetrics", + Method: "POST", + PathPattern: "/v0/qan/ObjectDetails/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 + } + success, ok := result.(*GetMetricsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetMetricsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetQueryExample gets query example gets list of query examples +*/ +func (a *Client) GetQueryExample(params *GetQueryExampleParams, opts ...ClientOption) (*GetQueryExampleOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetQueryExampleParams() + } + op := &runtime.ClientOperation{ + ID: "GetQueryExample", + Method: "POST", + PathPattern: "/v0/qan/ObjectDetails/GetQueryExample", + 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 + } + success, ok := result.(*GetQueryExampleOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetQueryExampleDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + GetQueryPlan gets query plan gets query plan and plan id for specific filtering +*/ +func (a *Client) GetQueryPlan(params *GetQueryPlanParams, opts ...ClientOption) (*GetQueryPlanOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetQueryPlanParams() + } + op := &runtime.ClientOperation{ + ID: "GetQueryPlan", + Method: "POST", + PathPattern: "/v0/qan/ObjectDetails/GetQueryPlan", + 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 + } + success, ok := result.(*GetQueryPlanOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetQueryPlanDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/qanpb/json/client/pmm_qan_api_client.go b/api/qanpb/json/client/pmm_qan_api_client.go new file mode 100644 index 0000000000..0824835916 --- /dev/null +++ b/api/qanpb/json/client/pmm_qan_api_client.go @@ -0,0 +1,127 @@ +// 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/qanpb/json/client/filters" + "github.com/percona/pmm/api/qanpb/json/client/metrics_names" + "github.com/percona/pmm/api/qanpb/json/client/object_details" + "github.com/percona/pmm/api/qanpb/json/client/profile" +) + +// 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.Filters = filters.New(transport, formats) + cli.MetricsNames = metrics_names.New(transport, formats) + cli.ObjectDetails = object_details.New(transport, formats) + cli.Profile = profile.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 { + Filters filters.ClientService + + MetricsNames metrics_names.ClientService + + ObjectDetails object_details.ClientService + + Profile profile.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.Filters.SetTransport(transport) + c.MetricsNames.SetTransport(transport) + c.ObjectDetails.SetTransport(transport) + c.Profile.SetTransport(transport) +} diff --git a/api/qanpb/json/client/profile/get_report_parameters.go b/api/qanpb/json/client/profile/get_report_parameters.go new file mode 100644 index 0000000000..d29a46b3d1 --- /dev/null +++ b/api/qanpb/json/client/profile/get_report_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package profile + +// 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. + 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/qanpb/json/client/profile/get_report_responses.go b/api/qanpb/json/client/profile/get_report_responses.go new file mode 100644 index 0000000000..3623e3281a --- /dev/null +++ b/api/qanpb/json/client/profile/get_report_responses.go @@ -0,0 +1,1133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package profile + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "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) (interface{}, 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 +} + +func (o *GetReportOK) Error() string { + return fmt.Sprintf("[POST /v0/qan/GetReport][%d] getReportOk %+v", 200, o.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 && 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 +} + +// Code gets the status code for the get report default response +func (o *GetReportDefault) Code() int { + return o._statusCode +} + +func (o *GetReportDefault) Error() string { + return fmt.Sprintf("[POST /v0/qan/GetReport][%d] GetReport default %+v", o._statusCode, o.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 && 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Labels[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "labels" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // error + Error string `json:"error,omitempty"` + + // 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetReport default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("GetReport default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getReportOk" + "." + "rows" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Rows[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("getReportOk" + "." + "rows" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("metrics" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sparkline" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Sparkline[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sparkline" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("stats") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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 err := o.Stats.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("stats") + } else if ce, ok := err.(*errors.CompositeError); ok { + 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"` + + // Boolean metrics: + // - *_sum_per_sec - how many times this matric was true. + // + // 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"` + + // MongoDB metrics. + // + // 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"` + + // PostgreSQL metrics. + // + // 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 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"` + + // pg_stat_monitor 0.9 metrics + // + // 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/qanpb/json/client/profile/profile_client.go b/api/qanpb/json/client/profile/profile_client.go new file mode 100644 index 0000000000..5c2d1f630b --- /dev/null +++ b/api/qanpb/json/client/profile/profile_client.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package profile + +// 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" + "github.com/go-openapi/strfmt" +) + +// New creates a new profile API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for profile API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetReport(params *GetReportParams, opts ...ClientOption) (*GetReportOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetReport gets report returns list of metrics group by queryid or other dimentions +*/ +func (a *Client) GetReport(params *GetReportParams, opts ...ClientOption) (*GetReportOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetReportParams() + } + op := &runtime.ClientOperation{ + ID: "GetReport", + Method: "POST", + PathPattern: "/v0/qan/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 + } + success, ok := result.(*GetReportOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetReportDefault) + 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/swagger/swagger-dev-only.json b/api/swagger/swagger-dev-only.json new file mode 100644 index 0000000000..144cd369eb --- /dev/null +++ b/api/swagger/swagger-dev-only.json @@ -0,0 +1,11740 @@ +{ + "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": { + "/v0/qan/Filters/Get": { + "post": { + "tags": [ + "Filters" + ], + "summary": "Get gets map of metrics names.", + "operationId": "Get", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "FiltersRequest 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": "FiltersReply 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/GetMetricsNames": { + "post": { + "tags": [ + "MetricsNames" + ], + "summary": "GetMetricsNames gets map of metrics names.", + "operationId": "GetMetricsNames", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "MetricsNamesRequest is emty.", + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/GetReport": { + "post": { + "tags": [ + "Profile" + ], + "summary": "GetReport returns list of metrics group by queryid or other dimentions.", + "operationId": "GetReport", + "parameters": [ + { + "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": 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": "Boolean metrics:\n- *_sum_per_sec - how many times this matric was true.\n\nQuery 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": "MongoDB metrics.\n\nThe 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_shared_blks_hit_sum_per_sec": { + "description": "PostgreSQL metrics.\n\nTotal number of shared block cache hits by the statement.", + "type": "number", + "format": "float", + "x-order": 43 + }, + "m_shared_blks_read_sum_per_sec": { + "description": "Total number of shared blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 44 + }, + "m_shared_blks_dirtied_sum_per_sec": { + "description": "Total number of shared blocks dirtied by the statement.", + "type": "number", + "format": "float", + "x-order": 45 + }, + "m_shared_blks_written_sum_per_sec": { + "description": "Total number of shared blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 46 + }, + "m_local_blks_hit_sum_per_sec": { + "description": "Total number of local block cache hits by the statement.", + "type": "number", + "format": "float", + "x-order": 47 + }, + "m_local_blks_read_sum_per_sec": { + "description": "Total number of local blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 48 + }, + "m_local_blks_dirtied_sum_per_sec": { + "description": "Total number of local blocks dirtied by the statement.", + "type": "number", + "format": "float", + "x-order": 49 + }, + "m_local_blks_written_sum_per_sec": { + "description": "Total number of local blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 50 + }, + "m_temp_blks_read_sum_per_sec": { + "description": "Total number of temp blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 51 + }, + "m_temp_blks_written_sum_per_sec": { + "description": "Total number of temp blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 52 + }, + "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": 53 + }, + "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": 54 + }, + "m_cpu_user_time_sum_per_sec": { + "description": "Total time user spent in query.", + "type": "number", + "format": "float", + "x-order": 55 + }, + "m_cpu_sys_time_sum_per_sec": { + "description": "Total time system spent in query.", + "type": "number", + "format": "float", + "x-order": 56 + }, + "m_plans_calls_sum_per_sec": { + "description": "Total number of planned calls.", + "type": "number", + "format": "float", + "title": "pg_stat_monitor 0.9 metrics", + "x-order": 57 + }, + "m_wal_records_sum_per_sec": { + "description": "Total number of WAL (Write-ahead logging) records.", + "type": "number", + "format": "float", + "x-order": 58 + }, + "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": 59 + }, + "m_wal_bytes_sum_per_sec": { + "description": "Total bytes of WAL (Write-ahead logging) records.", + "type": "number", + "format": "float", + "x-order": 60 + }, + "m_plan_time_sum_per_sec": { + "description": "Plan time in per seconds.", + "type": "number", + "format": "float", + "x-order": 61 + } + } + }, + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/ObjectDetails/GetHistogram": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "GetHistogram gets histogram items for specific filtering.", + "operationId": "GetHistogram", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "HistogramRequest 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": "HistogramReply 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/ObjectDetails/GetLabels": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "GetLabels gets list of labels for object details.", + "operationId": "GetLabels", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "ObjectDetailsLabelsRequest 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": "ObjectDetailsLabelsReply 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/ObjectDetails/GetMetrics": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "GetMetrics gets map of metrics for specific filtering.", + "operationId": "GetMetrics", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "MetricsRequest 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": "MetricsReply 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": "Boolean metrics:\n- *_sum_per_sec - how many times this matric was true.\n\nQuery 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": "MongoDB metrics.\n\nThe 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_shared_blks_hit_sum_per_sec": { + "description": "PostgreSQL metrics.\n\nTotal number of shared block cache hits by the statement.", + "type": "number", + "format": "float", + "x-order": 43 + }, + "m_shared_blks_read_sum_per_sec": { + "description": "Total number of shared blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 44 + }, + "m_shared_blks_dirtied_sum_per_sec": { + "description": "Total number of shared blocks dirtied by the statement.", + "type": "number", + "format": "float", + "x-order": 45 + }, + "m_shared_blks_written_sum_per_sec": { + "description": "Total number of shared blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 46 + }, + "m_local_blks_hit_sum_per_sec": { + "description": "Total number of local block cache hits by the statement.", + "type": "number", + "format": "float", + "x-order": 47 + }, + "m_local_blks_read_sum_per_sec": { + "description": "Total number of local blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 48 + }, + "m_local_blks_dirtied_sum_per_sec": { + "description": "Total number of local blocks dirtied by the statement.", + "type": "number", + "format": "float", + "x-order": 49 + }, + "m_local_blks_written_sum_per_sec": { + "description": "Total number of local blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 50 + }, + "m_temp_blks_read_sum_per_sec": { + "description": "Total number of temp blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 51 + }, + "m_temp_blks_written_sum_per_sec": { + "description": "Total number of temp blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 52 + }, + "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": 53 + }, + "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": 54 + }, + "m_cpu_user_time_sum_per_sec": { + "description": "Total time user spent in query.", + "type": "number", + "format": "float", + "x-order": 55 + }, + "m_cpu_sys_time_sum_per_sec": { + "description": "Total time system spent in query.", + "type": "number", + "format": "float", + "x-order": 56 + }, + "m_plans_calls_sum_per_sec": { + "description": "Total number of planned calls.", + "type": "number", + "format": "float", + "title": "pg_stat_monitor 0.9 metrics", + "x-order": 57 + }, + "m_wal_records_sum_per_sec": { + "description": "Total number of WAL (Write-ahead logging) records.", + "type": "number", + "format": "float", + "x-order": 58 + }, + "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": 59 + }, + "m_wal_bytes_sum_per_sec": { + "description": "Total bytes of WAL (Write-ahead logging) records.", + "type": "number", + "format": "float", + "x-order": 60 + }, + "m_plan_time_sum_per_sec": { + "description": "Plan time in per seconds.", + "type": "number", + "format": "float", + "x-order": 61 + } + } + }, + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/ObjectDetails/GetQueryExample": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "GetQueryExample gets list of query examples.", + "operationId": "GetQueryExample", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "QueryExampleRequest 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": "QueryExampleReply 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_format": { + "description": "ExampleFormat is format of query example: real or query without values.\n\nDeprecated: is not used, should not be used, should be removed.", + "type": "string", + "default": "EXAMPLE_FORMAT_INVALID", + "enum": [ + "EXAMPLE_FORMAT_INVALID", + "EXAMPLE", + "FINGERPRINT" + ] + }, + "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_INVALID", + "enum": [ + "EXAMPLE_TYPE_INVALID", + "RANDOM", + "SLOWEST", + "FASTEST", + "WITH_ERROR" + ] + }, + "is_truncated": { + "type": "integer", + "format": "int64", + "x-order": 3 + }, + "example_metrics": { + "type": "string", + "x-order": 4 + }, + "service_id": { + "type": "string", + "x-order": 5 + }, + "service_type": { + "type": "string", + "x-order": 6 + }, + "schema": { + "type": "string", + "x-order": 7 + }, + "tables": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 8 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/ObjectDetails/GetQueryPlan": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "GetQueryPlan gets query plan and plan id for specific filtering.", + "operationId": "GetQueryPlan", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "QueryPlanRequest defines filtering by queryid.", + "type": "object", + "properties": { + "queryid": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "description": "QueryPlanReply 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/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": [ + "Platform" + ], + "summary": "Connect", + "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 + }, + "email": { + "description": "Existing Percona Platform user's email.", + "type": "string", + "x-order": 1 + }, + "password": { + "description": "Existing Percona Platform user's password.", + "type": "string", + "x-order": 2 + }, + "personal_access_token": { + "description": "Personal Access Token that the user obtains from Percona Portal.", + "type": "string", + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Platform/Disconnect": { + "post": { + "description": "Disconnect a PMM server from the organization created on Percona Portal.", + "tags": [ + "Platform" + ], + "summary": "Disconnect", + "operationId": "Disconnect", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Platform/SearchOrganizationEntitlements": { + "post": { + "description": "SearchOrganizationEntitlements fetches details of the entitlement's available to the Portal organization that the PMM server is connected to.", + "tags": [ + "Platform" + ], + "summary": "SearchOrganizationEntitlements", + "operationId": "SearchOrganizationEntitlements", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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 + }, + "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-order": 0 + }, + "config_advisor": { + "description": "Flag indicates that config advisors are covered by this entitlement.", + "type": "string", + "x-order": 1 + } + } + }, + "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-order": 3 + }, + "total_units": { + "description": "Total units covered by this entitlement.", + "type": "string", + "x-order": 4 + }, + "unlimited_units": { + "description": "Flag indicates that unlimited units are covered.", + "type": "boolean", + "x-order": 5 + }, + "support_level": { + "description": "Support level covered by this entitlement.", + "type": "string", + "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 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Platform/SearchOrganizationTickets": { + "post": { + "description": "SearchOrganizationTickets searches support tickets belonging to the Percona Portal Organization that the PMM server is connected to.", + "tags": [ + "Platform" + ], + "summary": "SearchOrganizationTickets", + "operationId": "SearchOrganizationTickets", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Platform/ServerInfo": { + "post": { + "description": "ServerInfo returns PMM server ID and name.", + "tags": [ + "Platform" + ], + "summary": "ServerInfo", + "operationId": "ServerInfo", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Platform/UserStatus": { + "post": { + "description": "UserStatus returns a boolean indicating whether the current user is logged in with their Percona Account or not.", + "tags": [ + "Platform" + ], + "summary": "UserStatus", + "operationId": "UserStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/ChangePSMDB": { + "post": { + "tags": [ + "Components" + ], + "summary": "ChangePSMDBComponents manages PSMDB related components.", + "operationId": "ChangePSMDBComponents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "mongod": { + "description": "ChangeComponent contains fields to manage components.", + "type": "object", + "properties": { + "default_version": { + "type": "string", + "x-order": 0 + }, + "versions": { + "type": "array", + "items": { + "description": "ComponentVersion contains operations which should be done with component version.", + "type": "object", + "properties": { + "version": { + "type": "string", + "x-order": 0 + }, + "disable": { + "type": "boolean", + "x-order": 1 + }, + "enable": { + "type": "boolean", + "x-order": 2 + } + } + }, + "x-order": 1 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/ChangePXC": { + "post": { + "tags": [ + "Components" + ], + "summary": "ChangePXCComponents manages PXC related components.", + "operationId": "ChangePXCComponents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "haproxy": { + "description": "ChangeComponent contains fields to manage components.", + "type": "object", + "properties": { + "default_version": { + "type": "string", + "x-order": 0 + }, + "versions": { + "type": "array", + "items": { + "description": "ComponentVersion contains operations which should be done with component version.", + "type": "object", + "properties": { + "version": { + "type": "string", + "x-order": 0 + }, + "disable": { + "type": "boolean", + "x-order": 1 + }, + "enable": { + "type": "boolean", + "x-order": 2 + } + } + }, + "x-order": 1 + } + } + }, + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "proxysql": { + "description": "ChangeComponent contains fields to manage components.", + "type": "object", + "properties": { + "default_version": { + "type": "string", + "x-order": 0 + }, + "versions": { + "type": "array", + "items": { + "description": "ComponentVersion contains operations which should be done with component version.", + "type": "object", + "properties": { + "version": { + "type": "string", + "x-order": 0 + }, + "disable": { + "type": "boolean", + "x-order": 1 + }, + "enable": { + "type": "boolean", + "x-order": 2 + } + } + }, + "x-order": 1 + } + } + }, + "pxc": { + "description": "ChangeComponent contains fields to manage components.", + "type": "object", + "properties": { + "default_version": { + "type": "string", + "x-order": 0 + }, + "versions": { + "type": "array", + "items": { + "description": "ComponentVersion contains operations which should be done with component version.", + "type": "object", + "properties": { + "version": { + "type": "string", + "x-order": 0 + }, + "disable": { + "type": "boolean", + "x-order": 1 + }, + "enable": { + "type": "boolean", + "x-order": 2 + } + } + }, + "x-order": 1 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/CheckForOperatorUpdate": { + "post": { + "tags": [ + "Components" + ], + "summary": "CheckForOperatorUpdate checks if a new version of an operator is available.", + "operationId": "CheckForOperatorUpdate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "cluster_to_components": { + "description": "The cluster name is used as a key for this map, value contains components and their inforamtion about update.", + "type": "object", + "additionalProperties": { + "description": "ComponentsUpdateInformation contains info about components and their available latest versions.", + "type": "object", + "properties": { + "component_to_update_information": { + "description": "component_to_update_information stores, under the name of the component, information about the update.\n\"pxc-operator\", \"psmdb-operator\" are names used by backend for our operators.", + "type": "object", + "additionalProperties": { + "description": "ComponentUpdateInformation contains version we can update to for certain component.", + "type": "object", + "properties": { + "available_version": { + "type": "string", + "x-order": 0 + } + } + }, + "x-order": 0 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/GetPSMDB": { + "post": { + "tags": [ + "Components" + ], + "summary": "GetPSMDBComponents returns list of available components for PSMDB Clusters.", + "operationId": "GetPSMDBComponents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "db_version": { + "description": "Version of DB.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "versions": { + "type": "array", + "items": { + "description": "OperatorVersion contains information about operator and components matrix.", + "type": "object", + "properties": { + "matrix": { + "description": "Matrix contains all available components.", + "type": "object", + "properties": { + "mongod": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 0 + }, + "pxc": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 1 + }, + "pmm": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 2 + }, + "proxysql": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 3 + }, + "haproxy": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 4 + }, + "backup": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 5 + }, + "operator": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 6 + }, + "log_collector": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 7 + } + } + }, + "product": { + "type": "string", + "x-order": 0 + }, + "operator": { + "type": "string", + "x-order": 1 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/GetPXC": { + "post": { + "tags": [ + "Components" + ], + "summary": "GetPXCComponents returns list of available components for PXC Clusters.", + "operationId": "GetPXCComponents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "db_version": { + "description": "Version of DB.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "versions": { + "type": "array", + "items": { + "description": "OperatorVersion contains information about operator and components matrix.", + "type": "object", + "properties": { + "matrix": { + "description": "Matrix contains all available components.", + "type": "object", + "properties": { + "mongod": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 0 + }, + "pxc": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 1 + }, + "pmm": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 2 + }, + "proxysql": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 3 + }, + "haproxy": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 4 + }, + "backup": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 5 + }, + "operator": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 6 + }, + "log_collector": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 7 + } + } + }, + "product": { + "type": "string", + "x-order": 0 + }, + "operator": { + "type": "string", + "x-order": 1 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/InstallOperator": { + "post": { + "tags": [ + "Components" + ], + "summary": "InstallOperator installs given operator in given version.", + "operationId": "InstallOperator", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "operator_type": { + "description": "operator_type tells what operator we are interested in updating.", + "type": "string", + "x-order": 1 + }, + "version": { + "description": "version tells what version of the operator we should update to.", + "type": "string", + "x-order": 2 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "status": { + "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", + "type": "string", + "default": "OPERATORS_STATUS_INVALID", + "enum": [ + "OPERATORS_STATUS_INVALID", + "OPERATORS_STATUS_OK", + "OPERATORS_STATUS_UNSUPPORTED", + "OPERATORS_STATUS_NOT_INSTALLED" + ] + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/DBClusters/Delete": { + "post": { + "tags": [ + "DBClusters" + ], + "summary": "DeleteDBCluster deletes DB cluster.", + "operationId": "DeleteDBCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "cluster_type": { + "description": "DBClusterType represents database cluster type.\n\n - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type.\n - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type.\n - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type.", + "type": "string", + "default": "DB_CLUSTER_TYPE_INVALID", + "enum": [ + "DB_CLUSTER_TYPE_INVALID", + "DB_CLUSTER_TYPE_PXC", + "DB_CLUSTER_TYPE_PSMDB" + ] + }, + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "name": { + "description": "DB cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/DBClusters/List": { + "post": { + "tags": [ + "DBClusters" + ], + "summary": "ListDBClusters returns a list of DB clusters.", + "operationId": "ListDBClusters", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "pxc_clusters": { + "description": "PXC clusters information.", + "type": "array", + "items": { + "description": "PXCCluster represents PXC cluster information.", + "type": "object", + "properties": { + "state": { + "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", + "type": "string", + "default": "DB_CLUSTER_STATE_INVALID", + "enum": [ + "DB_CLUSTER_STATE_INVALID", + "DB_CLUSTER_STATE_CHANGING", + "DB_CLUSTER_STATE_READY", + "DB_CLUSTER_STATE_FAILED", + "DB_CLUSTER_STATE_DELETING", + "DB_CLUSTER_STATE_PAUSED", + "DB_CLUSTER_STATE_UPGRADING" + ] + }, + "name": { + "description": "Cluster name.", + "type": "string", + "x-order": 0 + }, + "operation": { + "description": "RunningOperation respresents a long-running operation.", + "type": "object", + "properties": { + "finished_steps": { + "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "description": "Text describing the current operation progress step.", + "type": "string", + "x-order": 1 + }, + "total_steps": { + "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", + "type": "integer", + "format": "int32", + "x-order": 2 + } + } + }, + "params": { + "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "haproxy": { + "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for HAProxy.", + "type": "string", + "x-order": 0 + } + } + }, + "proxysql": { + "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for ProxySQL.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + }, + "pxc": { + "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PXC.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + } + } + }, + "exposed": { + "description": "DB cluster accessible outside of K8s cluster.", + "type": "boolean", + "x-order": 4 + }, + "installed_image": { + "description": "Installed XtraDB image.", + "type": "string", + "x-order": 5 + }, + "available_image": { + "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", + "type": "string", + "x-order": 6 + } + } + }, + "x-order": 0 + }, + "psmdb_clusters": { + "description": "PSMDB clusters information.", + "type": "array", + "items": { + "description": "PSMDBCluster represents PSMDB cluster information.", + "type": "object", + "properties": { + "state": { + "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", + "type": "string", + "default": "DB_CLUSTER_STATE_INVALID", + "enum": [ + "DB_CLUSTER_STATE_INVALID", + "DB_CLUSTER_STATE_CHANGING", + "DB_CLUSTER_STATE_READY", + "DB_CLUSTER_STATE_FAILED", + "DB_CLUSTER_STATE_DELETING", + "DB_CLUSTER_STATE_PAUSED", + "DB_CLUSTER_STATE_UPGRADING" + ] + }, + "name": { + "description": "Cluster name.", + "type": "string", + "x-order": 0 + }, + "operation": { + "description": "RunningOperation respresents a long-running operation.", + "type": "object", + "properties": { + "finished_steps": { + "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "description": "Text describing the current operation progress step.", + "type": "string", + "x-order": 1 + }, + "total_steps": { + "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", + "type": "integer", + "format": "int32", + "x-order": 2 + } + } + }, + "params": { + "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "replicaset": { + "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PSMDB.", + "type": "string", + "x-order": 2 + } + } + }, + "exposed": { + "description": "DB cluster accessible outside of K8s cluster.", + "type": "boolean", + "x-order": 4 + }, + "installed_image": { + "description": "Installed PSMDB image.", + "type": "string", + "x-order": 5 + }, + "available_image": { + "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", + "type": "string", + "x-order": 6 + } + } + }, + "x-order": 1 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/DBClusters/Restart": { + "post": { + "tags": [ + "DBClusters" + ], + "summary": "RestartDBCluster restarts DB cluster.", + "operationId": "RestartDBCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "cluster_type": { + "description": "DBClusterType represents database cluster type.\n\n - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type.\n - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type.\n - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type.", + "type": "string", + "default": "DB_CLUSTER_TYPE_INVALID", + "enum": [ + "DB_CLUSTER_TYPE_INVALID", + "DB_CLUSTER_TYPE_PXC", + "DB_CLUSTER_TYPE_PSMDB" + ] + }, + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "name": { + "description": "PXC cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/GetLogs": { + "post": { + "tags": [ + "LogsAPI" + ], + "summary": "GetLogs gets all logs from db cluster.", + "operationId": "GetLogs", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "cluster_name": { + "description": "DB cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "logs": { + "description": "Log represents list of logs. Each entry contains either container's logs or,\nwhen container field is empty, pod's events.", + "type": "array", + "items": { + "description": "Logs contain logs for certain pod's container. If container is an empty\nstring, logs contain pod's events.", + "type": "object", + "properties": { + "pod": { + "description": "Pod name.", + "type": "string", + "x-order": 0 + }, + "container": { + "description": "Container name.", + "type": "string", + "x-order": 1 + }, + "logs": { + "description": "Content of container's log or pod's events.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 2 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Kubernetes/Get": { + "post": { + "tags": [ + "Kubernetes" + ], + "summary": "GetKubernetesCluster return KubeAuth with Kubernetes config.", + "operationId": "GetKubernetesCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "kube_auth": { + "description": "KubeAuth represents Kubernetes / kubectl authentication and authorization information.", + "type": "object", + "properties": { + "kubeconfig": { + "description": "Kubeconfig file content.", + "type": "string", + "x-order": 0 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Kubernetes/List": { + "post": { + "tags": [ + "Kubernetes" + ], + "summary": "ListKubernetesClusters returns a list of all registered Kubernetes clusters.", + "operationId": "ListKubernetesClusters", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "kubernetes_clusters": { + "description": "Kubernetes clusters.", + "type": "array", + "items": { + "description": "Cluster contains public info about Kubernetes cluster.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "operators": { + "description": "Operators contains list of operators installed in Kubernetes cluster.", + "type": "object", + "properties": { + "psmdb": { + "description": "Operator contains all information about operator installed in Kubernetes cluster.", + "type": "object", + "properties": { + "status": { + "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", + "type": "string", + "default": "OPERATORS_STATUS_INVALID", + "enum": [ + "OPERATORS_STATUS_INVALID", + "OPERATORS_STATUS_OK", + "OPERATORS_STATUS_UNSUPPORTED", + "OPERATORS_STATUS_NOT_INSTALLED" + ] + }, + "version": { + "type": "string", + "x-order": 1 + } + } + }, + "pxc": { + "description": "Operator contains all information about operator installed in Kubernetes cluster.", + "type": "object", + "properties": { + "status": { + "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", + "type": "string", + "default": "OPERATORS_STATUS_INVALID", + "enum": [ + "OPERATORS_STATUS_INVALID", + "OPERATORS_STATUS_OK", + "OPERATORS_STATUS_UNSUPPORTED", + "OPERATORS_STATUS_NOT_INSTALLED" + ] + }, + "version": { + "type": "string", + "x-order": 1 + } + } + } + } + }, + "status": { + "description": "KubernetesClusterStatus defines status of Kubernetes cluster.\n\n - KUBERNETES_CLUSTER_STATUS_INVALID: KUBERNETES_CLUSTER_STATUS_INVALID represents unknown state.\n - KUBERNETES_CLUSTER_STATUS_OK: KUBERNETES_CLUSTER_STATUS_OK represents that Kubernetes cluster is accessible.\n - KUBERNETES_CLUSTER_STATUS_UNAVAILABLE: KUBERNETES_CLUSTER_STATUS_UNAVAILABLE represents that Kubernetes cluster is not accessible.", + "type": "string", + "default": "KUBERNETES_CLUSTER_STATUS_INVALID", + "enum": [ + "KUBERNETES_CLUSTER_STATUS_INVALID", + "KUBERNETES_CLUSTER_STATUS_OK", + "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" + ] + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Kubernetes/Register": { + "post": { + "tags": [ + "Kubernetes" + ], + "summary": "RegisterKubernetesCluster registers an existing Kubernetes cluster in PMM.", + "operationId": "RegisterKubernetesCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kube_auth": { + "description": "KubeAuth represents Kubernetes / kubectl authentication and authorization information.", + "type": "object", + "properties": { + "kubeconfig": { + "description": "Kubeconfig file content.", + "type": "string", + "x-order": 0 + } + } + }, + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "aws_access_key_id": { + "description": "AWS access key id, only needed when registering EKS cluster and kubeconfig does not contain it.", + "type": "string", + "x-order": 2 + }, + "aws_secret_access_key": { + "description": "AWS secret access key, only needed when registering EKS cluster and kubeconfig does not contain it.", + "type": "string", + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Kubernetes/Resources/Get": { + "post": { + "tags": [ + "Kubernetes" + ], + "summary": "GetResources returns all and available resources of a Kubernetes cluster.\nNOTE: The user defined in kubeconfig for the cluster has to have rights to\n list and get Pods from all Namespaces. Also getting and listing Nodes\n has to be allowed.", + "operationId": "GetResources", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "all": { + "description": "Resources contains Kubernetes cluster resources.", + "type": "object", + "properties": { + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "uint64", + "x-order": 0 + }, + "cpu_m": { + "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", + "type": "string", + "format": "uint64", + "x-order": 1 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "uint64", + "x-order": 2 + } + } + }, + "available": { + "description": "Resources contains Kubernetes cluster resources.", + "type": "object", + "properties": { + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "uint64", + "x-order": 0 + }, + "cpu_m": { + "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", + "type": "string", + "format": "uint64", + "x-order": 1 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "uint64", + "x-order": 2 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Kubernetes/Unregister": { + "post": { + "tags": [ + "Kubernetes" + ], + "summary": "UnregisterKubernetesCluster removes a registered Kubernetes cluster from PMM.", + "operationId": "UnregisterKubernetesCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "force": { + "description": "If true then Kubernetes cluster will be deleted\neven if it contains database clusters.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PSMDBCluster/Create": { + "post": { + "tags": [ + "PSMDBClusters" + ], + "summary": "CreatePSMDBCluster creates a new PSMDB cluster.", + "operationId": "CreatePSMDBCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "params": { + "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "replicaset": { + "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PSMDB.", + "type": "string", + "x-order": 2 + } + } + }, + "name": { + "type": "string", + "title": "PSMDB cluster name.\na DNS-1035 label must consist of lower case alphanumeric characters or '-',\nstart with an alphabetic character, and end with an alphanumeric character\n(e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')", + "x-order": 1 + }, + "expose": { + "description": "Make DB cluster accessible outside of K8s cluster.", + "type": "boolean", + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PSMDBCluster/Resources/Get": { + "post": { + "tags": [ + "PSMDBClusters" + ], + "summary": "GetPSMDBClusterResources returns expected resources to be consumed by the cluster.", + "operationId": "GetPSMDBClusterResources", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "params": { + "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "replicaset": { + "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PSMDB.", + "type": "string", + "x-order": 2 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "expected": { + "description": "Resources contains Kubernetes cluster resources.", + "type": "object", + "properties": { + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "uint64", + "x-order": 0 + }, + "cpu_m": { + "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", + "type": "string", + "format": "uint64", + "x-order": 1 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "uint64", + "x-order": 2 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PSMDBCluster/Update": { + "post": { + "tags": [ + "PSMDBClusters" + ], + "summary": "UpdatePSMDBCluster updates existing PSMDB cluster.", + "operationId": "UpdatePSMDBCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "params": { + "description": "UpdatePSMDBClusterParams represents PSMDB cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "replicaset": { + "description": "ReplicaSet container parameters.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + } + } + }, + "suspend": { + "description": "Suspend cluster `pause: true`.", + "type": "boolean", + "x-order": 2 + }, + "resume": { + "description": "Resume cluster `pause: false`.", + "type": "boolean", + "x-order": 3 + }, + "image": { + "description": "PSMDB image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", + "type": "string", + "x-order": 4 + } + } + }, + "name": { + "description": "PSMDB cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PSMDBClusters/GetCredentials": { + "post": { + "tags": [ + "PSMDBClusters" + ], + "summary": "GetPSMDBClusterCredentials returns a PSMDB cluster credentials by cluster name.", + "operationId": "GetPSMDBClusterCredentials", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "name": { + "description": "PSMDB cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "connection_credentials": { + "description": "PSMDBCredentials is a credentials to connect to PSMDB.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "username": { + "description": "MongoDB username.", + "type": "string", + "x-order": 0 + }, + "password": { + "description": "MongoDB password.", + "type": "string", + "x-order": 1 + }, + "host": { + "description": "MongoDB host.", + "type": "string", + "x-order": 2 + }, + "port": { + "description": "MongoDB port.", + "type": "integer", + "format": "int32", + "x-order": 3 + }, + "replicaset": { + "description": "Replicaset name.", + "type": "string", + "x-order": 4 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PXCCluster/Create": { + "post": { + "tags": [ + "PXCClusters" + ], + "summary": "CreatePXCCluster creates a new PXC cluster.", + "operationId": "CreatePXCCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "params": { + "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "haproxy": { + "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for HAProxy.", + "type": "string", + "x-order": 0 + } + } + }, + "proxysql": { + "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for ProxySQL.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + }, + "pxc": { + "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PXC.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + } + } + }, + "name": { + "type": "string", + "title": "PXC cluster name.\na DNS-1035 label must consist of lower case alphanumeric characters or '-',\nstart with an alphabetic character, and end with an alphanumeric character\n(e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')", + "x-order": 1 + }, + "expose": { + "description": "Make DB cluster accessible outside of K8s cluster.", + "type": "boolean", + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PXCCluster/Resources/Get": { + "post": { + "tags": [ + "PXCClusters" + ], + "summary": "GetPXCClusterResources returns expected resources to be consumed by the cluster.", + "operationId": "GetPXCClusterResources", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "params": { + "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "haproxy": { + "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for HAProxy.", + "type": "string", + "x-order": 0 + } + } + }, + "proxysql": { + "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for ProxySQL.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + }, + "pxc": { + "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PXC.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "expected": { + "description": "Resources contains Kubernetes cluster resources.", + "type": "object", + "properties": { + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "uint64", + "x-order": 0 + }, + "cpu_m": { + "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", + "type": "string", + "format": "uint64", + "x-order": 1 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "uint64", + "x-order": 2 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PXCCluster/Update": { + "post": { + "tags": [ + "PXCClusters" + ], + "summary": "UpdatePXCCluster updates existing PXC cluster.", + "operationId": "UpdatePXCCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "params": { + "description": "UpdatePXCClusterParams represents PXC cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "haproxy": { + "description": "HAProxy container parameters.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + } + } + }, + "proxysql": { + "description": "ProxySQL container parameters.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + } + } + }, + "pxc": { + "description": "PXC container parameters.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", + "type": "string", + "x-order": 1 + } + } + }, + "suspend": { + "description": "Suspend cluster `pause: true`.", + "type": "boolean", + "x-order": 3 + }, + "resume": { + "description": "Resume cluster `pause: false`.", + "type": "boolean", + "x-order": 4 + } + } + }, + "name": { + "description": "PXC cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PXCClusters/GetCredentials": { + "post": { + "tags": [ + "PXCClusters" + ], + "summary": "GetPXCClusterCredentials returns a PXC cluster credentials by cluster name.", + "operationId": "GetPXCClusterCredentials", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "name": { + "description": "PXC cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "connection_credentials": { + "description": "PXCClusterConnectionCredentials is cluster connection credentials.", + "type": "object", + "properties": { + "username": { + "description": "PXC username.", + "type": "string", + "x-order": 0 + }, + "password": { + "description": "PXC password.", + "type": "string", + "x-order": 1 + }, + "host": { + "description": "PXC host.", + "type": "string", + "x-order": 2 + }, + "port": { + "description": "PXC port.", + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/azure/AzureDatabase/Add": { + "post": { + "tags": [ + "AzureDatabase" + ], + "summary": "AddAzureDatabase adds Azure Database instance.", + "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_INVALID", + "enum": [ + "DISCOVER_AZURE_DATABASE_TYPE_INVALID", + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/azure/AzureDatabase/Discover": { + "post": { + "tags": [ + "AzureDatabase" + ], + "summary": "DiscoverAzureDatabase discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.", + "operationId": "DiscoverAzureDatabase", + "parameters": [ + { + "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_INVALID", + "enum": [ + "DISCOVER_AZURE_DATABASE_TYPE_INVALID", + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Artifacts/Delete": { + "post": { + "tags": [ + "Artifacts" + ], + "summary": "DeleteArtifact deletes specified artifact.", + "operationId": "DeleteArtifact", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "artifact_id": { + "description": "Machine-readable artifact ID.", + "type": "string", + "x-order": 0 + }, + "remove_files": { + "description": "Removes all the backup files associated with artifact if flag is set.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Artifacts/List": { + "post": { + "tags": [ + "Artifacts" + ], + "summary": "ListArtifacts returns a list of all backup artifacts.", + "operationId": "ListArtifacts", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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 + }, + "data_model": { + "description": "DataModel is a model used for performing a backup.", + "type": "string", + "default": "DATA_MODEL_INVALID", + "enum": [ + "DATA_MODEL_INVALID", + "PHYSICAL", + "LOGICAL" + ] + }, + "status": { + "description": "BackupStatus shows the current status of execution of backup.", + "type": "string", + "default": "BACKUP_STATUS_INVALID", + "enum": [ + "BACKUP_STATUS_INVALID", + "BACKUP_STATUS_PENDING", + "BACKUP_STATUS_IN_PROGRESS", + "BACKUP_STATUS_PAUSED", + "BACKUP_STATUS_SUCCESS", + "BACKUP_STATUS_ERROR", + "BACKUP_STATUS_DELETING", + "BACKUP_STATUS_FAILED_TO_DELETE" + ] + }, + "mode": { + "description": "BackupMode specifies backup mode.", + "type": "string", + "default": "BACKUP_MODE_INVALID", + "enum": [ + "BACKUP_MODE_INVALID", + "SNAPSHOT", + "INCREMENTAL", + "PITR" + ] + }, + "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 + }, + "created_at": { + "description": "Artifact creation time.", + "type": "string", + "format": "date-time", + "x-order": 9 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/ChangeScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ChangeScheduledBackup changes existing 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-order": 1 + }, + "cron_expression": { + "description": "How often backup should be run in cron format.", + "type": "string", + "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-order": 4 + }, + "description": { + "description": "Human-readable description.", + "type": "string", + "x-order": 5 + }, + "retry_interval": { + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", + "type": "string", + "x-order": 6 + }, + "retries": { + "description": "How many times to retry a failed backup before giving up.", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "retention": { + "description": "How many artifacts keep. 0 - unlimited.", + "type": "integer", + "format": "int64", + "x-order": 8 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/GetLogs": { + "post": { + "tags": [ + "Backups" + ], + "summary": "GetLogs returns logs for provided artifact.", + "operationId": "GetLogsMixin2", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "artifact_id": { + "type": "string", + "x-order": 0 + }, + "offset": { + "type": "integer", + "format": "int64", + "x-order": 1 + }, + "limit": { + "type": "integer", + "format": "int64", + "x-order": 2 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/ListArtifactCompatibleServices": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ListArtifactCompatibleServices lists compatible services for restoring a backup.", + "operationId": "ListArtifactCompatibleServices", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "artifact_id": { + "description": "Artifact id used to determine restore compatibility.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "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 + } + } + }, + "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 + } + } + }, + "x-order": 1 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/ListScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ListScheduledBackups returns all scheduled backups.", + "operationId": "ListScheduledBackups", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "mode": { + "description": "BackupMode specifies backup mode.", + "type": "string", + "default": "BACKUP_MODE_INVALID", + "enum": [ + "BACKUP_MODE_INVALID", + "SNAPSHOT", + "INCREMENTAL", + "PITR" + ] + }, + "data_model": { + "description": "DataModel is a model used for performing a backup.", + "type": "string", + "default": "DATA_MODEL_INVALID", + "enum": [ + "DATA_MODEL_INVALID", + "PHYSICAL", + "LOGICAL" + ] + }, + "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 + }, + "cron_expression": { + "description": "How often backup will be run in cron format.", + "type": "string", + "x-order": 5 + }, + "start_time": { + "description": "First backup wouldn't happen before this time.", + "type": "string", + "format": "date-time", + "x-order": 6 + }, + "name": { + "description": "Artifact name.", + "type": "string", + "x-order": 7 + }, + "description": { + "description": "Description.", + "type": "string", + "x-order": 8 + }, + "retry_interval": { + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", + "type": "string", + "x-order": 9 + }, + "retries": { + "description": "How many times to retry a failed backup before giving up.", + "type": "integer", + "format": "int64", + "x-order": 10 + }, + "enabled": { + "description": "If scheduling is enabled.", + "type": "boolean", + "x-order": 11 + }, + "vendor": { + "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", + "type": "string", + "x-order": 13 + }, + "last_run": { + "description": "Last run.", + "type": "string", + "format": "date-time", + "x-order": 14 + }, + "next_run": { + "description": "Next run.", + "type": "string", + "format": "date-time", + "x-order": 15 + }, + "retention": { + "description": "How many artifacts keep. 0 - unlimited.", + "type": "integer", + "format": "int64", + "x-order": 16 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/RemoveScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "RemoveScheduledBackup removes existing scheduled backup.", + "operationId": "RemoveScheduledBackup", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "scheduled_backup_id": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/Restore": { + "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": [ + "Backups" + ], + "summary": "RestoreBackup requests the backup restore.", + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/Schedule": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ScheduleBackup schedules repeated 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 + }, + "mode": { + "description": "BackupMode specifies backup mode.", + "type": "string", + "default": "BACKUP_MODE_INVALID", + "enum": [ + "BACKUP_MODE_INVALID", + "SNAPSHOT", + "INCREMENTAL", + "PITR" + ] + }, + "location_id": { + "description": "Machine-readable location ID.", + "type": "string", + "x-order": 1 + }, + "cron_expression": { + "description": "How often backup should be run in cron format.", + "type": "string", + "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-order": 4 + }, + "description": { + "description": "Human-readable description.", + "type": "string", + "x-order": 5 + }, + "retry_interval": { + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", + "type": "string", + "x-order": 6 + }, + "retries": { + "description": "How many times to retry a failed backup before giving up.", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "enabled": { + "description": "If scheduling is enabled.", + "type": "boolean", + "x-order": 8 + }, + "retention": { + "description": "How many artifacts keep. 0 - unlimited.", + "type": "integer", + "format": "int64", + "x-order": 9 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/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": [ + "Backups" + ], + "summary": "StartBackup request backup specified service to location.", + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Locations/Add": { + "post": { + "tags": [ + "Locations" + ], + "summary": "AddLocation adds backup location.", + "operationId": "AddLocation", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Location name", + "x-order": 0 + }, + "pmm_client_config": { + "description": "PMMClientLocationConfig represents file system config inside pmm-client.", + "type": "object", + "properties": { + "path": { + "type": "string", + "x-order": 0 + } + } + }, + "pmm_server_config": { + "description": "PMMServerLocationConfig represents file system config inside pmm-server.", + "type": "object", + "properties": { + "path": { + "type": "string", + "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 + } + } + }, + "description": { + "type": "string", + "x-order": 1 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Locations/Change": { + "post": { + "tags": [ + "Locations" + ], + "summary": "ChangeLocation changes backup location.", + "operationId": "ChangeLocation", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "location_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "pmm_client_config": { + "description": "PMMClientLocationConfig represents file system config inside pmm-client.", + "type": "object", + "properties": { + "path": { + "type": "string", + "x-order": 0 + } + } + }, + "pmm_server_config": { + "description": "PMMServerLocationConfig represents file system config inside pmm-server.", + "type": "object", + "properties": { + "path": { + "type": "string", + "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 + } + } + }, + "name": { + "type": "string", + "title": "Location name", + "x-order": 1 + }, + "description": { + "type": "string", + "x-order": 2 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Locations/List": { + "post": { + "tags": [ + "Locations" + ], + "summary": "ListLocations returns a list of all backup locations.", + "operationId": "ListLocations", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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 + }, + "pmm_client_config": { + "description": "PMMClientLocationConfig represents file system config inside pmm-client.", + "type": "object", + "properties": { + "path": { + "type": "string", + "x-order": 0 + } + } + }, + "pmm_server_config": { + "description": "PMMServerLocationConfig represents file system config inside pmm-server.", + "type": "object", + "properties": { + "path": { + "type": "string", + "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 + } + } + }, + "name": { + "type": "string", + "title": "Location name", + "x-order": 1 + }, + "description": { + "type": "string", + "title": "Short description", + "x-order": 2 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Locations/Remove": { + "post": { + "tags": [ + "Locations" + ], + "summary": "RemoveLocation removes existing backup location.", + "operationId": "RemoveLocation", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "location_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "force": { + "type": "boolean", + "title": "Force mode", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Locations/TestConfig": { + "post": { + "tags": [ + "Locations" + ], + "summary": "TestLocationConfig tests backup location and credentials.", + "operationId": "TestLocationConfig", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "pmm_client_config": { + "description": "PMMClientLocationConfig represents file system config inside pmm-client.", + "type": "object", + "properties": { + "path": { + "type": "string", + "x-order": 0 + } + } + }, + "pmm_server_config": { + "description": "PMMServerLocationConfig represents file system config inside pmm-server.", + "type": "object", + "properties": { + "path": { + "type": "string", + "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 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/RestoreHistory/List": { + "post": { + "tags": [ + "RestoreHistory" + ], + "summary": "ListRestoreHistory returns a list of all backup restore history items.", + "operationId": "ListRestoreHistory", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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 + }, + "data_model": { + "description": "DataModel is a model used for performing a backup.", + "type": "string", + "default": "DATA_MODEL_INVALID", + "enum": [ + "DATA_MODEL_INVALID", + "PHYSICAL", + "LOGICAL" + ] + }, + "status": { + "description": "RestoreStatus shows the current status of execution of restore.", + "type": "string", + "default": "RESTORE_STATUS_INVALID", + "enum": [ + "RESTORE_STATUS_INVALID", + "RESTORE_STATUS_IN_PROGRESS", + "RESTORE_STATUS_SUCCESS", + "RESTORE_STATUS_ERROR" + ] + }, + "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 + }, + "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 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Alerts/List": { + "post": { + "tags": [ + "Alerts" + ], + "summary": "ListAlerts returns a list of all Alerts.", + "operationId": "ListAlerts", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "page_params": { + "description": "PageParams represents page request parameters for pagination.", + "type": "object", + "properties": { + "page_size": { + "description": "Maximum number of results per page.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "index": { + "description": "Index of the requested page, starts from 0.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "description": "Alert represents Alert.", + "type": "object", + "properties": { + "alert_id": { + "description": "ID.", + "type": "string", + "x-order": 0 + }, + "rule": { + "description": "Rule represents Alert Rule.", + "type": "object", + "properties": { + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + }, + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "default_severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "name": { + "description": "Rule name.", + "type": "string", + "x-order": 1 + }, + "summary": { + "description": "Rule human-readable summary.", + "type": "string", + "x-order": 2 + }, + "template_name": { + "description": "Template used for this rule.", + "type": "string", + "x-order": 3 + }, + "disabled": { + "description": "True if that rule is disabled.", + "type": "boolean", + "x-order": 4 + }, + "expr_template": { + "description": "Expression template.", + "type": "string", + "x-order": 5 + }, + "expr": { + "description": "Expression filled with parameters.", + "type": "string", + "x-order": 6 + }, + "params_definitions": { + "description": "Expression parameters definitions.", + "type": "array", + "items": { + "description": "ParamDefinition represents a single query parameter.", + "type": "object", + "properties": { + "bool": { + "description": "BoolParamDefinition represents boolean parameter's default value.", + "type": "object", + "properties": { + "default": { + "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", + "type": "string", + "default": "DO_NOT_CHANGE", + "enum": [ + "DO_NOT_CHANGE", + "TRUE", + "FALSE" + ] + } + } + }, + "float": { + "description": "FloatParamDefinition represents float parameter's default value and valid range.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "number", + "format": "double", + "x-order": 1 + }, + "has_min": { + "description": "True if minimal valid value is set.", + "type": "boolean", + "x-order": 2 + }, + "min": { + "description": "Minimal valid value (inclusive) if has_min is true.", + "type": "number", + "format": "double", + "x-order": 3 + }, + "has_max": { + "description": "True if maximal valid value is set.", + "type": "boolean", + "x-order": 4 + }, + "max": { + "description": "Maximal valid value (inclusive) if has_max is true.", + "type": "number", + "format": "double", + "x-order": 5 + } + } + }, + "name": { + "description": "Machine-readable name (ID) that is used in expression.", + "type": "string", + "x-order": 0 + }, + "string": { + "description": "StringParamDefinition represents string parameter's default value.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "string", + "x-order": 1 + } + } + }, + "type": { + "description": "ParamType represents template parameter type.", + "type": "string", + "default": "PARAM_TYPE_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "unit": { + "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", + "type": "string", + "default": "PARAM_UNIT_INVALID", + "enum": [ + "PARAM_UNIT_INVALID", + "PERCENTAGE", + "SECONDS" + ] + }, + "summary": { + "description": "Short human-readable parameter summary.", + "type": "string", + "x-order": 1 + } + } + }, + "x-order": 7 + }, + "params_values": { + "description": "Expression parameters values.", + "type": "array", + "items": { + "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", + "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_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "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": 8 + }, + "default_for": { + "description": "Default for duration.", + "type": "string", + "x-order": 9 + }, + "for": { + "description": "For duration.", + "type": "string", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 13 + }, + "labels": { + "description": "Labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 14 + }, + "annotations": { + "description": "Annotations.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 15 + }, + "filters": { + "description": "Filters.", + "type": "array", + "items": { + "description": "Filter repsents a single filter condition.", + "type": "object", + "properties": { + "type": { + "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", + "type": "string", + "default": "FILTER_TYPE_INVALID", + "enum": [ + "FILTER_TYPE_INVALID", + "EQUAL", + "REGEX" + ] + }, + "key": { + "type": "string", + "x-order": 1 + }, + "value": { + "type": "string", + "x-order": 2 + } + } + }, + "x-order": 16 + }, + "channels": { + "description": "Channels.", + "type": "array", + "items": { + "description": "Channel represents a single Notification Channel.", + "type": "object", + "properties": { + "channel_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "email_config": { + "description": "EmailConfig represents email configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "to": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "pagerduty_config": { + "description": "PagerDutyConfig represents PagerDuty configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "routing_key": { + "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 1 + }, + "service_key": { + "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 2 + } + } + }, + "slack_config": { + "description": "SlackConfig represents Slack configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "channel": { + "type": "string", + "x-order": 1 + } + } + }, + "webhook_config": { + "description": "WebhookConfig represents webhook configuration.", + "type": "object", + "properties": { + "http_config": { + "description": "HTTPConfig represents HTTP client configuration.", + "type": "object", + "properties": { + "basic_auth": { + "description": "BasicAuth represents basic HTTP auth configuration.", + "type": "object", + "properties": { + "username": { + "type": "string", + "x-order": 0 + }, + "password": { + "type": "string", + "x-order": 1 + }, + "password_file": { + "type": "string", + "x-order": 2 + } + } + }, + "tls_config": { + "type": "object", + "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", + "properties": { + "ca_file": { + "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 0 + }, + "cert_file": { + "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 1 + }, + "key_file": { + "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 2 + }, + "server_name": { + "description": "Name of the server.", + "type": "string", + "x-order": 3 + }, + "insecure_skip_verify": { + "description": "Disable validation of the server certificate.", + "type": "boolean", + "x-order": 4 + }, + "ca_file_content": { + "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 5 + }, + "cert_file_content": { + "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 6 + }, + "key_file_content": { + "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 7 + } + } + }, + "bearer_token": { + "type": "string", + "x-order": 1 + }, + "bearer_token_file": { + "type": "string", + "x-order": 2 + }, + "proxy_url": { + "type": "string", + "x-order": 4 + } + } + }, + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "url": { + "type": "string", + "x-order": 1 + }, + "max_alerts": { + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + }, + "summary": { + "description": "Short human-readable summary.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "True if that channel is disabled.", + "type": "boolean", + "x-order": 6 + } + } + }, + "x-order": 17 + }, + "created_at": { + "description": "Rule creation time.", + "type": "string", + "format": "date-time", + "x-order": 18 + } + } + }, + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "status": { + "description": "Status represents Alert Rule's and Alert's combined status.\n\n - CLEAR: No alert.\n - PENDING: Pending, but not triggering alert.\n - TRIGGERING: Triggering (firing) alert.\n - SILENCED: Silenced alert.", + "type": "string", + "default": "STATUS_INVALID", + "enum": [ + "STATUS_INVALID", + "CLEAR", + "PENDING", + "TRIGGERING", + "SILENCED" + ] + }, + "summary": { + "description": "Human-readable summary.", + "type": "string", + "x-order": 1 + }, + "labels": { + "description": "Combined labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 4 + }, + "created_at": { + "description": "Alert creation time.", + "type": "string", + "format": "date-time", + "x-order": 6 + }, + "updated_at": { + "description": "Alert last update time.", + "type": "string", + "format": "date-time", + "x-order": 7 + } + } + }, + "x-order": 0 + }, + "totals": { + "description": "PageTotals represents total values for pagination.", + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Alerts/Toggle": { + "post": { + "description": "Pass empty list to apply toggle action to all existing alerts", + "tags": [ + "Alerts" + ], + "summary": "ToggleAlerts allows to switch alerts state between silenced and unsilenced.", + "operationId": "ToggleAlerts", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "alert_ids": { + "description": "List of alerts that silence state should be switched. If provided array is empty than all\nexisting alerts are switched.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 0 + }, + "silenced": { + "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", + "type": "string", + "default": "DO_NOT_CHANGE", + "enum": [ + "DO_NOT_CHANGE", + "TRUE", + "FALSE" + ] + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Channels/Add": { + "post": { + "tags": [ + "Channels" + ], + "summary": "AddChannel adds notification channel.", + "operationId": "AddChannel", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "email_config": { + "description": "EmailConfig represents email configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "to": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "pagerduty_config": { + "description": "PagerDutyConfig represents PagerDuty configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "routing_key": { + "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 1 + }, + "service_key": { + "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 2 + } + } + }, + "slack_config": { + "description": "SlackConfig represents Slack configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "channel": { + "type": "string", + "x-order": 1 + } + } + }, + "summary": { + "description": "Short human-readable summary.", + "type": "string", + "x-order": 0 + }, + "webhook_config": { + "description": "WebhookConfig represents webhook configuration.", + "type": "object", + "properties": { + "http_config": { + "description": "HTTPConfig represents HTTP client configuration.", + "type": "object", + "properties": { + "basic_auth": { + "description": "BasicAuth represents basic HTTP auth configuration.", + "type": "object", + "properties": { + "username": { + "type": "string", + "x-order": 0 + }, + "password": { + "type": "string", + "x-order": 1 + }, + "password_file": { + "type": "string", + "x-order": 2 + } + } + }, + "tls_config": { + "type": "object", + "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", + "properties": { + "ca_file": { + "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 0 + }, + "cert_file": { + "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 1 + }, + "key_file": { + "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 2 + }, + "server_name": { + "description": "Name of the server.", + "type": "string", + "x-order": 3 + }, + "insecure_skip_verify": { + "description": "Disable validation of the server certificate.", + "type": "boolean", + "x-order": 4 + }, + "ca_file_content": { + "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 5 + }, + "cert_file_content": { + "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 6 + }, + "key_file_content": { + "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 7 + } + } + }, + "bearer_token": { + "type": "string", + "x-order": 1 + }, + "bearer_token_file": { + "type": "string", + "x-order": 2 + }, + "proxy_url": { + "type": "string", + "x-order": 4 + } + } + }, + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "url": { + "type": "string", + "x-order": 1 + }, + "max_alerts": { + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + }, + "disabled": { + "description": "New channel status.", + "type": "boolean", + "x-order": 5 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "channel_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Channels/Change": { + "post": { + "tags": [ + "Channels" + ], + "summary": "ChangeChannel changes notification channel.", + "operationId": "ChangeChannel", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "channel_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "email_config": { + "description": "EmailConfig represents email configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "to": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "pagerduty_config": { + "description": "PagerDutyConfig represents PagerDuty configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "routing_key": { + "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 1 + }, + "service_key": { + "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 2 + } + } + }, + "slack_config": { + "description": "SlackConfig represents Slack configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "channel": { + "type": "string", + "x-order": 1 + } + } + }, + "webhook_config": { + "description": "WebhookConfig represents webhook configuration.", + "type": "object", + "properties": { + "http_config": { + "description": "HTTPConfig represents HTTP client configuration.", + "type": "object", + "properties": { + "basic_auth": { + "description": "BasicAuth represents basic HTTP auth configuration.", + "type": "object", + "properties": { + "username": { + "type": "string", + "x-order": 0 + }, + "password": { + "type": "string", + "x-order": 1 + }, + "password_file": { + "type": "string", + "x-order": 2 + } + } + }, + "tls_config": { + "type": "object", + "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", + "properties": { + "ca_file": { + "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 0 + }, + "cert_file": { + "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 1 + }, + "key_file": { + "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 2 + }, + "server_name": { + "description": "Name of the server.", + "type": "string", + "x-order": 3 + }, + "insecure_skip_verify": { + "description": "Disable validation of the server certificate.", + "type": "boolean", + "x-order": 4 + }, + "ca_file_content": { + "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 5 + }, + "cert_file_content": { + "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 6 + }, + "key_file_content": { + "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 7 + } + } + }, + "bearer_token": { + "type": "string", + "x-order": 1 + }, + "bearer_token_file": { + "type": "string", + "x-order": 2 + }, + "proxy_url": { + "type": "string", + "x-order": 4 + } + } + }, + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "url": { + "type": "string", + "x-order": 1 + }, + "max_alerts": { + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + }, + "summary": { + "description": "Short human-readable summary. Empty value will not change it.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Enables or disables that channel. Should be set.", + "type": "boolean", + "x-order": 6 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Channels/List": { + "post": { + "tags": [ + "Channels" + ], + "summary": "ListChannels returns a list of all notifation channels.", + "operationId": "ListChannels", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "page_params": { + "description": "PageParams represents page request parameters for pagination.", + "type": "object", + "properties": { + "page_size": { + "description": "Maximum number of results per page.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "index": { + "description": "Index of the requested page, starts from 0.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "channels": { + "type": "array", + "items": { + "description": "Channel represents a single Notification Channel.", + "type": "object", + "properties": { + "channel_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "email_config": { + "description": "EmailConfig represents email configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "to": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "pagerduty_config": { + "description": "PagerDutyConfig represents PagerDuty configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "routing_key": { + "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 1 + }, + "service_key": { + "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 2 + } + } + }, + "slack_config": { + "description": "SlackConfig represents Slack configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "channel": { + "type": "string", + "x-order": 1 + } + } + }, + "webhook_config": { + "description": "WebhookConfig represents webhook configuration.", + "type": "object", + "properties": { + "http_config": { + "description": "HTTPConfig represents HTTP client configuration.", + "type": "object", + "properties": { + "basic_auth": { + "description": "BasicAuth represents basic HTTP auth configuration.", + "type": "object", + "properties": { + "username": { + "type": "string", + "x-order": 0 + }, + "password": { + "type": "string", + "x-order": 1 + }, + "password_file": { + "type": "string", + "x-order": 2 + } + } + }, + "tls_config": { + "type": "object", + "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", + "properties": { + "ca_file": { + "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 0 + }, + "cert_file": { + "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 1 + }, + "key_file": { + "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 2 + }, + "server_name": { + "description": "Name of the server.", + "type": "string", + "x-order": 3 + }, + "insecure_skip_verify": { + "description": "Disable validation of the server certificate.", + "type": "boolean", + "x-order": 4 + }, + "ca_file_content": { + "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 5 + }, + "cert_file_content": { + "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 6 + }, + "key_file_content": { + "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 7 + } + } + }, + "bearer_token": { + "type": "string", + "x-order": 1 + }, + "bearer_token_file": { + "type": "string", + "x-order": 2 + }, + "proxy_url": { + "type": "string", + "x-order": 4 + } + } + }, + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "url": { + "type": "string", + "x-order": 1 + }, + "max_alerts": { + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + }, + "summary": { + "description": "Short human-readable summary.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "True if that channel is disabled.", + "type": "boolean", + "x-order": 6 + } + } + }, + "x-order": 0 + }, + "totals": { + "description": "PageTotals represents total values for pagination.", + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Channels/Remove": { + "post": { + "tags": [ + "Channels" + ], + "summary": "RemoveChannel removes notification channel.", + "operationId": "RemoveChannel", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "channel_id": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Rules/Create": { + "post": { + "tags": [ + "Rules" + ], + "summary": "CreateAlertRule creates Alerting rule.", + "operationId": "CreateAlertRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "template_name": { + "description": "Template name. Can't be specified simultaneously with source_rule_id.", + "type": "string", + "x-order": 0 + }, + "source_rule_id": { + "description": "ID of the rule that will be used as source. Can't be specified simultaneously with template_name.", + "type": "string", + "x-order": 1 + }, + "name": { + "description": "Rule name.", + "type": "string", + "x-order": 2 + }, + "disabled": { + "description": "New rule status.", + "type": "boolean", + "x-order": 3 + }, + "params": { + "description": "Rule parameters. All template parameters should be set.", + "type": "array", + "items": { + "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", + "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_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "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 + }, + "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. Should be set.", + "type": "array", + "items": { + "description": "Filter repsents a single filter condition.", + "type": "object", + "properties": { + "type": { + "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", + "type": "string", + "default": "FILTER_TYPE_INVALID", + "enum": [ + "FILTER_TYPE_INVALID", + "EQUAL", + "REGEX" + ] + }, + "key": { + "type": "string", + "x-order": 1 + }, + "value": { + "type": "string", + "x-order": 2 + } + } + }, + "x-order": 8 + }, + "channel_ids": { + "description": "Channels. Should be set.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 9 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Rules/Delete": { + "post": { + "tags": [ + "Rules" + ], + "summary": "DeleteAlertRule deletes Alerting rule.", + "operationId": "DeleteAlertRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Rules/List": { + "post": { + "tags": [ + "Rules" + ], + "summary": "ListAlertRules returns a list of all Alerting rules.", + "operationId": "ListAlertRules", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "page_params": { + "description": "PageParams represents page request parameters for pagination.", + "type": "object", + "properties": { + "page_size": { + "description": "Maximum number of results per page.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "index": { + "description": "Index of the requested page, starts from 0.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "rules": { + "type": "array", + "items": { + "description": "Rule represents Alert Rule.", + "type": "object", + "properties": { + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + }, + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "default_severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "name": { + "description": "Rule name.", + "type": "string", + "x-order": 1 + }, + "summary": { + "description": "Rule human-readable summary.", + "type": "string", + "x-order": 2 + }, + "template_name": { + "description": "Template used for this rule.", + "type": "string", + "x-order": 3 + }, + "disabled": { + "description": "True if that rule is disabled.", + "type": "boolean", + "x-order": 4 + }, + "expr_template": { + "description": "Expression template.", + "type": "string", + "x-order": 5 + }, + "expr": { + "description": "Expression filled with parameters.", + "type": "string", + "x-order": 6 + }, + "params_definitions": { + "description": "Expression parameters definitions.", + "type": "array", + "items": { + "description": "ParamDefinition represents a single query parameter.", + "type": "object", + "properties": { + "bool": { + "description": "BoolParamDefinition represents boolean parameter's default value.", + "type": "object", + "properties": { + "default": { + "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", + "type": "string", + "default": "DO_NOT_CHANGE", + "enum": [ + "DO_NOT_CHANGE", + "TRUE", + "FALSE" + ] + } + } + }, + "float": { + "description": "FloatParamDefinition represents float parameter's default value and valid range.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "number", + "format": "double", + "x-order": 1 + }, + "has_min": { + "description": "True if minimal valid value is set.", + "type": "boolean", + "x-order": 2 + }, + "min": { + "description": "Minimal valid value (inclusive) if has_min is true.", + "type": "number", + "format": "double", + "x-order": 3 + }, + "has_max": { + "description": "True if maximal valid value is set.", + "type": "boolean", + "x-order": 4 + }, + "max": { + "description": "Maximal valid value (inclusive) if has_max is true.", + "type": "number", + "format": "double", + "x-order": 5 + } + } + }, + "name": { + "description": "Machine-readable name (ID) that is used in expression.", + "type": "string", + "x-order": 0 + }, + "string": { + "description": "StringParamDefinition represents string parameter's default value.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "string", + "x-order": 1 + } + } + }, + "type": { + "description": "ParamType represents template parameter type.", + "type": "string", + "default": "PARAM_TYPE_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "unit": { + "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", + "type": "string", + "default": "PARAM_UNIT_INVALID", + "enum": [ + "PARAM_UNIT_INVALID", + "PERCENTAGE", + "SECONDS" + ] + }, + "summary": { + "description": "Short human-readable parameter summary.", + "type": "string", + "x-order": 1 + } + } + }, + "x-order": 7 + }, + "params_values": { + "description": "Expression parameters values.", + "type": "array", + "items": { + "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", + "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_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "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": 8 + }, + "default_for": { + "description": "Default for duration.", + "type": "string", + "x-order": 9 + }, + "for": { + "description": "For duration.", + "type": "string", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 13 + }, + "labels": { + "description": "Labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 14 + }, + "annotations": { + "description": "Annotations.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 15 + }, + "filters": { + "description": "Filters.", + "type": "array", + "items": { + "description": "Filter repsents a single filter condition.", + "type": "object", + "properties": { + "type": { + "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", + "type": "string", + "default": "FILTER_TYPE_INVALID", + "enum": [ + "FILTER_TYPE_INVALID", + "EQUAL", + "REGEX" + ] + }, + "key": { + "type": "string", + "x-order": 1 + }, + "value": { + "type": "string", + "x-order": 2 + } + } + }, + "x-order": 16 + }, + "channels": { + "description": "Channels.", + "type": "array", + "items": { + "description": "Channel represents a single Notification Channel.", + "type": "object", + "properties": { + "channel_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "email_config": { + "description": "EmailConfig represents email configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "to": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "pagerduty_config": { + "description": "PagerDutyConfig represents PagerDuty configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "routing_key": { + "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 1 + }, + "service_key": { + "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 2 + } + } + }, + "slack_config": { + "description": "SlackConfig represents Slack configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "channel": { + "type": "string", + "x-order": 1 + } + } + }, + "webhook_config": { + "description": "WebhookConfig represents webhook configuration.", + "type": "object", + "properties": { + "http_config": { + "description": "HTTPConfig represents HTTP client configuration.", + "type": "object", + "properties": { + "basic_auth": { + "description": "BasicAuth represents basic HTTP auth configuration.", + "type": "object", + "properties": { + "username": { + "type": "string", + "x-order": 0 + }, + "password": { + "type": "string", + "x-order": 1 + }, + "password_file": { + "type": "string", + "x-order": 2 + } + } + }, + "tls_config": { + "type": "object", + "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", + "properties": { + "ca_file": { + "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 0 + }, + "cert_file": { + "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 1 + }, + "key_file": { + "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 2 + }, + "server_name": { + "description": "Name of the server.", + "type": "string", + "x-order": 3 + }, + "insecure_skip_verify": { + "description": "Disable validation of the server certificate.", + "type": "boolean", + "x-order": 4 + }, + "ca_file_content": { + "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 5 + }, + "cert_file_content": { + "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 6 + }, + "key_file_content": { + "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 7 + } + } + }, + "bearer_token": { + "type": "string", + "x-order": 1 + }, + "bearer_token_file": { + "type": "string", + "x-order": 2 + }, + "proxy_url": { + "type": "string", + "x-order": 4 + } + } + }, + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "url": { + "type": "string", + "x-order": 1 + }, + "max_alerts": { + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + }, + "summary": { + "description": "Short human-readable summary.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "True if that channel is disabled.", + "type": "boolean", + "x-order": 6 + } + } + }, + "x-order": 17 + }, + "created_at": { + "description": "Rule creation time.", + "type": "string", + "format": "date-time", + "x-order": 18 + } + } + }, + "x-order": 0 + }, + "totals": { + "description": "PageTotals represents total values for pagination.", + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Rules/Toggle": { + "post": { + "tags": [ + "Rules" + ], + "summary": "ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule.", + "operationId": "ToggleAlertRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "disabled": { + "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", + "type": "string", + "default": "DO_NOT_CHANGE", + "enum": [ + "DO_NOT_CHANGE", + "TRUE", + "FALSE" + ] + }, + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Rules/Update": { + "post": { + "tags": [ + "Rules" + ], + "summary": "UpdateAlertRule updates Alerting rule.", + "operationId": "UpdateAlertRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + }, + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "name": { + "description": "Rule name. Should be set.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "New rule status. Should be set.", + "type": "boolean", + "x-order": 2 + }, + "params": { + "description": "Rule parameters. All template parameters should be set.", + "type": "array", + "items": { + "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", + "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_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "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": 3 + }, + "for": { + "description": "Rule duration. Should be set.", + "type": "string", + "x-order": 4 + }, + "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": 6 + }, + "filters": { + "description": "Filters. Should be set.", + "type": "array", + "items": { + "description": "Filter repsents a single filter condition.", + "type": "object", + "properties": { + "type": { + "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", + "type": "string", + "default": "FILTER_TYPE_INVALID", + "enum": [ + "FILTER_TYPE_INVALID", + "EQUAL", + "REGEX" + ] + }, + "key": { + "type": "string", + "x-order": 1 + }, + "value": { + "type": "string", + "x-order": 2 + } + } + }, + "x-order": 7 + }, + "channel_ids": { + "description": "Channels. Should be set.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 8 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Templates/Create": { + "post": { + "tags": [ + "Templates" + ], + "summary": "CreateTemplate creates a new template.", + "operationId": "CreateTemplate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "yaml": { + "description": "YAML (or JSON) 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Templates/Delete": { + "post": { + "tags": [ + "Templates" + ], + "summary": "DeleteTemplate deletes existing, previously created via API.", + "operationId": "DeleteTemplate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Templates/List": { + "post": { + "tags": [ + "Templates" + ], + "summary": "ListTemplates returns a list of all collected Alert Rule Templates.", + "operationId": "ListTemplates", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "page_params": { + "description": "PageParams represents page request parameters for pagination.", + "type": "object", + "properties": { + "page_size": { + "description": "Maximum number of results per page.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "index": { + "description": "Index of the requested page, starts from 0.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + }, + "reload": { + "description": "If true, template files will be re-read from disk.", + "type": "boolean", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "templates": { + "type": "array", + "items": { + "description": "Template represents Alert Template that is used to create Alert Rule.", + "type": "object", + "properties": { + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "source": { + "description": "TemplateSource defines template source.\n\n - BUILT_IN: Template that is shipped with PMM Server releases.\n - SAAS: Template that is downloaded from check.percona.com.\n - USER_FILE: Templated loaded from user-suplied file.\n - USER_API: Templated created via API.", + "type": "string", + "default": "TEMPLATE_SOURCE_INVALID", + "enum": [ + "TEMPLATE_SOURCE_INVALID", + "BUILT_IN", + "SAAS", + "USER_FILE", + "USER_API" + ] + }, + "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": { + "bool": { + "description": "BoolParamDefinition represents boolean parameter's default value.", + "type": "object", + "properties": { + "default": { + "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", + "type": "string", + "default": "DO_NOT_CHANGE", + "enum": [ + "DO_NOT_CHANGE", + "TRUE", + "FALSE" + ] + } + } + }, + "float": { + "description": "FloatParamDefinition represents float parameter's default value and valid range.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "number", + "format": "double", + "x-order": 1 + }, + "has_min": { + "description": "True if minimal valid value is set.", + "type": "boolean", + "x-order": 2 + }, + "min": { + "description": "Minimal valid value (inclusive) if has_min is true.", + "type": "number", + "format": "double", + "x-order": 3 + }, + "has_max": { + "description": "True if maximal valid value is set.", + "type": "boolean", + "x-order": 4 + }, + "max": { + "description": "Maximal valid value (inclusive) if has_max is true.", + "type": "number", + "format": "double", + "x-order": 5 + } + } + }, + "name": { + "description": "Machine-readable name (ID) that is used in expression.", + "type": "string", + "x-order": 0 + }, + "string": { + "description": "StringParamDefinition represents string parameter's default value.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "string", + "x-order": 1 + } + } + }, + "type": { + "description": "ParamType represents template parameter type.", + "type": "string", + "default": "PARAM_TYPE_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "unit": { + "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", + "type": "string", + "default": "PARAM_UNIT_INVALID", + "enum": [ + "PARAM_UNIT_INVALID", + "PERCENTAGE", + "SECONDS" + ] + }, + "summary": { + "description": "Short human-readable parameter summary.", + "type": "string", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "for": { + "description": "Default duration value.", + "type": "string", + "x-order": 4 + }, + "labels": { + "description": "Labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + }, + "annotations": { + "description": "Annotations.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + }, + "created_at": { + "description": "Template creation time. Empty for built-in and SaaS templates.", + "type": "string", + "format": "date-time", + "x-order": 9 + }, + "yaml": { + "description": "YAML (or JSON) template file content. Empty for built-in and SaaS templates.", + "type": "string", + "x-order": 10 + } + } + }, + "x-order": 0 + }, + "totals": { + "description": "PageTotals represents total values for pagination.", + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Templates/Update": { + "post": { + "tags": [ + "Templates" + ], + "summary": "UpdateTemplate updates existing template, previously created via API.", + "operationId": "UpdateTemplate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Machine-readable name (ID).", + "type": "string", + "x-order": 0 + }, + "yaml": { + "description": "YAML (or JSON) template file content.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + } + }, + "securityDefinitions": { + "basicAuth": { + "type": "basic" + } + }, + "security": [ + { + "basicAuth": [] + } + ], + "x-readme": { + "samples-languages": [ + "curl", + "go", + "node", + "python" + ] + } +} \ No newline at end of file diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json new file mode 100644 index 0000000000..1f185ece33 --- /dev/null +++ b/api/swagger/swagger-dev.json @@ -0,0 +1,30986 @@ +{ + "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": { + "/logs.zip": { + "get": { + "description": "Returns the PMM Server logs.", + "produces": [ + "application/zip" + ], + "tags": [ + "Server" + ], + "summary": "Logs", + "operationId": "Logs", + "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" + } + } + } + } + } + } + }, + "/v0/qan/Filters/Get": { + "post": { + "tags": [ + "Filters" + ], + "summary": "Get gets map of metrics names.", + "operationId": "Get", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "FiltersRequest 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": "FiltersReply 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/GetMetricsNames": { + "post": { + "tags": [ + "MetricsNames" + ], + "summary": "GetMetricsNames gets map of metrics names.", + "operationId": "GetMetricsNames", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "MetricsNamesRequest is emty.", + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/GetReport": { + "post": { + "tags": [ + "Profile" + ], + "summary": "GetReport returns list of metrics group by queryid or other dimentions.", + "operationId": "GetReport", + "parameters": [ + { + "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": 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": "Boolean metrics:\n- *_sum_per_sec - how many times this matric was true.\n\nQuery 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": "MongoDB metrics.\n\nThe 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_shared_blks_hit_sum_per_sec": { + "description": "PostgreSQL metrics.\n\nTotal number of shared block cache hits by the statement.", + "type": "number", + "format": "float", + "x-order": 43 + }, + "m_shared_blks_read_sum_per_sec": { + "description": "Total number of shared blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 44 + }, + "m_shared_blks_dirtied_sum_per_sec": { + "description": "Total number of shared blocks dirtied by the statement.", + "type": "number", + "format": "float", + "x-order": 45 + }, + "m_shared_blks_written_sum_per_sec": { + "description": "Total number of shared blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 46 + }, + "m_local_blks_hit_sum_per_sec": { + "description": "Total number of local block cache hits by the statement.", + "type": "number", + "format": "float", + "x-order": 47 + }, + "m_local_blks_read_sum_per_sec": { + "description": "Total number of local blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 48 + }, + "m_local_blks_dirtied_sum_per_sec": { + "description": "Total number of local blocks dirtied by the statement.", + "type": "number", + "format": "float", + "x-order": 49 + }, + "m_local_blks_written_sum_per_sec": { + "description": "Total number of local blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 50 + }, + "m_temp_blks_read_sum_per_sec": { + "description": "Total number of temp blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 51 + }, + "m_temp_blks_written_sum_per_sec": { + "description": "Total number of temp blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 52 + }, + "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": 53 + }, + "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": 54 + }, + "m_cpu_user_time_sum_per_sec": { + "description": "Total time user spent in query.", + "type": "number", + "format": "float", + "x-order": 55 + }, + "m_cpu_sys_time_sum_per_sec": { + "description": "Total time system spent in query.", + "type": "number", + "format": "float", + "x-order": 56 + }, + "m_plans_calls_sum_per_sec": { + "description": "Total number of planned calls.", + "type": "number", + "format": "float", + "title": "pg_stat_monitor 0.9 metrics", + "x-order": 57 + }, + "m_wal_records_sum_per_sec": { + "description": "Total number of WAL (Write-ahead logging) records.", + "type": "number", + "format": "float", + "x-order": 58 + }, + "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": 59 + }, + "m_wal_bytes_sum_per_sec": { + "description": "Total bytes of WAL (Write-ahead logging) records.", + "type": "number", + "format": "float", + "x-order": 60 + }, + "m_plan_time_sum_per_sec": { + "description": "Plan time in per seconds.", + "type": "number", + "format": "float", + "x-order": 61 + } + } + }, + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/ObjectDetails/GetHistogram": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "GetHistogram gets histogram items for specific filtering.", + "operationId": "GetHistogram", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "HistogramRequest 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": "HistogramReply 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/ObjectDetails/GetLabels": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "GetLabels gets list of labels for object details.", + "operationId": "GetLabels", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "ObjectDetailsLabelsRequest 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": "ObjectDetailsLabelsReply 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/ObjectDetails/GetMetrics": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "GetMetrics gets map of metrics for specific filtering.", + "operationId": "GetMetrics", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "MetricsRequest 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": "MetricsReply 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": "Boolean metrics:\n- *_sum_per_sec - how many times this matric was true.\n\nQuery 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": "MongoDB metrics.\n\nThe 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_shared_blks_hit_sum_per_sec": { + "description": "PostgreSQL metrics.\n\nTotal number of shared block cache hits by the statement.", + "type": "number", + "format": "float", + "x-order": 43 + }, + "m_shared_blks_read_sum_per_sec": { + "description": "Total number of shared blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 44 + }, + "m_shared_blks_dirtied_sum_per_sec": { + "description": "Total number of shared blocks dirtied by the statement.", + "type": "number", + "format": "float", + "x-order": 45 + }, + "m_shared_blks_written_sum_per_sec": { + "description": "Total number of shared blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 46 + }, + "m_local_blks_hit_sum_per_sec": { + "description": "Total number of local block cache hits by the statement.", + "type": "number", + "format": "float", + "x-order": 47 + }, + "m_local_blks_read_sum_per_sec": { + "description": "Total number of local blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 48 + }, + "m_local_blks_dirtied_sum_per_sec": { + "description": "Total number of local blocks dirtied by the statement.", + "type": "number", + "format": "float", + "x-order": 49 + }, + "m_local_blks_written_sum_per_sec": { + "description": "Total number of local blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 50 + }, + "m_temp_blks_read_sum_per_sec": { + "description": "Total number of temp blocks read by the statement.", + "type": "number", + "format": "float", + "x-order": 51 + }, + "m_temp_blks_written_sum_per_sec": { + "description": "Total number of temp blocks written by the statement.", + "type": "number", + "format": "float", + "x-order": 52 + }, + "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": 53 + }, + "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": 54 + }, + "m_cpu_user_time_sum_per_sec": { + "description": "Total time user spent in query.", + "type": "number", + "format": "float", + "x-order": 55 + }, + "m_cpu_sys_time_sum_per_sec": { + "description": "Total time system spent in query.", + "type": "number", + "format": "float", + "x-order": 56 + }, + "m_plans_calls_sum_per_sec": { + "description": "Total number of planned calls.", + "type": "number", + "format": "float", + "title": "pg_stat_monitor 0.9 metrics", + "x-order": 57 + }, + "m_wal_records_sum_per_sec": { + "description": "Total number of WAL (Write-ahead logging) records.", + "type": "number", + "format": "float", + "x-order": 58 + }, + "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": 59 + }, + "m_wal_bytes_sum_per_sec": { + "description": "Total bytes of WAL (Write-ahead logging) records.", + "type": "number", + "format": "float", + "x-order": 60 + }, + "m_plan_time_sum_per_sec": { + "description": "Plan time in per seconds.", + "type": "number", + "format": "float", + "x-order": 61 + } + } + }, + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/ObjectDetails/GetQueryExample": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "GetQueryExample gets list of query examples.", + "operationId": "GetQueryExample", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "QueryExampleRequest 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": "QueryExampleReply 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_format": { + "description": "ExampleFormat is format of query example: real or query without values.\n\nDeprecated: is not used, should not be used, should be removed.", + "type": "string", + "default": "EXAMPLE_FORMAT_INVALID", + "enum": [ + "EXAMPLE_FORMAT_INVALID", + "EXAMPLE", + "FINGERPRINT" + ] + }, + "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_INVALID", + "enum": [ + "EXAMPLE_TYPE_INVALID", + "RANDOM", + "SLOWEST", + "FASTEST", + "WITH_ERROR" + ] + }, + "is_truncated": { + "type": "integer", + "format": "int64", + "x-order": 3 + }, + "example_metrics": { + "type": "string", + "x-order": 4 + }, + "service_id": { + "type": "string", + "x-order": 5 + }, + "service_type": { + "type": "string", + "x-order": 6 + }, + "schema": { + "type": "string", + "x-order": 7 + }, + "tables": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 8 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v0/qan/ObjectDetails/GetQueryPlan": { + "post": { + "tags": [ + "ObjectDetails" + ], + "summary": "GetQueryPlan gets query plan and plan id for specific filtering.", + "operationId": "GetQueryPlan", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "QueryPlanRequest defines filtering by queryid.", + "type": "object", + "properties": { + "queryid": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "description": "QueryPlanReply 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/AWSInstanceCheck": { + "post": { + "description": "Checks AWS EC2 instance ID.", + "tags": [ + "Server" + ], + "summary": "AWS instance check", + "operationId": "AWSInstanceCheck", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "instance_id": { + "description": "AWS EC2 instance ID (i-1234567890abcdef0).", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/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": [ + "Platform" + ], + "summary": "Connect", + "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 + }, + "email": { + "description": "Existing Percona Platform user's email.", + "type": "string", + "x-order": 1 + }, + "password": { + "description": "Existing Percona Platform user's password.", + "type": "string", + "x-order": 2 + }, + "personal_access_token": { + "description": "Personal Access Token that the user obtains from Percona Portal.", + "type": "string", + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Platform/Disconnect": { + "post": { + "description": "Disconnect a PMM server from the organization created on Percona Portal.", + "tags": [ + "Platform" + ], + "summary": "Disconnect", + "operationId": "Disconnect", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Platform/SearchOrganizationEntitlements": { + "post": { + "description": "SearchOrganizationEntitlements fetches details of the entitlement's available to the Portal organization that the PMM server is connected to.", + "tags": [ + "Platform" + ], + "summary": "SearchOrganizationEntitlements", + "operationId": "SearchOrganizationEntitlements", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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 + }, + "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-order": 0 + }, + "config_advisor": { + "description": "Flag indicates that config advisors are covered by this entitlement.", + "type": "string", + "x-order": 1 + } + } + }, + "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-order": 3 + }, + "total_units": { + "description": "Total units covered by this entitlement.", + "type": "string", + "x-order": 4 + }, + "unlimited_units": { + "description": "Flag indicates that unlimited units are covered.", + "type": "boolean", + "x-order": 5 + }, + "support_level": { + "description": "Support level covered by this entitlement.", + "type": "string", + "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 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Platform/SearchOrganizationTickets": { + "post": { + "description": "SearchOrganizationTickets searches support tickets belonging to the Percona Portal Organization that the PMM server is connected to.", + "tags": [ + "Platform" + ], + "summary": "SearchOrganizationTickets", + "operationId": "SearchOrganizationTickets", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Platform/ServerInfo": { + "post": { + "description": "ServerInfo returns PMM server ID and name.", + "tags": [ + "Platform" + ], + "summary": "ServerInfo", + "operationId": "ServerInfo", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Platform/UserStatus": { + "post": { + "description": "UserStatus returns a boolean indicating whether the current user is logged in with their Percona Account or not.", + "tags": [ + "Platform" + ], + "summary": "UserStatus", + "operationId": "UserStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Settings/Change": { + "post": { + "description": "Changes PMM Server settings.", + "tags": [ + "Server" + ], + "summary": "Change settings", + "operationId": "ChangeSettings", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "stt_check_intervals": { + "description": "STTCheckIntervals represents intervals between STT 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 + } + } + }, + "email_alerting_settings": { + "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", + "type": "object", + "properties": { + "from": { + "description": "SMTP From header field.", + "type": "string", + "x-order": 0 + }, + "smarthost": { + "description": "SMTP host and port.", + "type": "string", + "x-order": 1 + }, + "hello": { + "description": "Hostname to identify to the SMTP server.", + "type": "string", + "x-order": 2 + }, + "username": { + "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", + "type": "string", + "x-order": 3 + }, + "password": { + "description": "Auth using LOGIN and PLAIN.", + "type": "string", + "x-order": 4 + }, + "identity": { + "description": "Auth using PLAIN.", + "type": "string", + "x-order": 5 + }, + "secret": { + "description": "Auth using CRAM-MD5.", + "type": "string", + "x-order": 6 + }, + "require_tls": { + "description": "Require TLS.", + "type": "boolean", + "x-order": 7 + } + } + }, + "enable_updates": { + "type": "boolean", + "x-order": 0 + }, + "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 + } + } + }, + "slack_alerting_settings": { + "description": "SlackAlertingSettings represents Slack configuration for Alerting.", + "type": "object", + "properties": { + "url": { + "description": "Slack API (webhook) URL.", + "type": "string", + "x-order": 0 + } + } + }, + "disable_updates": { + "type": "boolean", + "x-order": 1 + }, + "enable_telemetry": { + "type": "boolean", + "x-order": 2 + }, + "disable_telemetry": { + "type": "boolean", + "x-order": 3 + }, + "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": 5 + }, + "ssh_key": { + "type": "string", + "x-order": 6 + }, + "aws_partitions": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 7 + }, + "alert_manager_url": { + "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", + "type": "string", + "x-order": 8 + }, + "remove_alert_manager_url": { + "description": "Remove external AlertManager URL.", + "type": "boolean", + "x-order": 9 + }, + "alert_manager_rules": { + "description": "Custom alerting or recording rules.", + "type": "string", + "x-order": 10 + }, + "remove_alert_manager_rules": { + "description": "Remove custom alerting or recording rules.", + "type": "boolean", + "x-order": 11 + }, + "enable_stt": { + "description": "Enable Security Threat Tool.", + "type": "boolean", + "x-order": 12 + }, + "disable_stt": { + "description": "Disable Security Threat Tool.", + "type": "boolean", + "x-order": 13 + }, + "enable_alerting": { + "description": "Enable Alerting.", + "type": "boolean", + "x-order": 14 + }, + "disable_alerting": { + "description": "Disable Alerting.", + "type": "boolean", + "x-order": 15 + }, + "remove_email_alerting_settings": { + "description": "If true, removes Alerting email (SMTP) settings.", + "type": "boolean", + "x-order": 17 + }, + "remove_slack_alerting_settings": { + "description": "If true, removes Alerting Slack settings.", + "type": "boolean", + "x-order": 19 + }, + "pmm_public_address": { + "description": "PMM Server public address.", + "type": "string", + "x-order": 20 + }, + "remove_pmm_public_address": { + "type": "boolean", + "x-order": 21 + }, + "enable_azurediscover": { + "description": "Enable Azure Discover.", + "type": "boolean", + "x-order": 23 + }, + "disable_azurediscover": { + "description": "Disable Azure Discover.", + "type": "boolean", + "x-order": 24 + }, + "enable_backup_management": { + "description": "Enable Backup Management.", + "type": "boolean", + "x-order": 25 + }, + "disable_backup_management": { + "description": "Disable Backup Management.", + "type": "boolean", + "x-order": 26 + }, + "enable_dbaas": { + "description": "Enable DBaaS.", + "type": "boolean", + "x-order": 27 + }, + "disable_dbaas": { + "description": "Disable DBaaS.", + "type": "boolean", + "x-order": 28 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "settings": { + "description": "Settings represents PMM Server settings.", + "type": "object", + "properties": { + "email_alerting_settings": { + "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", + "type": "object", + "properties": { + "from": { + "description": "SMTP From header field.", + "type": "string", + "x-order": 0 + }, + "smarthost": { + "description": "SMTP host and port.", + "type": "string", + "x-order": 1 + }, + "hello": { + "description": "Hostname to identify to the SMTP server.", + "type": "string", + "x-order": 2 + }, + "username": { + "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", + "type": "string", + "x-order": 3 + }, + "password": { + "description": "Auth using LOGIN and PLAIN.", + "type": "string", + "x-order": 4 + }, + "identity": { + "description": "Auth using PLAIN.", + "type": "string", + "x-order": 5 + }, + "secret": { + "description": "Auth using CRAM-MD5.", + "type": "string", + "x-order": 6 + }, + "require_tls": { + "description": "Require TLS.", + "type": "boolean", + "x-order": 7 + } + } + }, + "stt_check_intervals": { + "description": "STTCheckIntervals represents intervals between STT 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 + } + } + }, + "slack_alerting_settings": { + "description": "SlackAlertingSettings represents Slack configuration for Alerting.", + "type": "object", + "properties": { + "url": { + "description": "Slack API (webhook) URL.", + "type": "string", + "x-order": 0 + } + } + }, + "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 + } + } + }, + "updates_disabled": { + "description": "True if updates are disabled.", + "type": "boolean", + "x-order": 0 + }, + "telemetry_enabled": { + "description": "True if telemetry is enabled.", + "type": "boolean", + "x-order": 1 + }, + "data_retention": { + "type": "string", + "x-order": 3 + }, + "ssh_key": { + "type": "string", + "x-order": 4 + }, + "aws_partitions": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 5 + }, + "alert_manager_url": { + "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", + "type": "string", + "x-order": 6 + }, + "alert_manager_rules": { + "description": "Custom alerting or recording rules.", + "type": "string", + "x-order": 7 + }, + "stt_enabled": { + "description": "True if Security Threat Tool is enabled.", + "type": "boolean", + "x-order": 8 + }, + "platform_email": { + "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", + "type": "string", + "x-order": 9 + }, + "dbaas_enabled": { + "description": "True if DBaaS is enabled.", + "type": "boolean", + "x-order": 10 + }, + "alerting_enabled": { + "description": "True if Alerting is enabled.", + "type": "boolean", + "x-order": 11 + }, + "pmm_public_address": { + "description": "PMM Server public address.", + "type": "string", + "x-order": 14 + }, + "backup_management_enabled": { + "description": "True if Backup Management is enabled.", + "type": "boolean", + "x-order": 16 + }, + "azurediscover_enabled": { + "description": "True if Azure Discover is enabled.", + "type": "boolean", + "x-order": 17 + }, + "connected_to_platform": { + "type": "boolean", + "title": "True if the PMM instance is connected to Platform", + "x-order": 18 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Settings/Get": { + "post": { + "description": "Returns current PMM Server settings.", + "tags": [ + "Server" + ], + "summary": "Get settings", + "operationId": "GetSettings", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "settings": { + "description": "Settings represents PMM Server settings.", + "type": "object", + "properties": { + "email_alerting_settings": { + "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", + "type": "object", + "properties": { + "from": { + "description": "SMTP From header field.", + "type": "string", + "x-order": 0 + }, + "smarthost": { + "description": "SMTP host and port.", + "type": "string", + "x-order": 1 + }, + "hello": { + "description": "Hostname to identify to the SMTP server.", + "type": "string", + "x-order": 2 + }, + "username": { + "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", + "type": "string", + "x-order": 3 + }, + "password": { + "description": "Auth using LOGIN and PLAIN.", + "type": "string", + "x-order": 4 + }, + "identity": { + "description": "Auth using PLAIN.", + "type": "string", + "x-order": 5 + }, + "secret": { + "description": "Auth using CRAM-MD5.", + "type": "string", + "x-order": 6 + }, + "require_tls": { + "description": "Require TLS.", + "type": "boolean", + "x-order": 7 + } + } + }, + "stt_check_intervals": { + "description": "STTCheckIntervals represents intervals between STT 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 + } + } + }, + "slack_alerting_settings": { + "description": "SlackAlertingSettings represents Slack configuration for Alerting.", + "type": "object", + "properties": { + "url": { + "description": "Slack API (webhook) URL.", + "type": "string", + "x-order": 0 + } + } + }, + "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 + } + } + }, + "updates_disabled": { + "description": "True if updates are disabled.", + "type": "boolean", + "x-order": 0 + }, + "telemetry_enabled": { + "description": "True if telemetry is enabled.", + "type": "boolean", + "x-order": 1 + }, + "data_retention": { + "type": "string", + "x-order": 3 + }, + "ssh_key": { + "type": "string", + "x-order": 4 + }, + "aws_partitions": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 5 + }, + "alert_manager_url": { + "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", + "type": "string", + "x-order": 6 + }, + "alert_manager_rules": { + "description": "Custom alerting or recording rules.", + "type": "string", + "x-order": 7 + }, + "stt_enabled": { + "description": "True if Security Threat Tool is enabled.", + "type": "boolean", + "x-order": 8 + }, + "platform_email": { + "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", + "type": "string", + "x-order": 9 + }, + "dbaas_enabled": { + "description": "True if DBaaS is enabled.", + "type": "boolean", + "x-order": 10 + }, + "alerting_enabled": { + "description": "True if Alerting is enabled.", + "type": "boolean", + "x-order": 11 + }, + "pmm_public_address": { + "description": "PMM Server public address.", + "type": "string", + "x-order": 14 + }, + "backup_management_enabled": { + "description": "True if Backup Management is enabled.", + "type": "boolean", + "x-order": 16 + }, + "azurediscover_enabled": { + "description": "True if Azure Discover is enabled.", + "type": "boolean", + "x-order": 17 + }, + "connected_to_platform": { + "type": "boolean", + "title": "True if the PMM instance is connected to Platform", + "x-order": 18 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Settings/TestEmailAlertingSettings": { + "post": { + "description": "Sends test email to check current SMTP settings for email alerting.", + "tags": [ + "Server" + ], + "summary": "Test email alerting", + "operationId": "TestEmailAlertingSettings", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "email_alerting_settings": { + "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", + "type": "object", + "properties": { + "from": { + "description": "SMTP From header field.", + "type": "string", + "x-order": 0 + }, + "smarthost": { + "description": "SMTP host and port.", + "type": "string", + "x-order": 1 + }, + "hello": { + "description": "Hostname to identify to the SMTP server.", + "type": "string", + "x-order": 2 + }, + "username": { + "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", + "type": "string", + "x-order": 3 + }, + "password": { + "description": "Auth using LOGIN and PLAIN.", + "type": "string", + "x-order": 4 + }, + "identity": { + "description": "Auth using PLAIN.", + "type": "string", + "x-order": 5 + }, + "secret": { + "description": "Auth using CRAM-MD5.", + "type": "string", + "x-order": 6 + }, + "require_tls": { + "description": "Require TLS.", + "type": "boolean", + "x-order": 7 + } + } + }, + "email_to": { + "description": "Target email address to send the email to.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Updates/Check": { + "post": { + "description": "Checks for available PMM Server updates.", + "tags": [ + "Server" + ], + "summary": "Check updates", + "operationId": "CheckUpdates", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "force": { + "description": "If false, cached information may be returned.", + "type": "boolean", + "x-order": 0 + }, + "only_installed_version": { + "description": "If true, only installed version will be in response.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "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 + } + } + }, + "latest": { + "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 + } + } + }, + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Updates/Start": { + "post": { + "description": "Starts PMM Server update.", + "tags": [ + "Server" + ], + "summary": "Start update", + "operationId": "StartUpdate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Updates/Status": { + "post": { + "description": "Returns PMM Server update status.", + "tags": [ + "Server" + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddAzureDatabaseExporter": { + "post": { + "description": "Adds azure_database_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add Azure Database Exporter", + "operationId": "AddAzureDatabaseExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddExternalExporter": { + "post": { + "description": "Adds external_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add External Exporter", + "operationId": "AddExternalExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddMongoDBExporter": { + "post": { + "description": "Adds mongodb_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add MongoDB Exporter", + "operationId": "AddMongoDBExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddMySQLdExporter": { + "post": { + "description": "Adds mysqld_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add mysqld Exporter", + "operationId": "AddMySQLdExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + }, + "table_count": { + "description": "Actual table count at the moment of adding.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddNodeExporter": { + "post": { + "description": "Adds node_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add Node Exporter", + "operationId": "AddNodeExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 7 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddPMMAgent": { + "post": { + "description": "Adds PMM Agent.", + "tags": [ + "Agents" + ], + "summary": "Add PMM Agent", + "operationId": "AddPMMAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddPostgresExporter": { + "post": { + "description": "Adds postgres_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add Postgres Exporter", + "operationId": "AddPostgresExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddProxySQLExporter": { + "post": { + "description": "Adds proxysql_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add ProxySQL Exporter", + "operationId": "AddProxySQLExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddQANMongoDBProfilerAgent": { + "post": { + "description": "Adds 'Query Analytics MongoDB Profiler' Agent.", + "tags": [ + "Agents" + ], + "summary": "Add 'QAN MongoDB Profiler' Agent", + "operationId": "AddQANMongoDBProfilerAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "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 + }, + "authentication_mechanism": { + "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", + "type": "string", + "x-order": 11 + }, + "authentication_database": { + "description": "Authentication database.", + "type": "string", + "x-order": 12 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddQANMySQLPerfSchemaAgent": { + "post": { + "description": "Adds 'Query Analytics MySQL PerfSchema' Agent.", + "tags": [ + "Agents" + ], + "summary": "Add 'QAN MySQL PerfSchema' Agent", + "operationId": "AddQANMySQLPerfSchemaAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "qan_mysql_perfschema_agent": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddQANMySQLSlowlogAgent": { + "post": { + "description": "Adds 'Query Analytics MySQL Slowlog' Agent.", + "tags": [ + "Agents" + ], + "summary": "Add 'QAN MySQL Slowlog' Agent", + "operationId": "AddQANMySQLSlowlogAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 9 + }, + "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": 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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "qan_mysql_slowlog_agent": { + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 11 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 12 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddQANPostgreSQLPgStatMonitorAgent": { + "post": { + "description": "Adds 'Query Analytics PostgreSQL pg_stat_monitor' Agent.", + "tags": [ + "Agents" + ], + "summary": "Add 'QAN PostgreSQL pg_stat_monitor' Agent", + "operationId": "AddQANPostgreSQLPgStatMonitorAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 6 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 8 + }, + "tls_ca": { + "description": "TLS CA certificate.", + "type": "string", + "x-order": 9 + }, + "tls_cert": { + "description": "TLS Certifcate.", + "type": "string", + "x-order": 10 + }, + "tls_key": { + "description": "TLS Certificate Key.", + "type": "string", + "x-order": 11 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddQANPostgreSQLPgStatementsAgent": { + "post": { + "description": "Adds 'Query Analytics PostgreSQL pg_stat_statements' Agent.", + "tags": [ + "Agents" + ], + "summary": "Add 'QAN PostgreSQL pg_stat_statements' Agent", + "operationId": "AddQANPostgreSQLPgStatementsAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "tls_ca": { + "description": "TLS CA certificate.", + "type": "string", + "x-order": 8 + }, + "tls_cert": { + "description": "TLS Certifcate.", + "type": "string", + "x-order": 9 + }, + "tls_key": { + "description": "TLS Certificate Key.", + "type": "string", + "x-order": 10 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddRDSExporter": { + "post": { + "description": "Adds rds_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add RDS Exporter", + "operationId": "AddRDSExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeAzureDatabaseExporter": { + "post": { + "description": "Changes azure_database_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change Azure Database Exporter", + "operationId": "ChangeAzureDatabaseExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeExternalExporter": { + "post": { + "description": "Changes external_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change External Exporter", + "operationId": "ChangeExternalExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeMongoDBExporter": { + "post": { + "description": "Changes mongodb_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change MongoDB Exporter", + "operationId": "ChangeMongoDBExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeMySQLdExporter": { + "post": { + "description": "Changes mysqld_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change mysqld Exporter", + "operationId": "ChangeMySQLdExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeNodeExporter": { + "post": { + "description": "Changes node_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change Node Exporter", + "operationId": "ChangeNodeExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 7 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangePostgresExporter": { + "post": { + "description": "Changes postgres_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change Postgres Exporter", + "operationId": "ChangePostgresExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeProxySQLExporter": { + "post": { + "description": "Changes proxysql_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change ProxySQL Exporter", + "operationId": "ChangeProxySQLExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeQANMongoDBProfilerAgent": { + "post": { + "description": "Changes 'Query Analytics MongoDB Profiler' Agent.", + "tags": [ + "Agents" + ], + "summary": "Change 'QAN MongoDB Profiler' Agent", + "operationId": "ChangeQANMongoDBProfilerAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeQANMySQLPerfSchemaAgent": { + "post": { + "description": "Changes 'Query Analytics MySQL PerfSchema' Agent.", + "tags": [ + "Agents" + ], + "summary": "Change 'QAN MySQL PerfSchema' Agent", + "operationId": "ChangeQANMySQLPerfSchemaAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "qan_mysql_perfschema_agent": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeQANMySQLSlowlogAgent": { + "post": { + "description": "Changes 'Query Analytics MySQL Slowlog' Agent.", + "tags": [ + "Agents" + ], + "summary": "Change 'QAN MySQL Slowlog' Agent", + "operationId": "ChangeQANMySQLSlowlogAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "qan_mysql_slowlog_agent": { + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 11 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 12 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeQANPostgreSQLPgStatMonitorAgent": { + "post": { + "description": "Changes 'Query Analytics PostgreSQL pg_stat_monitor' Agent.", + "tags": [ + "Agents" + ], + "summary": "Change 'QAN PostgreSQL pg_stat_monitor' Agent", + "operationId": "ChangeQANPostgreSQLPgStatMonitorAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeQANPostgreSQLPgStatementsAgent": { + "post": { + "description": "Changes 'Query Analytics PostgreSQL pg_stat_statements' Agent.", + "tags": [ + "Agents" + ], + "summary": "Change 'QAN PostgreSQL pg_stat_statements' Agent", + "operationId": "ChangeQANPostgreSQLPgStatementsAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeRDSExporter": { + "post": { + "description": "Changes rds_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change RDS Exporter", + "operationId": "ChangeRDSExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/Get": { + "post": { + "description": "Returns a single Agent by ID.", + "tags": [ + "Agents" + ], + "summary": "Get Agent", + "operationId": "GetAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 7 + } + } + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "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": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + }, + "qan_mysql_slowlog_agent": { + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 11 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/List": { + "post": { + "description": "Returns a list of all Agents.", + "tags": [ + "Agents" + ], + "summary": "List Agents", + "operationId": "ListAgents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_type": { + "description": "AgentType describes supported Agent types.", + "type": "string", + "default": "AGENT_TYPE_INVALID", + "enum": [ + "AGENT_TYPE_INVALID", + "PMM_AGENT", + "VM_AGENT", + "NODE_EXPORTER", + "MYSQLD_EXPORTER", + "MONGODB_EXPORTER", + "POSTGRES_EXPORTER", + "PROXYSQL_EXPORTER", + "QAN_MYSQL_PERFSCHEMA_AGENT", + "QAN_MYSQL_SLOWLOG_AGENT", + "QAN_MONGODB_PROFILER_AGENT", + "QAN_POSTGRESQL_PGSTATEMENTS_AGENT", + "QAN_POSTGRESQL_PGSTATMONITOR_AGENT", + "RDS_EXPORTER", + "EXTERNAL_EXPORTER", + "AZURE_DATABASE_EXPORTER" + ] + }, + "pmm_agent_id": { + "description": "Return only Agents started by this pmm-agent.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", + "type": "string", + "x-order": 0 + }, + "node_id": { + "description": "Return only Agents that provide insights for that Node.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", + "type": "string", + "x-order": 1 + }, + "service_id": { + "description": "Return only Agents that provide insights for that Service.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", + "type": "string", + "x-order": 2 + } + } + } + } + ], + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 7 + } + } + }, + "x-order": 2 + }, + "mysqld_exporter": { + "type": "array", + "items": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "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": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + }, + "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": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 11 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 12 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + } + }, + "x-order": 9 + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "x-order": 10 + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + } + }, + "x-order": 11 + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 + } + } + }, + "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 + } + } + }, + "x-order": 13 + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "x-order": 14 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/Remove": { + "post": { + "description": "Removes Agent.", + "tags": [ + "Agents" + ], + "summary": "Remove Agent", + "operationId": "RemoveAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "force": { + "description": "Remove agent with all dependencies.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/AddContainer": { + "post": { + "description": "Adds container Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Container Node", + "operationId": "AddContainerNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/AddGeneric": { + "post": { + "description": "Adds generic Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Generic Node", + "operationId": "AddGenericNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/AddRemote": { + "post": { + "description": "Adds remote Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Remote Node", + "operationId": "AddRemoteNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/AddRemoteAzureDatabase": { + "post": { + "description": "Adds remote Azure database Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Remote Azure Database Node", + "operationId": "AddRemoteAzureDatabaseNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/AddRemoteRDS": { + "post": { + "description": "Adds remote RDS Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Remote RDS Node", + "operationId": "AddRemoteRDSNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/Get": { + "post": { + "description": "Returns a single Node by ID.", + "tags": [ + "Nodes" + ], + "summary": "Get Node", + "operationId": "GetNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/List": { + "post": { + "description": "Returns a list of all Nodes.", + "tags": [ + "Nodes" + ], + "summary": "List Nodes", + "operationId": "ListNodes", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + } + } + } + } + ], + "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 + } + } + }, + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/Remove": { + "post": { + "description": "Removes Node.", + "tags": [ + "Nodes" + ], + "summary": "Remove Node", + "operationId": "RemoveNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "force": { + "description": "Remove node with all dependencies.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddExternalService": { + "post": { + "description": "Adds External Service.", + "tags": [ + "Services" + ], + "summary": "Add External Service", + "operationId": "AddExternalService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddHAProxyService": { + "post": { + "description": "Adds HAProxy Service.", + "tags": [ + "Services" + ], + "summary": "Add HAProxy Service", + "operationId": "AddHAProxyService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddMongoDB": { + "post": { + "description": "Adds MongoDB Service.", + "tags": [ + "Services" + ], + "summary": "Add MongoDB Service", + "operationId": "AddMongoDBService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddMySQL": { + "post": { + "description": "Adds MySQL Service.", + "tags": [ + "Services" + ], + "summary": "Add MySQL Service", + "operationId": "AddMySQLService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddPostgreSQL": { + "post": { + "description": "Adds PostgreSQL Service.", + "tags": [ + "Services" + ], + "summary": "Add PostgreSQL Service", + "operationId": "AddPostgreSQLService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddProxySQL": { + "post": { + "description": "Adds ProxySQL Service.", + "tags": [ + "Services" + ], + "summary": "Add ProxySQL Service", + "operationId": "AddProxySQLService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/Get": { + "post": { + "description": "Returns a single Service by ID.", + "tags": [ + "Services" + ], + "summary": "Get Service", + "operationId": "GetService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "service_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/List": { + "post": { + "description": "Returns a list of Services filtered by type.", + "tags": [ + "Services" + ], + "summary": "List Services", + "operationId": "ListServices", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "node_id": { + "description": "Return only Services running on that Node.", + "type": "string", + "x-order": 0 + }, + "service_type": { + "description": "ServiceType describes supported Service types.", + "type": "string", + "default": "SERVICE_TYPE_INVALID", + "enum": [ + "SERVICE_TYPE_INVALID", + "MYSQL_SERVICE", + "MONGODB_SERVICE", + "POSTGRESQL_SERVICE", + "PROXYSQL_SERVICE", + "HAPROXY_SERVICE", + "EXTERNAL_SERVICE" + ] + }, + "external_group": { + "description": "Return only services in this external group.", + "type": "string", + "x-order": 2 + } + } + } + } + ], + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/Remove": { + "post": { + "description": "Removes Service.", + "tags": [ + "Services" + ], + "summary": "Remove Service", + "operationId": "RemoveService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "service_id": { + "description": "Unique randomly generated instance identifier. Required.", + "type": "string", + "x-order": 0 + }, + "force": { + "description": "Remove service with all dependencies.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/Cancel": { + "post": { + "description": "Stops an Action.", + "tags": [ + "Actions" + ], + "summary": "Cancel 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/Get": { + "post": { + "description": "Gets the result of a given Action.", + "tags": [ + "Actions" + ], + "summary": "Get Action", + "operationId": "GetAction", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "action_id": { + "description": "Unique Action ID.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMongoDBExplain": { + "post": { + "description": "Starts 'MongoDB EXPLAIN' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'MongoDB EXPLAIN' Action", + "operationId": "StartMongoDBExplainAction", + "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 + }, + "service_id": { + "description": "Service ID for this Action. Required.", + "type": "string", + "x-order": 1 + }, + "query": { + "description": "Query. Required.", + "type": "string", + "x-order": 2 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLExplain": { + "post": { + "description": "Starts 'MySQL EXPLAIN' Action with traditional output.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL EXPLAIN' Action", + "operationId": "StartMySQLExplainAction", + "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 + }, + "service_id": { + "description": "Service ID for this Action. Required.", + "type": "string", + "x-order": 1 + }, + "query": { + "description": "SQL query. Required.", + "type": "string", + "x-order": 2 + }, + "database": { + "description": "Database name. Required if it can't be deduced from the query.", + "type": "string", + "x-order": 3 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLExplainJSON": { + "post": { + "description": "Starts 'MySQL EXPLAIN' Action with JSON output.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL EXPLAIN JSON' Action", + "operationId": "StartMySQLExplainJSONAction", + "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 + }, + "service_id": { + "description": "Service ID for this Action. Required.", + "type": "string", + "x-order": 1 + }, + "query": { + "description": "SQL query. Required.", + "type": "string", + "x-order": 2 + }, + "database": { + "description": "Database name. Required if it can't be deduced from the query.", + "type": "string", + "x-order": 3 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLExplainTraditionalJSON": { + "post": { + "description": "Starts 'MySQL EXPLAIN' Action with traditional JSON output.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL EXPLAIN Traditional JSON' Action", + "operationId": "StartMySQLExplainTraditionalJSONAction", + "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 + }, + "service_id": { + "description": "Service ID for this Action. Required.", + "type": "string", + "x-order": 1 + }, + "query": { + "description": "SQL query. Required.", + "type": "string", + "x-order": 2 + }, + "database": { + "description": "Database name. Required if it can't be deduced from the query.", + "type": "string", + "x-order": 3 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLShowCreateTable": { + "post": { + "description": "Starts 'MySQL SHOW CREATE TABLE' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL SHOW CREATE TABLE' Action", + "operationId": "StartMySQLShowCreateTableAction", + "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 + }, + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLShowIndex": { + "post": { + "description": "Starts 'MySQL SHOW INDEX' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL SHOW INDEX' Action", + "operationId": "StartMySQLShowIndexAction", + "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 + }, + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLShowTableStatus": { + "post": { + "description": "Starts 'MySQL SHOW TABLE STATUS' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL SHOW TABLE STATUS' Action", + "operationId": "StartMySQLShowTableStatusAction", + "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 + }, + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPTMongoDBSummary": { + "post": { + "description": "Starts 'Percona Toolkit MongoDB Summary' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'PT MongoDB Summary' Action", + "operationId": "StartPTMongoDBSummaryAction", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPTMySQLSummary": { + "post": { + "description": "Starts 'Percona Toolkit MySQL Summary' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'PT MySQL Summary' Action", + "operationId": "StartPTMySQLSummaryAction", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPTPgSummary": { + "post": { + "description": "Starts 'Percona Toolkit PostgreSQL Summary' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'PT PostgreSQL Summary' Action", + "operationId": "StartPTPgSummaryAction", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPTSummary": { + "post": { + "description": "Starts 'Percona Toolkit Summary' Action.", + "tags": [ + "Actions" + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPostgreSQLShowCreateTable": { + "post": { + "description": "Starts 'PostgreSQL SHOW CREATE TABLE' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'PostgreSQL SHOW CREATE TABLE' Action", + "operationId": "StartPostgreSQLShowCreateTableAction", + "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 + }, + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPostgreSQLShowIndex": { + "post": { + "description": "Starts 'PostgreSQL SHOW INDEX' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'PostgreSQL SHOW INDEX' Action", + "operationId": "StartPostgreSQLShowIndexAction", + "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 + }, + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Annotations/Add": { + "post": { + "description": "Adds annotation.", + "tags": [ + "Annotation" + ], + "summary": "Add Annotation", + "operationId": "AddAnnotation", + "parameters": [ + { + "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 annotate node.", + "type": "string", + "x-order": 2 + }, + "service_names": { + "description": "Used for annotate 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/ChangePSMDB": { + "post": { + "tags": [ + "Components" + ], + "summary": "ChangePSMDBComponents manages PSMDB related components.", + "operationId": "ChangePSMDBComponents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "mongod": { + "description": "ChangeComponent contains fields to manage components.", + "type": "object", + "properties": { + "default_version": { + "type": "string", + "x-order": 0 + }, + "versions": { + "type": "array", + "items": { + "description": "ComponentVersion contains operations which should be done with component version.", + "type": "object", + "properties": { + "version": { + "type": "string", + "x-order": 0 + }, + "disable": { + "type": "boolean", + "x-order": 1 + }, + "enable": { + "type": "boolean", + "x-order": 2 + } + } + }, + "x-order": 1 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/ChangePXC": { + "post": { + "tags": [ + "Components" + ], + "summary": "ChangePXCComponents manages PXC related components.", + "operationId": "ChangePXCComponents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "haproxy": { + "description": "ChangeComponent contains fields to manage components.", + "type": "object", + "properties": { + "default_version": { + "type": "string", + "x-order": 0 + }, + "versions": { + "type": "array", + "items": { + "description": "ComponentVersion contains operations which should be done with component version.", + "type": "object", + "properties": { + "version": { + "type": "string", + "x-order": 0 + }, + "disable": { + "type": "boolean", + "x-order": 1 + }, + "enable": { + "type": "boolean", + "x-order": 2 + } + } + }, + "x-order": 1 + } + } + }, + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "proxysql": { + "description": "ChangeComponent contains fields to manage components.", + "type": "object", + "properties": { + "default_version": { + "type": "string", + "x-order": 0 + }, + "versions": { + "type": "array", + "items": { + "description": "ComponentVersion contains operations which should be done with component version.", + "type": "object", + "properties": { + "version": { + "type": "string", + "x-order": 0 + }, + "disable": { + "type": "boolean", + "x-order": 1 + }, + "enable": { + "type": "boolean", + "x-order": 2 + } + } + }, + "x-order": 1 + } + } + }, + "pxc": { + "description": "ChangeComponent contains fields to manage components.", + "type": "object", + "properties": { + "default_version": { + "type": "string", + "x-order": 0 + }, + "versions": { + "type": "array", + "items": { + "description": "ComponentVersion contains operations which should be done with component version.", + "type": "object", + "properties": { + "version": { + "type": "string", + "x-order": 0 + }, + "disable": { + "type": "boolean", + "x-order": 1 + }, + "enable": { + "type": "boolean", + "x-order": 2 + } + } + }, + "x-order": 1 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/CheckForOperatorUpdate": { + "post": { + "tags": [ + "Components" + ], + "summary": "CheckForOperatorUpdate checks if a new version of an operator is available.", + "operationId": "CheckForOperatorUpdate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "cluster_to_components": { + "description": "The cluster name is used as a key for this map, value contains components and their inforamtion about update.", + "type": "object", + "additionalProperties": { + "description": "ComponentsUpdateInformation contains info about components and their available latest versions.", + "type": "object", + "properties": { + "component_to_update_information": { + "description": "component_to_update_information stores, under the name of the component, information about the update.\n\"pxc-operator\", \"psmdb-operator\" are names used by backend for our operators.", + "type": "object", + "additionalProperties": { + "description": "ComponentUpdateInformation contains version we can update to for certain component.", + "type": "object", + "properties": { + "available_version": { + "type": "string", + "x-order": 0 + } + } + }, + "x-order": 0 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/GetPSMDB": { + "post": { + "tags": [ + "Components" + ], + "summary": "GetPSMDBComponents returns list of available components for PSMDB Clusters.", + "operationId": "GetPSMDBComponents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "db_version": { + "description": "Version of DB.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "versions": { + "type": "array", + "items": { + "description": "OperatorVersion contains information about operator and components matrix.", + "type": "object", + "properties": { + "matrix": { + "description": "Matrix contains all available components.", + "type": "object", + "properties": { + "mongod": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 0 + }, + "pxc": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 1 + }, + "pmm": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 2 + }, + "proxysql": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 3 + }, + "haproxy": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 4 + }, + "backup": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 5 + }, + "operator": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 6 + }, + "log_collector": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 7 + } + } + }, + "product": { + "type": "string", + "x-order": 0 + }, + "operator": { + "type": "string", + "x-order": 1 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/GetPXC": { + "post": { + "tags": [ + "Components" + ], + "summary": "GetPXCComponents returns list of available components for PXC Clusters.", + "operationId": "GetPXCComponents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "db_version": { + "description": "Version of DB.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "versions": { + "type": "array", + "items": { + "description": "OperatorVersion contains information about operator and components matrix.", + "type": "object", + "properties": { + "matrix": { + "description": "Matrix contains all available components.", + "type": "object", + "properties": { + "mongod": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 0 + }, + "pxc": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 1 + }, + "pmm": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 2 + }, + "proxysql": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 3 + }, + "haproxy": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 4 + }, + "backup": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 5 + }, + "operator": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 6 + }, + "log_collector": { + "type": "object", + "additionalProperties": { + "description": "Component contains information about component.", + "type": "object", + "properties": { + "image_path": { + "type": "string", + "x-order": 0 + }, + "image_hash": { + "type": "string", + "x-order": 1 + }, + "status": { + "type": "string", + "x-order": 2 + }, + "critical": { + "type": "boolean", + "x-order": 3 + }, + "default": { + "type": "boolean", + "x-order": 4 + }, + "disabled": { + "type": "boolean", + "x-order": 5 + } + } + }, + "x-order": 7 + } + } + }, + "product": { + "type": "string", + "x-order": 0 + }, + "operator": { + "type": "string", + "x-order": 1 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Components/InstallOperator": { + "post": { + "tags": [ + "Components" + ], + "summary": "InstallOperator installs given operator in given version.", + "operationId": "InstallOperator", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "operator_type": { + "description": "operator_type tells what operator we are interested in updating.", + "type": "string", + "x-order": 1 + }, + "version": { + "description": "version tells what version of the operator we should update to.", + "type": "string", + "x-order": 2 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "status": { + "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", + "type": "string", + "default": "OPERATORS_STATUS_INVALID", + "enum": [ + "OPERATORS_STATUS_INVALID", + "OPERATORS_STATUS_OK", + "OPERATORS_STATUS_UNSUPPORTED", + "OPERATORS_STATUS_NOT_INSTALLED" + ] + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/DBClusters/Delete": { + "post": { + "tags": [ + "DBClusters" + ], + "summary": "DeleteDBCluster deletes DB cluster.", + "operationId": "DeleteDBCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "cluster_type": { + "description": "DBClusterType represents database cluster type.\n\n - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type.\n - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type.\n - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type.", + "type": "string", + "default": "DB_CLUSTER_TYPE_INVALID", + "enum": [ + "DB_CLUSTER_TYPE_INVALID", + "DB_CLUSTER_TYPE_PXC", + "DB_CLUSTER_TYPE_PSMDB" + ] + }, + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "name": { + "description": "DB cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/DBClusters/List": { + "post": { + "tags": [ + "DBClusters" + ], + "summary": "ListDBClusters returns a list of DB clusters.", + "operationId": "ListDBClusters", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "pxc_clusters": { + "description": "PXC clusters information.", + "type": "array", + "items": { + "description": "PXCCluster represents PXC cluster information.", + "type": "object", + "properties": { + "state": { + "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", + "type": "string", + "default": "DB_CLUSTER_STATE_INVALID", + "enum": [ + "DB_CLUSTER_STATE_INVALID", + "DB_CLUSTER_STATE_CHANGING", + "DB_CLUSTER_STATE_READY", + "DB_CLUSTER_STATE_FAILED", + "DB_CLUSTER_STATE_DELETING", + "DB_CLUSTER_STATE_PAUSED", + "DB_CLUSTER_STATE_UPGRADING" + ] + }, + "name": { + "description": "Cluster name.", + "type": "string", + "x-order": 0 + }, + "operation": { + "description": "RunningOperation respresents a long-running operation.", + "type": "object", + "properties": { + "finished_steps": { + "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "description": "Text describing the current operation progress step.", + "type": "string", + "x-order": 1 + }, + "total_steps": { + "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", + "type": "integer", + "format": "int32", + "x-order": 2 + } + } + }, + "params": { + "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "haproxy": { + "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for HAProxy.", + "type": "string", + "x-order": 0 + } + } + }, + "proxysql": { + "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for ProxySQL.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + }, + "pxc": { + "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PXC.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + } + } + }, + "exposed": { + "description": "DB cluster accessible outside of K8s cluster.", + "type": "boolean", + "x-order": 4 + }, + "installed_image": { + "description": "Installed XtraDB image.", + "type": "string", + "x-order": 5 + }, + "available_image": { + "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", + "type": "string", + "x-order": 6 + } + } + }, + "x-order": 0 + }, + "psmdb_clusters": { + "description": "PSMDB clusters information.", + "type": "array", + "items": { + "description": "PSMDBCluster represents PSMDB cluster information.", + "type": "object", + "properties": { + "state": { + "description": "DBClusterState represents DB cluster CR state.\n\n - DB_CLUSTER_STATE_INVALID: DB_CLUSTER_STATE_INVALID represents unknown state.\n - DB_CLUSTER_STATE_CHANGING: DB_CLUSTER_STATE_CHANGING represents a cluster being changed.\n - DB_CLUSTER_STATE_READY: DB_CLUSTER_STATE_READY represents a cluster without pending changes.\n - DB_CLUSTER_STATE_FAILED: DB_CLUSTER_STATE_FAILED represents a failed cluster.\n - DB_CLUSTER_STATE_DELETING: DB_CLUSTER_STATE_DELETING represents a cluster being deleting.\n - DB_CLUSTER_STATE_PAUSED: DB_CLUSTER_STATE_PAUSED represents a cluster is paused.\n - DB_CLUSTER_STATE_UPGRADING: DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING.\nIt indicates database cluster upgrade is ongoing.", + "type": "string", + "default": "DB_CLUSTER_STATE_INVALID", + "enum": [ + "DB_CLUSTER_STATE_INVALID", + "DB_CLUSTER_STATE_CHANGING", + "DB_CLUSTER_STATE_READY", + "DB_CLUSTER_STATE_FAILED", + "DB_CLUSTER_STATE_DELETING", + "DB_CLUSTER_STATE_PAUSED", + "DB_CLUSTER_STATE_UPGRADING" + ] + }, + "name": { + "description": "Cluster name.", + "type": "string", + "x-order": 0 + }, + "operation": { + "description": "RunningOperation respresents a long-running operation.", + "type": "object", + "properties": { + "finished_steps": { + "description": "Finished steps of the operaion; can decrease or increase compared to the previous value.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "description": "Text describing the current operation progress step.", + "type": "string", + "x-order": 1 + }, + "total_steps": { + "description": "Total steps needed to finish the operation; can decrease or increase compared to the previous value.", + "type": "integer", + "format": "int32", + "x-order": 2 + } + } + }, + "params": { + "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "replicaset": { + "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PSMDB.", + "type": "string", + "x-order": 2 + } + } + }, + "exposed": { + "description": "DB cluster accessible outside of K8s cluster.", + "type": "boolean", + "x-order": 4 + }, + "installed_image": { + "description": "Installed PSMDB image.", + "type": "string", + "x-order": 5 + }, + "available_image": { + "description": "Available database version user can upgrade cluster to, returned as an image. Image tag contains the version.\nIf it's empty, no upgrade is available.", + "type": "string", + "x-order": 6 + } + } + }, + "x-order": 1 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/DBClusters/Restart": { + "post": { + "tags": [ + "DBClusters" + ], + "summary": "RestartDBCluster restarts DB cluster.", + "operationId": "RestartDBCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "cluster_type": { + "description": "DBClusterType represents database cluster type.\n\n - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type.\n - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type.\n - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type.", + "type": "string", + "default": "DB_CLUSTER_TYPE_INVALID", + "enum": [ + "DB_CLUSTER_TYPE_INVALID", + "DB_CLUSTER_TYPE_PXC", + "DB_CLUSTER_TYPE_PSMDB" + ] + }, + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "name": { + "description": "PXC cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/GetLogs": { + "post": { + "tags": [ + "LogsAPI" + ], + "summary": "GetLogs gets all logs from db cluster.", + "operationId": "GetLogs", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "cluster_name": { + "description": "DB cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "logs": { + "description": "Log represents list of logs. Each entry contains either container's logs or,\nwhen container field is empty, pod's events.", + "type": "array", + "items": { + "description": "Logs contain logs for certain pod's container. If container is an empty\nstring, logs contain pod's events.", + "type": "object", + "properties": { + "pod": { + "description": "Pod name.", + "type": "string", + "x-order": 0 + }, + "container": { + "description": "Container name.", + "type": "string", + "x-order": 1 + }, + "logs": { + "description": "Content of container's log or pod's events.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 2 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Kubernetes/Get": { + "post": { + "tags": [ + "Kubernetes" + ], + "summary": "GetKubernetesCluster return KubeAuth with Kubernetes config.", + "operationId": "GetKubernetesCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "kube_auth": { + "description": "KubeAuth represents Kubernetes / kubectl authentication and authorization information.", + "type": "object", + "properties": { + "kubeconfig": { + "description": "Kubeconfig file content.", + "type": "string", + "x-order": 0 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Kubernetes/List": { + "post": { + "tags": [ + "Kubernetes" + ], + "summary": "ListKubernetesClusters returns a list of all registered Kubernetes clusters.", + "operationId": "ListKubernetesClusters", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "kubernetes_clusters": { + "description": "Kubernetes clusters.", + "type": "array", + "items": { + "description": "Cluster contains public info about Kubernetes cluster.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "operators": { + "description": "Operators contains list of operators installed in Kubernetes cluster.", + "type": "object", + "properties": { + "psmdb": { + "description": "Operator contains all information about operator installed in Kubernetes cluster.", + "type": "object", + "properties": { + "status": { + "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", + "type": "string", + "default": "OPERATORS_STATUS_INVALID", + "enum": [ + "OPERATORS_STATUS_INVALID", + "OPERATORS_STATUS_OK", + "OPERATORS_STATUS_UNSUPPORTED", + "OPERATORS_STATUS_NOT_INSTALLED" + ] + }, + "version": { + "type": "string", + "x-order": 1 + } + } + }, + "pxc": { + "description": "Operator contains all information about operator installed in Kubernetes cluster.", + "type": "object", + "properties": { + "status": { + "description": "OperatorsStatus defines status of operators installed in Kubernetes cluster.\n\n - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state.\n - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version.\n - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version.\n - OPERATORS_STATUS_NOT_INSTALLED: OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed.", + "type": "string", + "default": "OPERATORS_STATUS_INVALID", + "enum": [ + "OPERATORS_STATUS_INVALID", + "OPERATORS_STATUS_OK", + "OPERATORS_STATUS_UNSUPPORTED", + "OPERATORS_STATUS_NOT_INSTALLED" + ] + }, + "version": { + "type": "string", + "x-order": 1 + } + } + } + } + }, + "status": { + "description": "KubernetesClusterStatus defines status of Kubernetes cluster.\n\n - KUBERNETES_CLUSTER_STATUS_INVALID: KUBERNETES_CLUSTER_STATUS_INVALID represents unknown state.\n - KUBERNETES_CLUSTER_STATUS_OK: KUBERNETES_CLUSTER_STATUS_OK represents that Kubernetes cluster is accessible.\n - KUBERNETES_CLUSTER_STATUS_UNAVAILABLE: KUBERNETES_CLUSTER_STATUS_UNAVAILABLE represents that Kubernetes cluster is not accessible.", + "type": "string", + "default": "KUBERNETES_CLUSTER_STATUS_INVALID", + "enum": [ + "KUBERNETES_CLUSTER_STATUS_INVALID", + "KUBERNETES_CLUSTER_STATUS_OK", + "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" + ] + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Kubernetes/Register": { + "post": { + "tags": [ + "Kubernetes" + ], + "summary": "RegisterKubernetesCluster registers an existing Kubernetes cluster in PMM.", + "operationId": "RegisterKubernetesCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kube_auth": { + "description": "KubeAuth represents Kubernetes / kubectl authentication and authorization information.", + "type": "object", + "properties": { + "kubeconfig": { + "description": "Kubeconfig file content.", + "type": "string", + "x-order": 0 + } + } + }, + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "aws_access_key_id": { + "description": "AWS access key id, only needed when registering EKS cluster and kubeconfig does not contain it.", + "type": "string", + "x-order": 2 + }, + "aws_secret_access_key": { + "description": "AWS secret access key, only needed when registering EKS cluster and kubeconfig does not contain it.", + "type": "string", + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Kubernetes/Resources/Get": { + "post": { + "tags": [ + "Kubernetes" + ], + "summary": "GetResources returns all and available resources of a Kubernetes cluster.\nNOTE: The user defined in kubeconfig for the cluster has to have rights to\n list and get Pods from all Namespaces. Also getting and listing Nodes\n has to be allowed.", + "operationId": "GetResources", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "all": { + "description": "Resources contains Kubernetes cluster resources.", + "type": "object", + "properties": { + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "uint64", + "x-order": 0 + }, + "cpu_m": { + "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", + "type": "string", + "format": "uint64", + "x-order": 1 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "uint64", + "x-order": 2 + } + } + }, + "available": { + "description": "Resources contains Kubernetes cluster resources.", + "type": "object", + "properties": { + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "uint64", + "x-order": 0 + }, + "cpu_m": { + "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", + "type": "string", + "format": "uint64", + "x-order": 1 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "uint64", + "x-order": 2 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/Kubernetes/Unregister": { + "post": { + "tags": [ + "Kubernetes" + ], + "summary": "UnregisterKubernetesCluster removes a registered Kubernetes cluster from PMM.", + "operationId": "UnregisterKubernetesCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "force": { + "description": "If true then Kubernetes cluster will be deleted\neven if it contains database clusters.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PSMDBCluster/Create": { + "post": { + "tags": [ + "PSMDBClusters" + ], + "summary": "CreatePSMDBCluster creates a new PSMDB cluster.", + "operationId": "CreatePSMDBCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "params": { + "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "replicaset": { + "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PSMDB.", + "type": "string", + "x-order": 2 + } + } + }, + "name": { + "type": "string", + "title": "PSMDB cluster name.\na DNS-1035 label must consist of lower case alphanumeric characters or '-',\nstart with an alphabetic character, and end with an alphanumeric character\n(e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')", + "x-order": 1 + }, + "expose": { + "description": "Make DB cluster accessible outside of K8s cluster.", + "type": "boolean", + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PSMDBCluster/Resources/Get": { + "post": { + "tags": [ + "PSMDBClusters" + ], + "summary": "GetPSMDBClusterResources returns expected resources to be consumed by the cluster.", + "operationId": "GetPSMDBClusterResources", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "params": { + "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "replicaset": { + "description": "ReplicaSet container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PSMDB.", + "type": "string", + "x-order": 2 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "expected": { + "description": "Resources contains Kubernetes cluster resources.", + "type": "object", + "properties": { + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "uint64", + "x-order": 0 + }, + "cpu_m": { + "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", + "type": "string", + "format": "uint64", + "x-order": 1 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "uint64", + "x-order": 2 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PSMDBCluster/Update": { + "post": { + "tags": [ + "PSMDBClusters" + ], + "summary": "UpdatePSMDBCluster updates existing PSMDB cluster.", + "operationId": "UpdatePSMDBCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "params": { + "description": "UpdatePSMDBClusterParams represents PSMDB cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "replicaset": { + "description": "ReplicaSet container parameters.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + } + } + }, + "suspend": { + "description": "Suspend cluster `pause: true`.", + "type": "boolean", + "x-order": 2 + }, + "resume": { + "description": "Resume cluster `pause: false`.", + "type": "boolean", + "x-order": 3 + }, + "image": { + "description": "PSMDB image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", + "type": "string", + "x-order": 4 + } + } + }, + "name": { + "description": "PSMDB cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PSMDBClusters/GetCredentials": { + "post": { + "tags": [ + "PSMDBClusters" + ], + "summary": "GetPSMDBClusterCredentials returns a PSMDB cluster credentials by cluster name.", + "operationId": "GetPSMDBClusterCredentials", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "name": { + "description": "PSMDB cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "connection_credentials": { + "description": "PSMDBCredentials is a credentials to connect to PSMDB.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "username": { + "description": "MongoDB username.", + "type": "string", + "x-order": 0 + }, + "password": { + "description": "MongoDB password.", + "type": "string", + "x-order": 1 + }, + "host": { + "description": "MongoDB host.", + "type": "string", + "x-order": 2 + }, + "port": { + "description": "MongoDB port.", + "type": "integer", + "format": "int32", + "x-order": 3 + }, + "replicaset": { + "description": "Replicaset name.", + "type": "string", + "x-order": 4 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PXCCluster/Create": { + "post": { + "tags": [ + "PXCClusters" + ], + "summary": "CreatePXCCluster creates a new PXC cluster.", + "operationId": "CreatePXCCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "params": { + "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "haproxy": { + "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for HAProxy.", + "type": "string", + "x-order": 0 + } + } + }, + "proxysql": { + "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for ProxySQL.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + }, + "pxc": { + "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PXC.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + } + } + }, + "name": { + "type": "string", + "title": "PXC cluster name.\na DNS-1035 label must consist of lower case alphanumeric characters or '-',\nstart with an alphabetic character, and end with an alphanumeric character\n(e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')", + "x-order": 1 + }, + "expose": { + "description": "Make DB cluster accessible outside of K8s cluster.", + "type": "boolean", + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PXCCluster/Resources/Get": { + "post": { + "tags": [ + "PXCClusters" + ], + "summary": "GetPXCClusterResources returns expected resources to be consumed by the cluster.", + "operationId": "GetPXCClusterResources", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "params": { + "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "haproxy": { + "description": "HAProxy container parameters.\nNOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for HAProxy.", + "type": "string", + "x-order": 0 + } + } + }, + "proxysql": { + "description": "ProxySQL container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for ProxySQL.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + }, + "pxc": { + "description": "PXC container parameters.\nTODO Do not use inner messages in all public APIs (for consistency).", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Docker image used for PXC.", + "type": "string", + "x-order": 0 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "int64", + "x-order": 2 + } + } + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "expected": { + "description": "Resources contains Kubernetes cluster resources.", + "type": "object", + "properties": { + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "uint64", + "x-order": 0 + }, + "cpu_m": { + "description": "CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus.\nSee https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.", + "type": "string", + "format": "uint64", + "x-order": 1 + }, + "disk_size": { + "description": "Disk size in bytes.", + "type": "string", + "format": "uint64", + "x-order": 2 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PXCCluster/Update": { + "post": { + "tags": [ + "PXCClusters" + ], + "summary": "UpdatePXCCluster updates existing PXC cluster.", + "operationId": "UpdatePXCCluster", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "params": { + "description": "UpdatePXCClusterParams represents PXC cluster parameters that can be updated.", + "type": "object", + "properties": { + "cluster_size": { + "description": "Cluster size.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "haproxy": { + "description": "HAProxy container parameters.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + } + } + }, + "proxysql": { + "description": "ProxySQL container parameters.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + } + } + }, + "pxc": { + "description": "PXC container parameters.", + "type": "object", + "properties": { + "compute_resources": { + "description": "ComputeResources represents container computer resources requests or limits.", + "type": "object", + "properties": { + "cpu_m": { + "description": "CPUs in milliCPUs; 1000m = 1 vCPU.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "memory_bytes": { + "description": "Memory in bytes.", + "type": "string", + "format": "int64", + "x-order": 1 + } + } + }, + "image": { + "description": "Image to use. If it's the same image but with different version tag, upgrade of database cluster to version\nin given tag is triggered. If entirely different image is given, error is returned.", + "type": "string", + "x-order": 1 + } + } + }, + "suspend": { + "description": "Suspend cluster `pause: true`.", + "type": "boolean", + "x-order": 3 + }, + "resume": { + "description": "Resume cluster `pause: false`.", + "type": "boolean", + "x-order": 4 + } + } + }, + "name": { + "description": "PXC cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/DBaaS/PXCClusters/GetCredentials": { + "post": { + "tags": [ + "PXCClusters" + ], + "summary": "GetPXCClusterCredentials returns a PXC cluster credentials by cluster name.", + "operationId": "GetPXCClusterCredentials", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "kubernetes_cluster_name": { + "description": "Kubernetes cluster name.", + "type": "string", + "x-order": 0 + }, + "name": { + "description": "PXC cluster name.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "connection_credentials": { + "description": "PXCClusterConnectionCredentials is cluster connection credentials.", + "type": "object", + "properties": { + "username": { + "description": "PXC username.", + "type": "string", + "x-order": 0 + }, + "password": { + "description": "PXC password.", + "type": "string", + "x-order": 1 + }, + "host": { + "description": "PXC host.", + "type": "string", + "x-order": 2 + }, + "port": { + "description": "PXC port.", + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/External/Add": { + "post": { + "description": "Adds external service and adds external exporter. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds an \"external exporter\" agent to inventory, which is running on provided \"runs_on_node_id\".", + "tags": [ + "External" + ], + "summary": "Add External Service", + "operationId": "AddExternal", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "runs_on_node_id": { + "description": "Node identifier on which an external exporter is been running.\nruns_on_node_id always should be passed with node_id.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + } + }, + "node_name": { + "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", + "type": "string", + "x-order": 3 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 4 + }, + "username": { + "description": "HTTP basic auth username for collecting metrics.", + "type": "string", + "x-order": 5 + }, + "password": { + "description": "HTTP basic auth password for collecting metrics.", + "type": "string", + "x-order": 6 + }, + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", + "type": "string", + "x-order": 7 + }, + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", + "type": "string", + "x-order": 8 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 9 + }, + "node_id": { + "description": "Node identifier on which an external service is been running.\nnode_id always should be passed with runs_on_node_id.", + "type": "string", + "x-order": 10 + }, + "environment": { + "description": "Environment name.", + "type": "string", + "x-order": 11 + }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 12 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 13 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 14 + }, + "group": { + "description": "Group name of external service.", + "type": "string", + "x-order": 15 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 17 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/HAProxy/Add": { + "post": { + "description": "Adds HAProxy service and external exporter. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds an \"external exporter\" agent to the inventory.", + "tags": [ + "HAProxy" + ], + "summary": "Add HAProxy", + "operationId": "AddHAProxy", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "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 + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + } + }, + "node_name": { + "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", + "type": "string", + "x-order": 3 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 4 + }, + "username": { + "description": "HTTP basic auth username for collecting metrics.", + "type": "string", + "x-order": 5 + }, + "password": { + "description": "HTTP basic auth password for collecting metrics.", + "type": "string", + "x-order": 6 + }, + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", + "type": "string", + "x-order": 7 + }, + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", + "type": "string", + "x-order": 8 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 9 + }, + "environment": { + "description": "Environment name.", + "type": "string", + "x-order": 10 + }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 11 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 12 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 13 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 15 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/MongoDB/Add": { + "post": { + "description": "Adds MongoDB Service and starts several Agents. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds \"mongodb_exporter\", and \"qan_mongodb_profiler\" agents with the provided \"pmm_agent_id\" and other parameters.", + "tags": [ + "MongoDB" + ], + "summary": "Add MongoDB", + "operationId": "AddMongoDB", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "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 + } + } + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 3 + }, + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 4 + }, + "port": { + "description": "Service Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 14 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 15 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 16 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 17 + }, + "tls_certificate_key": { + "description": "Client certificate and key.", + "type": "string", + "x-order": 18 + }, + "tls_certificate_key_file_password": { + "description": "Password for decrypting tls_certificate_key.", + "type": "string", + "x-order": 19 + }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 20 + }, + "disable_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 22 + }, + "authentication_mechanism": { + "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", + "type": "string", + "x-order": 23 + }, + "authentication_database": { + "description": "Authentication database.", + "type": "string", + "x-order": 24 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", + "type": "string", + "x-order": 25 + }, + "stats_collections": { + "description": "List of collections to get stats from. Can use * .", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 26 + }, + "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": 27 + }, + "enable_all_collectors": { + "type": "boolean", + "title": "Enable all collectors", + "x-order": 28 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/MySQL/Add": { + "post": { + "description": "Adds MySQL Service and starts several Agents. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds \"mysqld_exporter\", and \"qan_mysql_perfschema\" agents with the provided \"pmm_agent_id\" and other parameters.", + "tags": [ + "MySQL" + ], + "summary": "Add MySQL", + "operationId": "AddMySQL", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + } + }, + "node_id": { + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 3 + }, + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 4 + }, + "port": { + "description": "Service Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "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_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 17 + }, + "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": 18 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 19 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 20 + }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 21 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 22 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "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_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 26 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", + "type": "string", + "x-order": 27 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + }, + "qan_mysql_perfschema": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + }, + "qan_mysql_slowlog": { + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 11 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 12 + } + } + }, + "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 + } + } + }, + "table_count": { + "description": "Actual table count at the moment of adding.", + "type": "integer", + "format": "int32", + "x-order": 4 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Node/Register": { + "post": { + "description": "Registers a new Node and pmm-agent.", + "tags": [ + "Node" + ], + "summary": "Register 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "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 + }, + "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 + }, + "disable_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 13 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/PostgreSQL/Add": { + "post": { + "description": "Adds PostgreSQL Service and starts postgres exporter. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds \"postgres_exporter\" with provided \"pmm_agent_id\" and other parameters.", + "tags": [ + "PostgreSQL" + ], + "summary": "Add PostgreSQL", + "operationId": "AddPostgreSQL", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "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 + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + } + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 3 + }, + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 4 + }, + "port": { + "description": "Service Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "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 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 16 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 17 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 18 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 19 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", + "type": "boolean", + "x-order": 20 + }, + "disable_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 22 + }, + "tls_ca": { + "description": "TLS CA certificate.", + "type": "string", + "x-order": 23 + }, + "tls_cert": { + "description": "TLS Certifcate.", + "type": "string", + "x-order": 24 + }, + "tls_key": { + "description": "TLS Certificate Key.", + "type": "string", + "x-order": 25 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", + "type": "string", + "x-order": 26 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ProxySQL/Add": { + "post": { + "description": "Adds ProxySQL Service and starts several Agents. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds \"proxysql_exporter\" with provided \"pmm_agent_id\" and other parameters.", + "tags": [ + "ProxySQL" + ], + "summary": "Add ProxySQL", + "operationId": "AddProxySQL", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "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 + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + } + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 3 + }, + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 4 + }, + "port": { + "description": "Service Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "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 + }, + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/RDS/Add": { + "post": { + "description": "Adds RDS instance.", + "tags": [ + "RDS" + ], + "summary": "Add RDS", + "operationId": "AddRDS", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "engine": { + "description": "DiscoverRDSEngine describes supported RDS instance engines.", + "type": "string", + "default": "DISCOVER_RDS_ENGINE_INVALID", + "enum": [ + "DISCOVER_RDS_ENGINE_INVALID", + "DISCOVER_RDS_MYSQL", + "DISCOVER_RDS_POSTGRESQL" + ] + }, + "region": { + "description": "AWS region.", + "type": "string", + "x-order": 0 + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "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 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name. Defaults to AWS instance ID.", + "type": "string", + "x-order": 7 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Defaults to AWS instance ID.", + "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": "Username for scraping metrics.", + "type": "string", + "x-order": 12 + }, + "password": { + "description": "Password for scraping metrics.", + "type": "string", + "x-order": 13 + }, + "aws_access_key": { + "description": "AWS Access key.", + "type": "string", + "x-order": 14 + }, + "aws_secret_key": { + "description": "AWS Secret key.", + "type": "string", + "x-order": 15 + }, + "rds_exporter": { + "description": "If true, adds rds_exporter.", + "type": "boolean", + "x-order": 16 + }, + "qan_mysql_perfschema": { + "description": "If true, adds qan-mysql-perfschema-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 + }, + "disable_basic_metrics": { + "description": "Disable basic metrics.", + "type": "boolean", + "x-order": 24 + }, + "disable_enhanced_metrics": { + "description": "Disable enhanced metrics.", + "type": "boolean", + "x-order": 25 + }, + "qan_postgresql_pgstatements": { + "type": "boolean", + "title": "If true, add qan-pgstatements", + "x-order": 27 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", + "type": "string", + "x-order": 28 + } + } + } + } + ], + "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 + } + } + }, + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "qan_mysql_perfschema": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 + } + } + }, + "table_count": { + "description": "Actual table count at the moment of adding.", + "type": "integer", + "format": "int32", + "x-order": 5 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/RDS/Discover": { + "post": { + "description": "Discovers RDS instances.", + "tags": [ + "RDS" + ], + "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 + }, + "engine": { + "description": "DiscoverRDSEngine describes supported RDS instance engines.", + "type": "string", + "default": "DISCOVER_RDS_ENGINE_INVALID", + "enum": [ + "DISCOVER_RDS_ENGINE_INVALID", + "DISCOVER_RDS_MYSQL", + "DISCOVER_RDS_POSTGRESQL" + ] + }, + "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_version": { + "description": "Engine version.", + "type": "string", + "x-order": 7 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/Change": { + "post": { + "description": "Enables/disables Security Thread Tool checks or changes their interval by names.", + "tags": [ + "SecurityChecks" + ], + "summary": "Change Security Checks", + "operationId": "ChangeSecurityChecks", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "description": "ChangeSecurityCheckParams specifies a single check parameters.", + "type": "object", + "properties": { + "interval": { + "description": "SecurityCheckInterval represents possible execution interval values for checks.", + "type": "string", + "default": "SECURITY_CHECK_INTERVAL_INVALID", + "enum": [ + "SECURITY_CHECK_INTERVAL_INVALID", + "STANDARD", + "FREQUENT", + "RARE" + ] + }, + "name": { + "description": "The name of the check to change.", + "type": "string", + "x-order": 0 + }, + "enable": { + "type": "boolean", + "x-order": 1 + }, + "disable": { + "type": "boolean", + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/FailedChecks": { + "post": { + "description": "Returns the latest check results for a given service.", + "tags": [ + "SecurityChecks" + ], + "summary": "Get Failed Checks", + "operationId": "GetFailedChecks", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "page_params": { + "description": "PageParams represents page request parameters for pagination.", + "type": "object", + "properties": { + "page_size": { + "description": "Maximum number of results per page.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "index": { + "description": "Index of the requested page, starts from 0.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + }, + "service_id": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "page_totals": { + "description": "PageTotals represents total values for pagination.", + "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", + "items": { + "description": "CheckResult represents the check results for a given service.", + "type": "object", + "properties": { + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "summary": { + "type": "string", + "x-order": 0 + }, + "description": { + "type": "string", + "x-order": 1 + }, + "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 STT 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 + }, + "alert_id": { + "type": "string", + "title": "ID of the check result as stored in AlertManager", + "x-order": 8 + }, + "silenced": { + "type": "boolean", + "title": "Silence status of the check result", + "x-order": 9 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/GetCheckResults": { + "post": { + "description": "Returns Security Thread Tool's latest checks results.", + "tags": [ + "SecurityChecks" + ], + "summary": "Get Security Check Results", + "operationId": "GetSecurityCheckResults", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "description": "SecurityCheckResult represents the check result returned from pmm-managed after running the check.", + "type": "object", + "properties": { + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "summary": { + "type": "string", + "x-order": 0 + }, + "description": { + "type": "string", + "x-order": 1 + }, + "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 STT check.", + "type": "string", + "x-order": 4 + }, + "service_name": { + "description": "Name of the monitored service on which the check ran.", + "type": "string", + "x-order": 5 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/List": { + "post": { + "description": "Returns a list of available Security Thread Tool checks.", + "tags": [ + "SecurityChecks" + ], + "summary": "List Security Checks", + "operationId": "ListSecurityChecks", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "checks": { + "type": "array", + "items": { + "description": "SecurityCheck contains check name and status.", + "type": "object", + "properties": { + "interval": { + "description": "SecurityCheckInterval represents possible execution interval values for checks.", + "type": "string", + "default": "SECURITY_CHECK_INTERVAL_INVALID", + "enum": [ + "SECURITY_CHECK_INTERVAL_INVALID", + "STANDARD", + "FREQUENT", + "RARE" + ] + }, + "name": { + "description": "Machine-readable name (ID) that is used in expression.", + "type": "string", + "x-order": 0 + }, + "disabled": { + "description": "True if that check is disabled.", + "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 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/ListFailedServices": { + "post": { + "description": "Returns a list of services with failed checks and a summary of check results.", + "tags": [ + "SecurityChecks" + ], + "summary": "List Failed Services", + "operationId": "ListFailedServices", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/Start": { + "post": { + "description": "Executes Security Thread Tool checks and returns when all checks are executed. All available checks will be started if check names aren't specified.", + "tags": [ + "SecurityChecks" + ], + "summary": "Start Security Checks", + "operationId": "StartSecurityChecks", + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/ToggleCheckAlert": { + "post": { + "description": "Silence/Unsilence alerts for a specific check result.", + "tags": [ + "SecurityChecks" + ], + "summary": "Toggle Check Alert", + "operationId": "ToggleCheckAlert", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "alert_id": { + "description": "Alert ID of the check result.", + "type": "string", + "x-order": 0 + }, + "silence": { + "description": "Silence the check result if set to true, unsilence otherwise.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Service/Remove": { + "post": { + "description": "Removes Service with Agents.", + "tags": [ + "Service" + ], + "summary": "Remove Service", + "operationId": "RemoveServiceMixin2", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "service_type": { + "description": "ServiceType describes supported Service types.", + "type": "string", + "default": "SERVICE_TYPE_INVALID", + "enum": [ + "SERVICE_TYPE_INVALID", + "MYSQL_SERVICE", + "MONGODB_SERVICE", + "POSTGRESQL_SERVICE", + "PROXYSQL_SERVICE", + "HAPROXY_SERVICE", + "EXTERNAL_SERVICE" + ] + }, + "service_id": { + "description": "Service ID or Service Name is required.\nUnique randomly generated instance identifier.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name.", + "type": "string", + "x-order": 2 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/azure/AzureDatabase/Add": { + "post": { + "tags": [ + "AzureDatabase" + ], + "summary": "AddAzureDatabase adds Azure Database instance.", + "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_INVALID", + "enum": [ + "DISCOVER_AZURE_DATABASE_TYPE_INVALID", + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/azure/AzureDatabase/Discover": { + "post": { + "tags": [ + "AzureDatabase" + ], + "summary": "DiscoverAzureDatabase discovers Azure Database for MySQL, MariaDB and PostgreSQL Server instances.", + "operationId": "DiscoverAzureDatabase", + "parameters": [ + { + "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_INVALID", + "enum": [ + "DISCOVER_AZURE_DATABASE_TYPE_INVALID", + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Artifacts/Delete": { + "post": { + "tags": [ + "Artifacts" + ], + "summary": "DeleteArtifact deletes specified artifact.", + "operationId": "DeleteArtifact", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "artifact_id": { + "description": "Machine-readable artifact ID.", + "type": "string", + "x-order": 0 + }, + "remove_files": { + "description": "Removes all the backup files associated with artifact if flag is set.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Artifacts/List": { + "post": { + "tags": [ + "Artifacts" + ], + "summary": "ListArtifacts returns a list of all backup artifacts.", + "operationId": "ListArtifacts", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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 + }, + "data_model": { + "description": "DataModel is a model used for performing a backup.", + "type": "string", + "default": "DATA_MODEL_INVALID", + "enum": [ + "DATA_MODEL_INVALID", + "PHYSICAL", + "LOGICAL" + ] + }, + "status": { + "description": "BackupStatus shows the current status of execution of backup.", + "type": "string", + "default": "BACKUP_STATUS_INVALID", + "enum": [ + "BACKUP_STATUS_INVALID", + "BACKUP_STATUS_PENDING", + "BACKUP_STATUS_IN_PROGRESS", + "BACKUP_STATUS_PAUSED", + "BACKUP_STATUS_SUCCESS", + "BACKUP_STATUS_ERROR", + "BACKUP_STATUS_DELETING", + "BACKUP_STATUS_FAILED_TO_DELETE" + ] + }, + "mode": { + "description": "BackupMode specifies backup mode.", + "type": "string", + "default": "BACKUP_MODE_INVALID", + "enum": [ + "BACKUP_MODE_INVALID", + "SNAPSHOT", + "INCREMENTAL", + "PITR" + ] + }, + "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 + }, + "created_at": { + "description": "Artifact creation time.", + "type": "string", + "format": "date-time", + "x-order": 9 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/ChangeScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ChangeScheduledBackup changes existing 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-order": 1 + }, + "cron_expression": { + "description": "How often backup should be run in cron format.", + "type": "string", + "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-order": 4 + }, + "description": { + "description": "Human-readable description.", + "type": "string", + "x-order": 5 + }, + "retry_interval": { + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", + "type": "string", + "x-order": 6 + }, + "retries": { + "description": "How many times to retry a failed backup before giving up.", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "retention": { + "description": "How many artifacts keep. 0 - unlimited.", + "type": "integer", + "format": "int64", + "x-order": 8 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/GetLogs": { + "post": { + "tags": [ + "Backups" + ], + "summary": "GetLogs returns logs for provided artifact.", + "operationId": "GetLogsMixin5", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "artifact_id": { + "type": "string", + "x-order": 0 + }, + "offset": { + "type": "integer", + "format": "int64", + "x-order": 1 + }, + "limit": { + "type": "integer", + "format": "int64", + "x-order": 2 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/ListArtifactCompatibleServices": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ListArtifactCompatibleServices lists compatible services for restoring a backup.", + "operationId": "ListArtifactCompatibleServices", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "artifact_id": { + "description": "Artifact id used to determine restore compatibility.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "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 + } + } + }, + "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 + } + } + }, + "x-order": 1 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/ListScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ListScheduledBackups returns all scheduled backups.", + "operationId": "ListScheduledBackups", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "mode": { + "description": "BackupMode specifies backup mode.", + "type": "string", + "default": "BACKUP_MODE_INVALID", + "enum": [ + "BACKUP_MODE_INVALID", + "SNAPSHOT", + "INCREMENTAL", + "PITR" + ] + }, + "data_model": { + "description": "DataModel is a model used for performing a backup.", + "type": "string", + "default": "DATA_MODEL_INVALID", + "enum": [ + "DATA_MODEL_INVALID", + "PHYSICAL", + "LOGICAL" + ] + }, + "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 + }, + "cron_expression": { + "description": "How often backup will be run in cron format.", + "type": "string", + "x-order": 5 + }, + "start_time": { + "description": "First backup wouldn't happen before this time.", + "type": "string", + "format": "date-time", + "x-order": 6 + }, + "name": { + "description": "Artifact name.", + "type": "string", + "x-order": 7 + }, + "description": { + "description": "Description.", + "type": "string", + "x-order": 8 + }, + "retry_interval": { + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", + "type": "string", + "x-order": 9 + }, + "retries": { + "description": "How many times to retry a failed backup before giving up.", + "type": "integer", + "format": "int64", + "x-order": 10 + }, + "enabled": { + "description": "If scheduling is enabled.", + "type": "boolean", + "x-order": 11 + }, + "vendor": { + "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", + "type": "string", + "x-order": 13 + }, + "last_run": { + "description": "Last run.", + "type": "string", + "format": "date-time", + "x-order": 14 + }, + "next_run": { + "description": "Next run.", + "type": "string", + "format": "date-time", + "x-order": 15 + }, + "retention": { + "description": "How many artifacts keep. 0 - unlimited.", + "type": "integer", + "format": "int64", + "x-order": 16 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/RemoveScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "RemoveScheduledBackup removes existing scheduled backup.", + "operationId": "RemoveScheduledBackup", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "scheduled_backup_id": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/Restore": { + "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": [ + "Backups" + ], + "summary": "RestoreBackup requests the backup restore.", + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/Schedule": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ScheduleBackup schedules repeated 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 + }, + "mode": { + "description": "BackupMode specifies backup mode.", + "type": "string", + "default": "BACKUP_MODE_INVALID", + "enum": [ + "BACKUP_MODE_INVALID", + "SNAPSHOT", + "INCREMENTAL", + "PITR" + ] + }, + "location_id": { + "description": "Machine-readable location ID.", + "type": "string", + "x-order": 1 + }, + "cron_expression": { + "description": "How often backup should be run in cron format.", + "type": "string", + "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-order": 4 + }, + "description": { + "description": "Human-readable description.", + "type": "string", + "x-order": 5 + }, + "retry_interval": { + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.", + "type": "string", + "x-order": 6 + }, + "retries": { + "description": "How many times to retry a failed backup before giving up.", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "enabled": { + "description": "If scheduling is enabled.", + "type": "boolean", + "x-order": 8 + }, + "retention": { + "description": "How many artifacts keep. 0 - unlimited.", + "type": "integer", + "format": "int64", + "x-order": 9 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/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": [ + "Backups" + ], + "summary": "StartBackup request backup specified service to location.", + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Locations/Add": { + "post": { + "tags": [ + "Locations" + ], + "summary": "AddLocation adds backup location.", + "operationId": "AddLocation", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Location name", + "x-order": 0 + }, + "pmm_client_config": { + "description": "PMMClientLocationConfig represents file system config inside pmm-client.", + "type": "object", + "properties": { + "path": { + "type": "string", + "x-order": 0 + } + } + }, + "pmm_server_config": { + "description": "PMMServerLocationConfig represents file system config inside pmm-server.", + "type": "object", + "properties": { + "path": { + "type": "string", + "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 + } + } + }, + "description": { + "type": "string", + "x-order": 1 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Locations/Change": { + "post": { + "tags": [ + "Locations" + ], + "summary": "ChangeLocation changes backup location.", + "operationId": "ChangeLocation", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "location_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "pmm_client_config": { + "description": "PMMClientLocationConfig represents file system config inside pmm-client.", + "type": "object", + "properties": { + "path": { + "type": "string", + "x-order": 0 + } + } + }, + "pmm_server_config": { + "description": "PMMServerLocationConfig represents file system config inside pmm-server.", + "type": "object", + "properties": { + "path": { + "type": "string", + "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 + } + } + }, + "name": { + "type": "string", + "title": "Location name", + "x-order": 1 + }, + "description": { + "type": "string", + "x-order": 2 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Locations/List": { + "post": { + "tags": [ + "Locations" + ], + "summary": "ListLocations returns a list of all backup locations.", + "operationId": "ListLocations", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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 + }, + "pmm_client_config": { + "description": "PMMClientLocationConfig represents file system config inside pmm-client.", + "type": "object", + "properties": { + "path": { + "type": "string", + "x-order": 0 + } + } + }, + "pmm_server_config": { + "description": "PMMServerLocationConfig represents file system config inside pmm-server.", + "type": "object", + "properties": { + "path": { + "type": "string", + "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 + } + } + }, + "name": { + "type": "string", + "title": "Location name", + "x-order": 1 + }, + "description": { + "type": "string", + "title": "Short description", + "x-order": 2 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Locations/Remove": { + "post": { + "tags": [ + "Locations" + ], + "summary": "RemoveLocation removes existing backup location.", + "operationId": "RemoveLocation", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "location_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "force": { + "type": "boolean", + "title": "Force mode", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Locations/TestConfig": { + "post": { + "tags": [ + "Locations" + ], + "summary": "TestLocationConfig tests backup location and credentials.", + "operationId": "TestLocationConfig", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "pmm_client_config": { + "description": "PMMClientLocationConfig represents file system config inside pmm-client.", + "type": "object", + "properties": { + "path": { + "type": "string", + "x-order": 0 + } + } + }, + "pmm_server_config": { + "description": "PMMServerLocationConfig represents file system config inside pmm-server.", + "type": "object", + "properties": { + "path": { + "type": "string", + "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 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/RestoreHistory/List": { + "post": { + "tags": [ + "RestoreHistory" + ], + "summary": "ListRestoreHistory returns a list of all backup restore history items.", + "operationId": "ListRestoreHistory", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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 + }, + "data_model": { + "description": "DataModel is a model used for performing a backup.", + "type": "string", + "default": "DATA_MODEL_INVALID", + "enum": [ + "DATA_MODEL_INVALID", + "PHYSICAL", + "LOGICAL" + ] + }, + "status": { + "description": "RestoreStatus shows the current status of execution of restore.", + "type": "string", + "default": "RESTORE_STATUS_INVALID", + "enum": [ + "RESTORE_STATUS_INVALID", + "RESTORE_STATUS_IN_PROGRESS", + "RESTORE_STATUS_SUCCESS", + "RESTORE_STATUS_ERROR" + ] + }, + "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 + }, + "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 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Alerts/List": { + "post": { + "tags": [ + "Alerts" + ], + "summary": "ListAlerts returns a list of all Alerts.", + "operationId": "ListAlerts", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "page_params": { + "description": "PageParams represents page request parameters for pagination.", + "type": "object", + "properties": { + "page_size": { + "description": "Maximum number of results per page.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "index": { + "description": "Index of the requested page, starts from 0.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "description": "Alert represents Alert.", + "type": "object", + "properties": { + "alert_id": { + "description": "ID.", + "type": "string", + "x-order": 0 + }, + "rule": { + "description": "Rule represents Alert Rule.", + "type": "object", + "properties": { + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + }, + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "default_severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "name": { + "description": "Rule name.", + "type": "string", + "x-order": 1 + }, + "summary": { + "description": "Rule human-readable summary.", + "type": "string", + "x-order": 2 + }, + "template_name": { + "description": "Template used for this rule.", + "type": "string", + "x-order": 3 + }, + "disabled": { + "description": "True if that rule is disabled.", + "type": "boolean", + "x-order": 4 + }, + "expr_template": { + "description": "Expression template.", + "type": "string", + "x-order": 5 + }, + "expr": { + "description": "Expression filled with parameters.", + "type": "string", + "x-order": 6 + }, + "params_definitions": { + "description": "Expression parameters definitions.", + "type": "array", + "items": { + "description": "ParamDefinition represents a single query parameter.", + "type": "object", + "properties": { + "bool": { + "description": "BoolParamDefinition represents boolean parameter's default value.", + "type": "object", + "properties": { + "default": { + "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", + "type": "string", + "default": "DO_NOT_CHANGE", + "enum": [ + "DO_NOT_CHANGE", + "TRUE", + "FALSE" + ] + } + } + }, + "float": { + "description": "FloatParamDefinition represents float parameter's default value and valid range.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "number", + "format": "double", + "x-order": 1 + }, + "has_min": { + "description": "True if minimal valid value is set.", + "type": "boolean", + "x-order": 2 + }, + "min": { + "description": "Minimal valid value (inclusive) if has_min is true.", + "type": "number", + "format": "double", + "x-order": 3 + }, + "has_max": { + "description": "True if maximal valid value is set.", + "type": "boolean", + "x-order": 4 + }, + "max": { + "description": "Maximal valid value (inclusive) if has_max is true.", + "type": "number", + "format": "double", + "x-order": 5 + } + } + }, + "name": { + "description": "Machine-readable name (ID) that is used in expression.", + "type": "string", + "x-order": 0 + }, + "string": { + "description": "StringParamDefinition represents string parameter's default value.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "string", + "x-order": 1 + } + } + }, + "type": { + "description": "ParamType represents template parameter type.", + "type": "string", + "default": "PARAM_TYPE_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "unit": { + "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", + "type": "string", + "default": "PARAM_UNIT_INVALID", + "enum": [ + "PARAM_UNIT_INVALID", + "PERCENTAGE", + "SECONDS" + ] + }, + "summary": { + "description": "Short human-readable parameter summary.", + "type": "string", + "x-order": 1 + } + } + }, + "x-order": 7 + }, + "params_values": { + "description": "Expression parameters values.", + "type": "array", + "items": { + "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", + "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_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "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": 8 + }, + "default_for": { + "description": "Default for duration.", + "type": "string", + "x-order": 9 + }, + "for": { + "description": "For duration.", + "type": "string", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 13 + }, + "labels": { + "description": "Labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 14 + }, + "annotations": { + "description": "Annotations.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 15 + }, + "filters": { + "description": "Filters.", + "type": "array", + "items": { + "description": "Filter repsents a single filter condition.", + "type": "object", + "properties": { + "type": { + "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", + "type": "string", + "default": "FILTER_TYPE_INVALID", + "enum": [ + "FILTER_TYPE_INVALID", + "EQUAL", + "REGEX" + ] + }, + "key": { + "type": "string", + "x-order": 1 + }, + "value": { + "type": "string", + "x-order": 2 + } + } + }, + "x-order": 16 + }, + "channels": { + "description": "Channels.", + "type": "array", + "items": { + "description": "Channel represents a single Notification Channel.", + "type": "object", + "properties": { + "channel_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "email_config": { + "description": "EmailConfig represents email configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "to": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "pagerduty_config": { + "description": "PagerDutyConfig represents PagerDuty configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "routing_key": { + "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 1 + }, + "service_key": { + "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 2 + } + } + }, + "slack_config": { + "description": "SlackConfig represents Slack configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "channel": { + "type": "string", + "x-order": 1 + } + } + }, + "webhook_config": { + "description": "WebhookConfig represents webhook configuration.", + "type": "object", + "properties": { + "http_config": { + "description": "HTTPConfig represents HTTP client configuration.", + "type": "object", + "properties": { + "basic_auth": { + "description": "BasicAuth represents basic HTTP auth configuration.", + "type": "object", + "properties": { + "username": { + "type": "string", + "x-order": 0 + }, + "password": { + "type": "string", + "x-order": 1 + }, + "password_file": { + "type": "string", + "x-order": 2 + } + } + }, + "tls_config": { + "type": "object", + "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", + "properties": { + "ca_file": { + "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 0 + }, + "cert_file": { + "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 1 + }, + "key_file": { + "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 2 + }, + "server_name": { + "description": "Name of the server.", + "type": "string", + "x-order": 3 + }, + "insecure_skip_verify": { + "description": "Disable validation of the server certificate.", + "type": "boolean", + "x-order": 4 + }, + "ca_file_content": { + "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 5 + }, + "cert_file_content": { + "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 6 + }, + "key_file_content": { + "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 7 + } + } + }, + "bearer_token": { + "type": "string", + "x-order": 1 + }, + "bearer_token_file": { + "type": "string", + "x-order": 2 + }, + "proxy_url": { + "type": "string", + "x-order": 4 + } + } + }, + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "url": { + "type": "string", + "x-order": 1 + }, + "max_alerts": { + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + }, + "summary": { + "description": "Short human-readable summary.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "True if that channel is disabled.", + "type": "boolean", + "x-order": 6 + } + } + }, + "x-order": 17 + }, + "created_at": { + "description": "Rule creation time.", + "type": "string", + "format": "date-time", + "x-order": 18 + } + } + }, + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "status": { + "description": "Status represents Alert Rule's and Alert's combined status.\n\n - CLEAR: No alert.\n - PENDING: Pending, but not triggering alert.\n - TRIGGERING: Triggering (firing) alert.\n - SILENCED: Silenced alert.", + "type": "string", + "default": "STATUS_INVALID", + "enum": [ + "STATUS_INVALID", + "CLEAR", + "PENDING", + "TRIGGERING", + "SILENCED" + ] + }, + "summary": { + "description": "Human-readable summary.", + "type": "string", + "x-order": 1 + }, + "labels": { + "description": "Combined labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 4 + }, + "created_at": { + "description": "Alert creation time.", + "type": "string", + "format": "date-time", + "x-order": 6 + }, + "updated_at": { + "description": "Alert last update time.", + "type": "string", + "format": "date-time", + "x-order": 7 + } + } + }, + "x-order": 0 + }, + "totals": { + "description": "PageTotals represents total values for pagination.", + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Alerts/Toggle": { + "post": { + "description": "Pass empty list to apply toggle action to all existing alerts", + "tags": [ + "Alerts" + ], + "summary": "ToggleAlerts allows to switch alerts state between silenced and unsilenced.", + "operationId": "ToggleAlerts", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "alert_ids": { + "description": "List of alerts that silence state should be switched. If provided array is empty than all\nexisting alerts are switched.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 0 + }, + "silenced": { + "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", + "type": "string", + "default": "DO_NOT_CHANGE", + "enum": [ + "DO_NOT_CHANGE", + "TRUE", + "FALSE" + ] + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Channels/Add": { + "post": { + "tags": [ + "Channels" + ], + "summary": "AddChannel adds notification channel.", + "operationId": "AddChannel", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "email_config": { + "description": "EmailConfig represents email configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "to": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "pagerduty_config": { + "description": "PagerDutyConfig represents PagerDuty configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "routing_key": { + "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 1 + }, + "service_key": { + "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 2 + } + } + }, + "slack_config": { + "description": "SlackConfig represents Slack configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "channel": { + "type": "string", + "x-order": 1 + } + } + }, + "summary": { + "description": "Short human-readable summary.", + "type": "string", + "x-order": 0 + }, + "webhook_config": { + "description": "WebhookConfig represents webhook configuration.", + "type": "object", + "properties": { + "http_config": { + "description": "HTTPConfig represents HTTP client configuration.", + "type": "object", + "properties": { + "basic_auth": { + "description": "BasicAuth represents basic HTTP auth configuration.", + "type": "object", + "properties": { + "username": { + "type": "string", + "x-order": 0 + }, + "password": { + "type": "string", + "x-order": 1 + }, + "password_file": { + "type": "string", + "x-order": 2 + } + } + }, + "tls_config": { + "type": "object", + "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", + "properties": { + "ca_file": { + "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 0 + }, + "cert_file": { + "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 1 + }, + "key_file": { + "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 2 + }, + "server_name": { + "description": "Name of the server.", + "type": "string", + "x-order": 3 + }, + "insecure_skip_verify": { + "description": "Disable validation of the server certificate.", + "type": "boolean", + "x-order": 4 + }, + "ca_file_content": { + "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 5 + }, + "cert_file_content": { + "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 6 + }, + "key_file_content": { + "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 7 + } + } + }, + "bearer_token": { + "type": "string", + "x-order": 1 + }, + "bearer_token_file": { + "type": "string", + "x-order": 2 + }, + "proxy_url": { + "type": "string", + "x-order": 4 + } + } + }, + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "url": { + "type": "string", + "x-order": 1 + }, + "max_alerts": { + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + }, + "disabled": { + "description": "New channel status.", + "type": "boolean", + "x-order": 5 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "channel_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Channels/Change": { + "post": { + "tags": [ + "Channels" + ], + "summary": "ChangeChannel changes notification channel.", + "operationId": "ChangeChannel", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "channel_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "email_config": { + "description": "EmailConfig represents email configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "to": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "pagerduty_config": { + "description": "PagerDutyConfig represents PagerDuty configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "routing_key": { + "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 1 + }, + "service_key": { + "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 2 + } + } + }, + "slack_config": { + "description": "SlackConfig represents Slack configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "channel": { + "type": "string", + "x-order": 1 + } + } + }, + "webhook_config": { + "description": "WebhookConfig represents webhook configuration.", + "type": "object", + "properties": { + "http_config": { + "description": "HTTPConfig represents HTTP client configuration.", + "type": "object", + "properties": { + "basic_auth": { + "description": "BasicAuth represents basic HTTP auth configuration.", + "type": "object", + "properties": { + "username": { + "type": "string", + "x-order": 0 + }, + "password": { + "type": "string", + "x-order": 1 + }, + "password_file": { + "type": "string", + "x-order": 2 + } + } + }, + "tls_config": { + "type": "object", + "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", + "properties": { + "ca_file": { + "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 0 + }, + "cert_file": { + "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 1 + }, + "key_file": { + "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 2 + }, + "server_name": { + "description": "Name of the server.", + "type": "string", + "x-order": 3 + }, + "insecure_skip_verify": { + "description": "Disable validation of the server certificate.", + "type": "boolean", + "x-order": 4 + }, + "ca_file_content": { + "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 5 + }, + "cert_file_content": { + "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 6 + }, + "key_file_content": { + "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 7 + } + } + }, + "bearer_token": { + "type": "string", + "x-order": 1 + }, + "bearer_token_file": { + "type": "string", + "x-order": 2 + }, + "proxy_url": { + "type": "string", + "x-order": 4 + } + } + }, + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "url": { + "type": "string", + "x-order": 1 + }, + "max_alerts": { + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + }, + "summary": { + "description": "Short human-readable summary. Empty value will not change it.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Enables or disables that channel. Should be set.", + "type": "boolean", + "x-order": 6 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Channels/List": { + "post": { + "tags": [ + "Channels" + ], + "summary": "ListChannels returns a list of all notifation channels.", + "operationId": "ListChannels", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "page_params": { + "description": "PageParams represents page request parameters for pagination.", + "type": "object", + "properties": { + "page_size": { + "description": "Maximum number of results per page.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "index": { + "description": "Index of the requested page, starts from 0.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "channels": { + "type": "array", + "items": { + "description": "Channel represents a single Notification Channel.", + "type": "object", + "properties": { + "channel_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "email_config": { + "description": "EmailConfig represents email configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "to": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "pagerduty_config": { + "description": "PagerDutyConfig represents PagerDuty configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "routing_key": { + "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 1 + }, + "service_key": { + "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 2 + } + } + }, + "slack_config": { + "description": "SlackConfig represents Slack configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "channel": { + "type": "string", + "x-order": 1 + } + } + }, + "webhook_config": { + "description": "WebhookConfig represents webhook configuration.", + "type": "object", + "properties": { + "http_config": { + "description": "HTTPConfig represents HTTP client configuration.", + "type": "object", + "properties": { + "basic_auth": { + "description": "BasicAuth represents basic HTTP auth configuration.", + "type": "object", + "properties": { + "username": { + "type": "string", + "x-order": 0 + }, + "password": { + "type": "string", + "x-order": 1 + }, + "password_file": { + "type": "string", + "x-order": 2 + } + } + }, + "tls_config": { + "type": "object", + "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", + "properties": { + "ca_file": { + "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 0 + }, + "cert_file": { + "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 1 + }, + "key_file": { + "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 2 + }, + "server_name": { + "description": "Name of the server.", + "type": "string", + "x-order": 3 + }, + "insecure_skip_verify": { + "description": "Disable validation of the server certificate.", + "type": "boolean", + "x-order": 4 + }, + "ca_file_content": { + "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 5 + }, + "cert_file_content": { + "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 6 + }, + "key_file_content": { + "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 7 + } + } + }, + "bearer_token": { + "type": "string", + "x-order": 1 + }, + "bearer_token_file": { + "type": "string", + "x-order": 2 + }, + "proxy_url": { + "type": "string", + "x-order": 4 + } + } + }, + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "url": { + "type": "string", + "x-order": 1 + }, + "max_alerts": { + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + }, + "summary": { + "description": "Short human-readable summary.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "True if that channel is disabled.", + "type": "boolean", + "x-order": 6 + } + } + }, + "x-order": 0 + }, + "totals": { + "description": "PageTotals represents total values for pagination.", + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Channels/Remove": { + "post": { + "tags": [ + "Channels" + ], + "summary": "RemoveChannel removes notification channel.", + "operationId": "RemoveChannel", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "channel_id": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Rules/Create": { + "post": { + "tags": [ + "Rules" + ], + "summary": "CreateAlertRule creates Alerting rule.", + "operationId": "CreateAlertRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "template_name": { + "description": "Template name. Can't be specified simultaneously with source_rule_id.", + "type": "string", + "x-order": 0 + }, + "source_rule_id": { + "description": "ID of the rule that will be used as source. Can't be specified simultaneously with template_name.", + "type": "string", + "x-order": 1 + }, + "name": { + "description": "Rule name.", + "type": "string", + "x-order": 2 + }, + "disabled": { + "description": "New rule status.", + "type": "boolean", + "x-order": 3 + }, + "params": { + "description": "Rule parameters. All template parameters should be set.", + "type": "array", + "items": { + "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", + "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_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "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 + }, + "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. Should be set.", + "type": "array", + "items": { + "description": "Filter repsents a single filter condition.", + "type": "object", + "properties": { + "type": { + "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", + "type": "string", + "default": "FILTER_TYPE_INVALID", + "enum": [ + "FILTER_TYPE_INVALID", + "EQUAL", + "REGEX" + ] + }, + "key": { + "type": "string", + "x-order": 1 + }, + "value": { + "type": "string", + "x-order": 2 + } + } + }, + "x-order": 8 + }, + "channel_ids": { + "description": "Channels. Should be set.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 9 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Rules/Delete": { + "post": { + "tags": [ + "Rules" + ], + "summary": "DeleteAlertRule deletes Alerting rule.", + "operationId": "DeleteAlertRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Rules/List": { + "post": { + "tags": [ + "Rules" + ], + "summary": "ListAlertRules returns a list of all Alerting rules.", + "operationId": "ListAlertRules", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "page_params": { + "description": "PageParams represents page request parameters for pagination.", + "type": "object", + "properties": { + "page_size": { + "description": "Maximum number of results per page.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "index": { + "description": "Index of the requested page, starts from 0.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "rules": { + "type": "array", + "items": { + "description": "Rule represents Alert Rule.", + "type": "object", + "properties": { + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + }, + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "default_severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "name": { + "description": "Rule name.", + "type": "string", + "x-order": 1 + }, + "summary": { + "description": "Rule human-readable summary.", + "type": "string", + "x-order": 2 + }, + "template_name": { + "description": "Template used for this rule.", + "type": "string", + "x-order": 3 + }, + "disabled": { + "description": "True if that rule is disabled.", + "type": "boolean", + "x-order": 4 + }, + "expr_template": { + "description": "Expression template.", + "type": "string", + "x-order": 5 + }, + "expr": { + "description": "Expression filled with parameters.", + "type": "string", + "x-order": 6 + }, + "params_definitions": { + "description": "Expression parameters definitions.", + "type": "array", + "items": { + "description": "ParamDefinition represents a single query parameter.", + "type": "object", + "properties": { + "bool": { + "description": "BoolParamDefinition represents boolean parameter's default value.", + "type": "object", + "properties": { + "default": { + "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", + "type": "string", + "default": "DO_NOT_CHANGE", + "enum": [ + "DO_NOT_CHANGE", + "TRUE", + "FALSE" + ] + } + } + }, + "float": { + "description": "FloatParamDefinition represents float parameter's default value and valid range.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "number", + "format": "double", + "x-order": 1 + }, + "has_min": { + "description": "True if minimal valid value is set.", + "type": "boolean", + "x-order": 2 + }, + "min": { + "description": "Minimal valid value (inclusive) if has_min is true.", + "type": "number", + "format": "double", + "x-order": 3 + }, + "has_max": { + "description": "True if maximal valid value is set.", + "type": "boolean", + "x-order": 4 + }, + "max": { + "description": "Maximal valid value (inclusive) if has_max is true.", + "type": "number", + "format": "double", + "x-order": 5 + } + } + }, + "name": { + "description": "Machine-readable name (ID) that is used in expression.", + "type": "string", + "x-order": 0 + }, + "string": { + "description": "StringParamDefinition represents string parameter's default value.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "string", + "x-order": 1 + } + } + }, + "type": { + "description": "ParamType represents template parameter type.", + "type": "string", + "default": "PARAM_TYPE_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "unit": { + "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", + "type": "string", + "default": "PARAM_UNIT_INVALID", + "enum": [ + "PARAM_UNIT_INVALID", + "PERCENTAGE", + "SECONDS" + ] + }, + "summary": { + "description": "Short human-readable parameter summary.", + "type": "string", + "x-order": 1 + } + } + }, + "x-order": 7 + }, + "params_values": { + "description": "Expression parameters values.", + "type": "array", + "items": { + "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", + "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_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "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": 8 + }, + "default_for": { + "description": "Default for duration.", + "type": "string", + "x-order": 9 + }, + "for": { + "description": "For duration.", + "type": "string", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 13 + }, + "labels": { + "description": "Labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 14 + }, + "annotations": { + "description": "Annotations.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 15 + }, + "filters": { + "description": "Filters.", + "type": "array", + "items": { + "description": "Filter repsents a single filter condition.", + "type": "object", + "properties": { + "type": { + "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", + "type": "string", + "default": "FILTER_TYPE_INVALID", + "enum": [ + "FILTER_TYPE_INVALID", + "EQUAL", + "REGEX" + ] + }, + "key": { + "type": "string", + "x-order": 1 + }, + "value": { + "type": "string", + "x-order": 2 + } + } + }, + "x-order": 16 + }, + "channels": { + "description": "Channels.", + "type": "array", + "items": { + "description": "Channel represents a single Notification Channel.", + "type": "object", + "properties": { + "channel_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "email_config": { + "description": "EmailConfig represents email configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "to": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 1 + } + } + }, + "pagerduty_config": { + "description": "PagerDutyConfig represents PagerDuty configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "routing_key": { + "description": "The PagerDuty key for \"Events API v2\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 1 + }, + "service_key": { + "description": "The PagerDuty key for \"Prometheus\" integration type. Exactly one key should be set.", + "type": "string", + "x-order": 2 + } + } + }, + "slack_config": { + "description": "SlackConfig represents Slack configuration.", + "type": "object", + "properties": { + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "channel": { + "type": "string", + "x-order": 1 + } + } + }, + "webhook_config": { + "description": "WebhookConfig represents webhook configuration.", + "type": "object", + "properties": { + "http_config": { + "description": "HTTPConfig represents HTTP client configuration.", + "type": "object", + "properties": { + "basic_auth": { + "description": "BasicAuth represents basic HTTP auth configuration.", + "type": "object", + "properties": { + "username": { + "type": "string", + "x-order": 0 + }, + "password": { + "type": "string", + "x-order": 1 + }, + "password_file": { + "type": "string", + "x-order": 2 + } + } + }, + "tls_config": { + "type": "object", + "title": "TLSConfig represents TLS configuration for alertmanager\nhttps://prometheus.io/docs/alerting/latest/configuration/#tls_config", + "properties": { + "ca_file": { + "description": "A path to the CA certificate file to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 0 + }, + "cert_file": { + "description": "A path to the certificate file for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 1 + }, + "key_file": { + "description": "A path to the key file for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 2 + }, + "server_name": { + "description": "Name of the server.", + "type": "string", + "x-order": 3 + }, + "insecure_skip_verify": { + "description": "Disable validation of the server certificate.", + "type": "boolean", + "x-order": 4 + }, + "ca_file_content": { + "description": "CA certificate to validate the server certificate with.\nca_file and ca_file_content should not be set at the same time.", + "type": "string", + "x-order": 5 + }, + "cert_file_content": { + "description": "A certificate for client cert authentication to the server.\ncert_file and cert_file_content should not be set at the same time.", + "type": "string", + "x-order": 6 + }, + "key_file_content": { + "description": "A key for client cert authentication to the server.\nkey_file and key_file_content should not be set at the same time.", + "type": "string", + "x-order": 7 + } + } + }, + "bearer_token": { + "type": "string", + "x-order": 1 + }, + "bearer_token_file": { + "type": "string", + "x-order": 2 + }, + "proxy_url": { + "type": "string", + "x-order": 4 + } + } + }, + "send_resolved": { + "type": "boolean", + "x-order": 0 + }, + "url": { + "type": "string", + "x-order": 1 + }, + "max_alerts": { + "type": "integer", + "format": "int32", + "x-order": 3 + } + } + }, + "summary": { + "description": "Short human-readable summary.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "True if that channel is disabled.", + "type": "boolean", + "x-order": 6 + } + } + }, + "x-order": 17 + }, + "created_at": { + "description": "Rule creation time.", + "type": "string", + "format": "date-time", + "x-order": 18 + } + } + }, + "x-order": 0 + }, + "totals": { + "description": "PageTotals represents total values for pagination.", + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Rules/Toggle": { + "post": { + "tags": [ + "Rules" + ], + "summary": "ToggleAlertRule allows to switch between disabled and enabled states of an Alert Rule.", + "operationId": "ToggleAlertRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "disabled": { + "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", + "type": "string", + "default": "DO_NOT_CHANGE", + "enum": [ + "DO_NOT_CHANGE", + "TRUE", + "FALSE" + ] + }, + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Rules/Update": { + "post": { + "tags": [ + "Rules" + ], + "summary": "UpdateAlertRule updates Alerting rule.", + "operationId": "UpdateAlertRule", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "rule_id": { + "description": "Rule ID.", + "type": "string", + "x-order": 0 + }, + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "name": { + "description": "Rule name. Should be set.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "New rule status. Should be set.", + "type": "boolean", + "x-order": 2 + }, + "params": { + "description": "Rule parameters. All template parameters should be set.", + "type": "array", + "items": { + "description": "ParamValue represents a single rule parameter value for List, Change and Update APIs.", + "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_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "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": 3 + }, + "for": { + "description": "Rule duration. Should be set.", + "type": "string", + "x-order": 4 + }, + "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": 6 + }, + "filters": { + "description": "Filters. Should be set.", + "type": "array", + "items": { + "description": "Filter repsents a single filter condition.", + "type": "object", + "properties": { + "type": { + "description": "FilterType represents filter matching type.\n\n - EQUAL: =\n - REGEX: =~", + "type": "string", + "default": "FILTER_TYPE_INVALID", + "enum": [ + "FILTER_TYPE_INVALID", + "EQUAL", + "REGEX" + ] + }, + "key": { + "type": "string", + "x-order": 1 + }, + "value": { + "type": "string", + "x-order": 2 + } + } + }, + "x-order": 7 + }, + "channel_ids": { + "description": "Channels. Should be set.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 8 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Templates/Create": { + "post": { + "tags": [ + "Templates" + ], + "summary": "CreateTemplate creates a new template.", + "operationId": "CreateTemplate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "yaml": { + "description": "YAML (or JSON) 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Templates/Delete": { + "post": { + "tags": [ + "Templates" + ], + "summary": "DeleteTemplate deletes existing, previously created via API.", + "operationId": "DeleteTemplate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Templates/List": { + "post": { + "tags": [ + "Templates" + ], + "summary": "ListTemplates returns a list of all collected Alert Rule Templates.", + "operationId": "ListTemplates", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "page_params": { + "description": "PageParams represents page request parameters for pagination.", + "type": "object", + "properties": { + "page_size": { + "description": "Maximum number of results per page.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "index": { + "description": "Index of the requested page, starts from 0.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + }, + "reload": { + "description": "If true, template files will be re-read from disk.", + "type": "boolean", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "templates": { + "type": "array", + "items": { + "description": "Template represents Alert Template that is used to create Alert Rule.", + "type": "object", + "properties": { + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "source": { + "description": "TemplateSource defines template source.\n\n - BUILT_IN: Template that is shipped with PMM Server releases.\n - SAAS: Template that is downloaded from check.percona.com.\n - USER_FILE: Templated loaded from user-suplied file.\n - USER_API: Templated created via API.", + "type": "string", + "default": "TEMPLATE_SOURCE_INVALID", + "enum": [ + "TEMPLATE_SOURCE_INVALID", + "BUILT_IN", + "SAAS", + "USER_FILE", + "USER_API" + ] + }, + "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": { + "bool": { + "description": "BoolParamDefinition represents boolean parameter's default value.", + "type": "object", + "properties": { + "default": { + "description": "BooleanFlag represent a command to set some boolean property to true,\nto false, or avoid changing that property.\n\n - DO_NOT_CHANGE: Do not change boolean property. Default value.\n - TRUE: True.\n - FALSE: False.", + "type": "string", + "default": "DO_NOT_CHANGE", + "enum": [ + "DO_NOT_CHANGE", + "TRUE", + "FALSE" + ] + } + } + }, + "float": { + "description": "FloatParamDefinition represents float parameter's default value and valid range.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "number", + "format": "double", + "x-order": 1 + }, + "has_min": { + "description": "True if minimal valid value is set.", + "type": "boolean", + "x-order": 2 + }, + "min": { + "description": "Minimal valid value (inclusive) if has_min is true.", + "type": "number", + "format": "double", + "x-order": 3 + }, + "has_max": { + "description": "True if maximal valid value is set.", + "type": "boolean", + "x-order": 4 + }, + "max": { + "description": "Maximal valid value (inclusive) if has_max is true.", + "type": "number", + "format": "double", + "x-order": 5 + } + } + }, + "name": { + "description": "Machine-readable name (ID) that is used in expression.", + "type": "string", + "x-order": 0 + }, + "string": { + "description": "StringParamDefinition represents string parameter's default value.", + "type": "object", + "properties": { + "has_default": { + "description": "True if default value is set.", + "type": "boolean", + "x-order": 0 + }, + "default": { + "description": "Default value if has_default is true.", + "type": "string", + "x-order": 1 + } + } + }, + "type": { + "description": "ParamType represents template parameter type.", + "type": "string", + "default": "PARAM_TYPE_INVALID", + "enum": [ + "PARAM_TYPE_INVALID", + "BOOL", + "FLOAT", + "STRING" + ] + }, + "unit": { + "description": "ParamUnit represents template parameter unit.\n\n - PARAM_UNIT_INVALID: Invalid, unknown or absent.\n - PERCENTAGE: %\n - SECONDS: s", + "type": "string", + "default": "PARAM_UNIT_INVALID", + "enum": [ + "PARAM_UNIT_INVALID", + "PERCENTAGE", + "SECONDS" + ] + }, + "summary": { + "description": "Short human-readable parameter summary.", + "type": "string", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "for": { + "description": "Default duration value.", + "type": "string", + "x-order": 4 + }, + "labels": { + "description": "Labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + }, + "annotations": { + "description": "Annotations.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + }, + "created_at": { + "description": "Template creation time. Empty for built-in and SaaS templates.", + "type": "string", + "format": "date-time", + "x-order": 9 + }, + "yaml": { + "description": "YAML (or JSON) template file content. Empty for built-in and SaaS templates.", + "type": "string", + "x-order": 10 + } + } + }, + "x-order": 0 + }, + "totals": { + "description": "PageTotals represents total values for pagination.", + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ia/Templates/Update": { + "post": { + "tags": [ + "Templates" + ], + "summary": "UpdateTemplate updates existing template, previously created via API.", + "operationId": "UpdateTemplate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Machine-readable name (ID).", + "type": "string", + "x-order": 0 + }, + "yaml": { + "description": "YAML (or JSON) template file content.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/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": [ + "Server" + ], + "summary": "Check server readiness", + "operationId": "Readiness", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/version": { + "get": { + "description": "Returns PMM Server versions.", + "tags": [ + "Server" + ], + "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": { + "distribution_method": { + "description": "DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI.", + "type": "string", + "default": "DISTRIBUTION_METHOD_INVALID", + "enum": [ + "DISTRIBUTION_METHOD_INVALID", + "DOCKER", + "OVF", + "AMI", + "AZURE", + "DO" + ] + }, + "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 + } + } + }, + "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 + } + } + }, + "version": { + "description": "PMM Server version.", + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + } + }, + "securityDefinitions": { + "basicAuth": { + "type": "basic" + } + }, + "security": [ + { + "basicAuth": [] + } + ], + "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 new file mode 100644 index 0000000000..90fbe5a475 --- /dev/null +++ b/api/swagger/swagger.json @@ -0,0 +1,19283 @@ +{ + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "https", + "http" + ], + "swagger": "2.0", + "info": { + "title": "PMM API", + "version": "public" + }, + "paths": { + "/logs.zip": { + "get": { + "description": "Returns the PMM Server logs.", + "produces": [ + "application/zip" + ], + "tags": [ + "Server" + ], + "summary": "Logs", + "operationId": "Logs", + "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/AWSInstanceCheck": { + "post": { + "description": "Checks AWS EC2 instance ID.", + "tags": [ + "Server" + ], + "summary": "AWS instance check", + "operationId": "AWSInstanceCheck", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "instance_id": { + "description": "AWS EC2 instance ID (i-1234567890abcdef0).", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Settings/Change": { + "post": { + "description": "Changes PMM Server settings.", + "tags": [ + "Server" + ], + "summary": "Change settings", + "operationId": "ChangeSettings", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "stt_check_intervals": { + "description": "STTCheckIntervals represents intervals between STT 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 + } + } + }, + "email_alerting_settings": { + "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", + "type": "object", + "properties": { + "from": { + "description": "SMTP From header field.", + "type": "string", + "x-order": 0 + }, + "smarthost": { + "description": "SMTP host and port.", + "type": "string", + "x-order": 1 + }, + "hello": { + "description": "Hostname to identify to the SMTP server.", + "type": "string", + "x-order": 2 + }, + "username": { + "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", + "type": "string", + "x-order": 3 + }, + "password": { + "description": "Auth using LOGIN and PLAIN.", + "type": "string", + "x-order": 4 + }, + "identity": { + "description": "Auth using PLAIN.", + "type": "string", + "x-order": 5 + }, + "secret": { + "description": "Auth using CRAM-MD5.", + "type": "string", + "x-order": 6 + }, + "require_tls": { + "description": "Require TLS.", + "type": "boolean", + "x-order": 7 + } + } + }, + "enable_updates": { + "type": "boolean", + "x-order": 0 + }, + "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 + } + } + }, + "slack_alerting_settings": { + "description": "SlackAlertingSettings represents Slack configuration for Alerting.", + "type": "object", + "properties": { + "url": { + "description": "Slack API (webhook) URL.", + "type": "string", + "x-order": 0 + } + } + }, + "disable_updates": { + "type": "boolean", + "x-order": 1 + }, + "enable_telemetry": { + "type": "boolean", + "x-order": 2 + }, + "disable_telemetry": { + "type": "boolean", + "x-order": 3 + }, + "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": 5 + }, + "ssh_key": { + "type": "string", + "x-order": 6 + }, + "aws_partitions": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 7 + }, + "alert_manager_url": { + "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", + "type": "string", + "x-order": 8 + }, + "remove_alert_manager_url": { + "description": "Remove external AlertManager URL.", + "type": "boolean", + "x-order": 9 + }, + "alert_manager_rules": { + "description": "Custom alerting or recording rules.", + "type": "string", + "x-order": 10 + }, + "remove_alert_manager_rules": { + "description": "Remove custom alerting or recording rules.", + "type": "boolean", + "x-order": 11 + }, + "enable_stt": { + "description": "Enable Security Threat Tool.", + "type": "boolean", + "x-order": 12 + }, + "disable_stt": { + "description": "Disable Security Threat Tool.", + "type": "boolean", + "x-order": 13 + }, + "enable_alerting": { + "description": "Enable Alerting.", + "type": "boolean", + "x-order": 14 + }, + "disable_alerting": { + "description": "Disable Alerting.", + "type": "boolean", + "x-order": 15 + }, + "remove_email_alerting_settings": { + "description": "If true, removes Alerting email (SMTP) settings.", + "type": "boolean", + "x-order": 17 + }, + "remove_slack_alerting_settings": { + "description": "If true, removes Alerting Slack settings.", + "type": "boolean", + "x-order": 19 + }, + "pmm_public_address": { + "description": "PMM Server public address.", + "type": "string", + "x-order": 20 + }, + "remove_pmm_public_address": { + "type": "boolean", + "x-order": 21 + }, + "enable_azurediscover": { + "description": "Enable Azure Discover.", + "type": "boolean", + "x-order": 23 + }, + "disable_azurediscover": { + "description": "Disable Azure Discover.", + "type": "boolean", + "x-order": 24 + }, + "enable_backup_management": { + "description": "Enable Backup Management.", + "type": "boolean", + "x-order": 25 + }, + "disable_backup_management": { + "description": "Disable Backup Management.", + "type": "boolean", + "x-order": 26 + }, + "enable_dbaas": { + "description": "Enable DBaaS.", + "type": "boolean", + "x-order": 27 + }, + "disable_dbaas": { + "description": "Disable DBaaS.", + "type": "boolean", + "x-order": 28 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "settings": { + "description": "Settings represents PMM Server settings.", + "type": "object", + "properties": { + "email_alerting_settings": { + "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", + "type": "object", + "properties": { + "from": { + "description": "SMTP From header field.", + "type": "string", + "x-order": 0 + }, + "smarthost": { + "description": "SMTP host and port.", + "type": "string", + "x-order": 1 + }, + "hello": { + "description": "Hostname to identify to the SMTP server.", + "type": "string", + "x-order": 2 + }, + "username": { + "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", + "type": "string", + "x-order": 3 + }, + "password": { + "description": "Auth using LOGIN and PLAIN.", + "type": "string", + "x-order": 4 + }, + "identity": { + "description": "Auth using PLAIN.", + "type": "string", + "x-order": 5 + }, + "secret": { + "description": "Auth using CRAM-MD5.", + "type": "string", + "x-order": 6 + }, + "require_tls": { + "description": "Require TLS.", + "type": "boolean", + "x-order": 7 + } + } + }, + "stt_check_intervals": { + "description": "STTCheckIntervals represents intervals between STT 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 + } + } + }, + "slack_alerting_settings": { + "description": "SlackAlertingSettings represents Slack configuration for Alerting.", + "type": "object", + "properties": { + "url": { + "description": "Slack API (webhook) URL.", + "type": "string", + "x-order": 0 + } + } + }, + "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 + } + } + }, + "updates_disabled": { + "description": "True if updates are disabled.", + "type": "boolean", + "x-order": 0 + }, + "telemetry_enabled": { + "description": "True if telemetry is enabled.", + "type": "boolean", + "x-order": 1 + }, + "data_retention": { + "type": "string", + "x-order": 3 + }, + "ssh_key": { + "type": "string", + "x-order": 4 + }, + "aws_partitions": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 5 + }, + "alert_manager_url": { + "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", + "type": "string", + "x-order": 6 + }, + "alert_manager_rules": { + "description": "Custom alerting or recording rules.", + "type": "string", + "x-order": 7 + }, + "stt_enabled": { + "description": "True if Security Threat Tool is enabled.", + "type": "boolean", + "x-order": 8 + }, + "platform_email": { + "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", + "type": "string", + "x-order": 9 + }, + "dbaas_enabled": { + "description": "True if DBaaS is enabled.", + "type": "boolean", + "x-order": 10 + }, + "alerting_enabled": { + "description": "True if Alerting is enabled.", + "type": "boolean", + "x-order": 11 + }, + "pmm_public_address": { + "description": "PMM Server public address.", + "type": "string", + "x-order": 14 + }, + "backup_management_enabled": { + "description": "True if Backup Management is enabled.", + "type": "boolean", + "x-order": 16 + }, + "azurediscover_enabled": { + "description": "True if Azure Discover is enabled.", + "type": "boolean", + "x-order": 17 + }, + "connected_to_platform": { + "type": "boolean", + "title": "True if the PMM instance is connected to Platform", + "x-order": 18 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Settings/Get": { + "post": { + "description": "Returns current PMM Server settings.", + "tags": [ + "Server" + ], + "summary": "Get settings", + "operationId": "GetSettings", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "settings": { + "description": "Settings represents PMM Server settings.", + "type": "object", + "properties": { + "email_alerting_settings": { + "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", + "type": "object", + "properties": { + "from": { + "description": "SMTP From header field.", + "type": "string", + "x-order": 0 + }, + "smarthost": { + "description": "SMTP host and port.", + "type": "string", + "x-order": 1 + }, + "hello": { + "description": "Hostname to identify to the SMTP server.", + "type": "string", + "x-order": 2 + }, + "username": { + "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", + "type": "string", + "x-order": 3 + }, + "password": { + "description": "Auth using LOGIN and PLAIN.", + "type": "string", + "x-order": 4 + }, + "identity": { + "description": "Auth using PLAIN.", + "type": "string", + "x-order": 5 + }, + "secret": { + "description": "Auth using CRAM-MD5.", + "type": "string", + "x-order": 6 + }, + "require_tls": { + "description": "Require TLS.", + "type": "boolean", + "x-order": 7 + } + } + }, + "stt_check_intervals": { + "description": "STTCheckIntervals represents intervals between STT 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 + } + } + }, + "slack_alerting_settings": { + "description": "SlackAlertingSettings represents Slack configuration for Alerting.", + "type": "object", + "properties": { + "url": { + "description": "Slack API (webhook) URL.", + "type": "string", + "x-order": 0 + } + } + }, + "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 + } + } + }, + "updates_disabled": { + "description": "True if updates are disabled.", + "type": "boolean", + "x-order": 0 + }, + "telemetry_enabled": { + "description": "True if telemetry is enabled.", + "type": "boolean", + "x-order": 1 + }, + "data_retention": { + "type": "string", + "x-order": 3 + }, + "ssh_key": { + "type": "string", + "x-order": 4 + }, + "aws_partitions": { + "type": "array", + "items": { + "type": "string" + }, + "x-order": 5 + }, + "alert_manager_url": { + "description": "External AlertManager URL (e.g., https://username:password@1.2.3.4/path).", + "type": "string", + "x-order": 6 + }, + "alert_manager_rules": { + "description": "Custom alerting or recording rules.", + "type": "string", + "x-order": 7 + }, + "stt_enabled": { + "description": "True if Security Threat Tool is enabled.", + "type": "boolean", + "x-order": 8 + }, + "platform_email": { + "description": "Percona Platform user's email, if this PMM instance is linked to the Platform.", + "type": "string", + "x-order": 9 + }, + "dbaas_enabled": { + "description": "True if DBaaS is enabled.", + "type": "boolean", + "x-order": 10 + }, + "alerting_enabled": { + "description": "True if Alerting is enabled.", + "type": "boolean", + "x-order": 11 + }, + "pmm_public_address": { + "description": "PMM Server public address.", + "type": "string", + "x-order": 14 + }, + "backup_management_enabled": { + "description": "True if Backup Management is enabled.", + "type": "boolean", + "x-order": 16 + }, + "azurediscover_enabled": { + "description": "True if Azure Discover is enabled.", + "type": "boolean", + "x-order": 17 + }, + "connected_to_platform": { + "type": "boolean", + "title": "True if the PMM instance is connected to Platform", + "x-order": 18 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Settings/TestEmailAlertingSettings": { + "post": { + "description": "Sends test email to check current SMTP settings for email alerting.", + "tags": [ + "Server" + ], + "summary": "Test email alerting", + "operationId": "TestEmailAlertingSettings", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "email_alerting_settings": { + "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", + "type": "object", + "properties": { + "from": { + "description": "SMTP From header field.", + "type": "string", + "x-order": 0 + }, + "smarthost": { + "description": "SMTP host and port.", + "type": "string", + "x-order": 1 + }, + "hello": { + "description": "Hostname to identify to the SMTP server.", + "type": "string", + "x-order": 2 + }, + "username": { + "description": "Auth using CRAM-MD5, LOGIN and PLAIN.", + "type": "string", + "x-order": 3 + }, + "password": { + "description": "Auth using LOGIN and PLAIN.", + "type": "string", + "x-order": 4 + }, + "identity": { + "description": "Auth using PLAIN.", + "type": "string", + "x-order": 5 + }, + "secret": { + "description": "Auth using CRAM-MD5.", + "type": "string", + "x-order": 6 + }, + "require_tls": { + "description": "Require TLS.", + "type": "boolean", + "x-order": 7 + } + } + }, + "email_to": { + "description": "Target email address to send the email to.", + "type": "string", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Updates/Check": { + "post": { + "description": "Checks for available PMM Server updates.", + "tags": [ + "Server" + ], + "summary": "Check updates", + "operationId": "CheckUpdates", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "force": { + "description": "If false, cached information may be returned.", + "type": "boolean", + "x-order": 0 + }, + "only_installed_version": { + "description": "If true, only installed version will be in response.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "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 + } + } + }, + "latest": { + "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 + } + } + }, + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Updates/Start": { + "post": { + "description": "Starts PMM Server update.", + "tags": [ + "Server" + ], + "summary": "Start update", + "operationId": "StartUpdate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/Updates/Status": { + "post": { + "description": "Returns PMM Server update status.", + "tags": [ + "Server" + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddAzureDatabaseExporter": { + "post": { + "description": "Adds azure_database_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add Azure Database Exporter", + "operationId": "AddAzureDatabaseExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddExternalExporter": { + "post": { + "description": "Adds external_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add External Exporter", + "operationId": "AddExternalExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddMongoDBExporter": { + "post": { + "description": "Adds mongodb_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add MongoDB Exporter", + "operationId": "AddMongoDBExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddMySQLdExporter": { + "post": { + "description": "Adds mysqld_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add mysqld Exporter", + "operationId": "AddMySQLdExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + }, + "table_count": { + "description": "Actual table count at the moment of adding.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddNodeExporter": { + "post": { + "description": "Adds node_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add Node Exporter", + "operationId": "AddNodeExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 7 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddPMMAgent": { + "post": { + "description": "Adds PMM Agent.", + "tags": [ + "Agents" + ], + "summary": "Add PMM Agent", + "operationId": "AddPMMAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddPostgresExporter": { + "post": { + "description": "Adds postgres_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add Postgres Exporter", + "operationId": "AddPostgresExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddProxySQLExporter": { + "post": { + "description": "Adds proxysql_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add ProxySQL Exporter", + "operationId": "AddProxySQLExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddQANMongoDBProfilerAgent": { + "post": { + "description": "Adds 'Query Analytics MongoDB Profiler' Agent.", + "tags": [ + "Agents" + ], + "summary": "Add 'QAN MongoDB Profiler' Agent", + "operationId": "AddQANMongoDBProfilerAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "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 + }, + "authentication_mechanism": { + "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", + "type": "string", + "x-order": 11 + }, + "authentication_database": { + "description": "Authentication database.", + "type": "string", + "x-order": 12 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddQANMySQLPerfSchemaAgent": { + "post": { + "description": "Adds 'Query Analytics MySQL PerfSchema' Agent.", + "tags": [ + "Agents" + ], + "summary": "Add 'QAN MySQL PerfSchema' Agent", + "operationId": "AddQANMySQLPerfSchemaAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "qan_mysql_perfschema_agent": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddQANMySQLSlowlogAgent": { + "post": { + "description": "Adds 'Query Analytics MySQL Slowlog' Agent.", + "tags": [ + "Agents" + ], + "summary": "Add 'QAN MySQL Slowlog' Agent", + "operationId": "AddQANMySQLSlowlogAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 9 + }, + "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": 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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "qan_mysql_slowlog_agent": { + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 11 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 12 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddQANPostgreSQLPgStatMonitorAgent": { + "post": { + "description": "Adds 'Query Analytics PostgreSQL pg_stat_monitor' Agent.", + "tags": [ + "Agents" + ], + "summary": "Add 'QAN PostgreSQL pg_stat_monitor' Agent", + "operationId": "AddQANPostgreSQLPgStatMonitorAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 6 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 8 + }, + "tls_ca": { + "description": "TLS CA certificate.", + "type": "string", + "x-order": 9 + }, + "tls_cert": { + "description": "TLS Certifcate.", + "type": "string", + "x-order": 10 + }, + "tls_key": { + "description": "TLS Certificate Key.", + "type": "string", + "x-order": 11 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddQANPostgreSQLPgStatementsAgent": { + "post": { + "description": "Adds 'Query Analytics PostgreSQL pg_stat_statements' Agent.", + "tags": [ + "Agents" + ], + "summary": "Add 'QAN PostgreSQL pg_stat_statements' Agent", + "operationId": "AddQANPostgreSQLPgStatementsAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "tls_ca": { + "description": "TLS CA certificate.", + "type": "string", + "x-order": 8 + }, + "tls_cert": { + "description": "TLS Certifcate.", + "type": "string", + "x-order": 9 + }, + "tls_key": { + "description": "TLS Certificate Key.", + "type": "string", + "x-order": 10 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/AddRDSExporter": { + "post": { + "description": "Adds rds_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Add RDS Exporter", + "operationId": "AddRDSExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeAzureDatabaseExporter": { + "post": { + "description": "Changes azure_database_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change Azure Database Exporter", + "operationId": "ChangeAzureDatabaseExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeExternalExporter": { + "post": { + "description": "Changes external_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change External Exporter", + "operationId": "ChangeExternalExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeMongoDBExporter": { + "post": { + "description": "Changes mongodb_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change MongoDB Exporter", + "operationId": "ChangeMongoDBExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeMySQLdExporter": { + "post": { + "description": "Changes mysqld_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change mysqld Exporter", + "operationId": "ChangeMySQLdExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeNodeExporter": { + "post": { + "description": "Changes node_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change Node Exporter", + "operationId": "ChangeNodeExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 7 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangePostgresExporter": { + "post": { + "description": "Changes postgres_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change Postgres Exporter", + "operationId": "ChangePostgresExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeProxySQLExporter": { + "post": { + "description": "Changes proxysql_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change ProxySQL Exporter", + "operationId": "ChangeProxySQLExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeQANMongoDBProfilerAgent": { + "post": { + "description": "Changes 'Query Analytics MongoDB Profiler' Agent.", + "tags": [ + "Agents" + ], + "summary": "Change 'QAN MongoDB Profiler' Agent", + "operationId": "ChangeQANMongoDBProfilerAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeQANMySQLPerfSchemaAgent": { + "post": { + "description": "Changes 'Query Analytics MySQL PerfSchema' Agent.", + "tags": [ + "Agents" + ], + "summary": "Change 'QAN MySQL PerfSchema' Agent", + "operationId": "ChangeQANMySQLPerfSchemaAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "qan_mysql_perfschema_agent": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeQANMySQLSlowlogAgent": { + "post": { + "description": "Changes 'Query Analytics MySQL Slowlog' Agent.", + "tags": [ + "Agents" + ], + "summary": "Change 'QAN MySQL Slowlog' Agent", + "operationId": "ChangeQANMySQLSlowlogAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "qan_mysql_slowlog_agent": { + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 11 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 12 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeQANPostgreSQLPgStatMonitorAgent": { + "post": { + "description": "Changes 'Query Analytics PostgreSQL pg_stat_monitor' Agent.", + "tags": [ + "Agents" + ], + "summary": "Change 'QAN PostgreSQL pg_stat_monitor' Agent", + "operationId": "ChangeQANPostgreSQLPgStatMonitorAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeQANPostgreSQLPgStatementsAgent": { + "post": { + "description": "Changes 'Query Analytics PostgreSQL pg_stat_statements' Agent.", + "tags": [ + "Agents" + ], + "summary": "Change 'QAN PostgreSQL pg_stat_statements' Agent", + "operationId": "ChangeQANPostgreSQLPgStatementsAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/ChangeRDSExporter": { + "post": { + "description": "Changes rds_exporter Agent.", + "tags": [ + "Agents" + ], + "summary": "Change RDS Exporter", + "operationId": "ChangeRDSExporter", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "common": { + "description": "ChangeCommonAgentParams contains parameters that can be changed for all Agents.", + "type": "object", + "properties": { + "enable": { + "description": "Enable this Agent. Can't be used with disabled.", + "type": "boolean", + "x-order": 0 + }, + "disable": { + "description": "Disable this Agent. Can't be used with enabled.", + "type": "boolean", + "x-order": 1 + }, + "custom_labels": { + "description": "Replace all custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 2 + }, + "remove_custom_labels": { + "description": "Remove all custom user-assigned labels.", + "type": "boolean", + "x-order": 3 + }, + "enable_push_metrics": { + "description": "Enables push metrics with vmagent, can't be used with disable_push_metrics.\nCan't be used with agent version lower then 2.12 and unsupported agents.", + "type": "boolean", + "x-order": 4 + }, + "disable_push_metrics": { + "description": "Disables push metrics, pmm-server starts to pull it, can't be used with enable_push_metrics.", + "type": "boolean", + "x-order": 5 + } + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/Get": { + "post": { + "description": "Returns a single Agent by ID.", + "tags": [ + "Agents" + ], + "summary": "Get Agent", + "operationId": "GetAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 7 + } + } + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "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": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + }, + "qan_mysql_slowlog_agent": { + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 11 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/List": { + "post": { + "description": "Returns a list of all Agents.", + "tags": [ + "Agents" + ], + "summary": "List Agents", + "operationId": "ListAgents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_type": { + "description": "AgentType describes supported Agent types.", + "type": "string", + "default": "AGENT_TYPE_INVALID", + "enum": [ + "AGENT_TYPE_INVALID", + "PMM_AGENT", + "VM_AGENT", + "NODE_EXPORTER", + "MYSQLD_EXPORTER", + "MONGODB_EXPORTER", + "POSTGRES_EXPORTER", + "PROXYSQL_EXPORTER", + "QAN_MYSQL_PERFSCHEMA_AGENT", + "QAN_MYSQL_SLOWLOG_AGENT", + "QAN_MONGODB_PROFILER_AGENT", + "QAN_POSTGRESQL_PGSTATEMENTS_AGENT", + "QAN_POSTGRESQL_PGSTATMONITOR_AGENT", + "RDS_EXPORTER", + "EXTERNAL_EXPORTER", + "AZURE_DATABASE_EXPORTER" + ] + }, + "pmm_agent_id": { + "description": "Return only Agents started by this pmm-agent.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", + "type": "string", + "x-order": 0 + }, + "node_id": { + "description": "Return only Agents that provide insights for that Node.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", + "type": "string", + "x-order": 1 + }, + "service_id": { + "description": "Return only Agents that provide insights for that Service.\nExactly one of these parameters should be present: pmm_agent_id, node_id, service_id.", + "type": "string", + "x-order": 2 + } + } + } + } + ], + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 7 + } + } + }, + "x-order": 2 + }, + "mysqld_exporter": { + "type": "array", + "items": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "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": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + }, + "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": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 11 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 12 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + } + }, + "x-order": 9 + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "x-order": 10 + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + } + }, + "x-order": 11 + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 + } + } + }, + "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 + } + } + }, + "x-order": 13 + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "x-order": 14 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Agents/Remove": { + "post": { + "description": "Removes Agent.", + "tags": [ + "Agents" + ], + "summary": "Remove Agent", + "operationId": "RemoveAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "x-order": 0 + }, + "force": { + "description": "Remove agent with all dependencies.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/AddContainer": { + "post": { + "description": "Adds container Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Container Node", + "operationId": "AddContainerNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/AddGeneric": { + "post": { + "description": "Adds generic Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Generic Node", + "operationId": "AddGenericNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/AddRemote": { + "post": { + "description": "Adds remote Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Remote Node", + "operationId": "AddRemoteNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/AddRemoteAzureDatabase": { + "post": { + "description": "Adds remote Azure database Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Remote Azure Database Node", + "operationId": "AddRemoteAzureDatabaseNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/AddRemoteRDS": { + "post": { + "description": "Adds remote RDS Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Remote RDS Node", + "operationId": "AddRemoteRDSNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/Get": { + "post": { + "description": "Returns a single Node by ID.", + "tags": [ + "Nodes" + ], + "summary": "Get Node", + "operationId": "GetNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/List": { + "post": { + "description": "Returns a list of all Nodes.", + "tags": [ + "Nodes" + ], + "summary": "List Nodes", + "operationId": "ListNodes", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "node_type": { + "description": "NodeType describes supported Node types.", + "type": "string", + "default": "NODE_TYPE_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + } + } + } + } + ], + "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 + } + } + }, + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Nodes/Remove": { + "post": { + "description": "Removes Node.", + "tags": [ + "Nodes" + ], + "summary": "Remove Node", + "operationId": "RemoveNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "force": { + "description": "Remove node with all dependencies.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddExternalService": { + "post": { + "description": "Adds External Service.", + "tags": [ + "Services" + ], + "summary": "Add External Service", + "operationId": "AddExternalService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddHAProxyService": { + "post": { + "description": "Adds HAProxy Service.", + "tags": [ + "Services" + ], + "summary": "Add HAProxy Service", + "operationId": "AddHAProxyService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddMongoDB": { + "post": { + "description": "Adds MongoDB Service.", + "tags": [ + "Services" + ], + "summary": "Add MongoDB Service", + "operationId": "AddMongoDBService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddMySQL": { + "post": { + "description": "Adds MySQL Service.", + "tags": [ + "Services" + ], + "summary": "Add MySQL Service", + "operationId": "AddMySQLService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddPostgreSQL": { + "post": { + "description": "Adds PostgreSQL Service.", + "tags": [ + "Services" + ], + "summary": "Add PostgreSQL Service", + "operationId": "AddPostgreSQLService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/AddProxySQL": { + "post": { + "description": "Adds ProxySQL Service.", + "tags": [ + "Services" + ], + "summary": "Add ProxySQL Service", + "operationId": "AddProxySQLService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/Get": { + "post": { + "description": "Returns a single Service by ID.", + "tags": [ + "Services" + ], + "summary": "Get Service", + "operationId": "GetService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "service_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/List": { + "post": { + "description": "Returns a list of Services filtered by type.", + "tags": [ + "Services" + ], + "summary": "List Services", + "operationId": "ListServices", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "node_id": { + "description": "Return only Services running on that Node.", + "type": "string", + "x-order": 0 + }, + "service_type": { + "description": "ServiceType describes supported Service types.", + "type": "string", + "default": "SERVICE_TYPE_INVALID", + "enum": [ + "SERVICE_TYPE_INVALID", + "MYSQL_SERVICE", + "MONGODB_SERVICE", + "POSTGRESQL_SERVICE", + "PROXYSQL_SERVICE", + "HAPROXY_SERVICE", + "EXTERNAL_SERVICE" + ] + }, + "external_group": { + "description": "Return only services in this external group.", + "type": "string", + "x-order": 2 + } + } + } + } + ], + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/inventory/Services/Remove": { + "post": { + "description": "Removes Service.", + "tags": [ + "Services" + ], + "summary": "Remove Service", + "operationId": "RemoveService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "service_id": { + "description": "Unique randomly generated instance identifier. Required.", + "type": "string", + "x-order": 0 + }, + "force": { + "description": "Remove service with all dependencies.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/Cancel": { + "post": { + "description": "Stops an Action.", + "tags": [ + "Actions" + ], + "summary": "Cancel 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/Get": { + "post": { + "description": "Gets the result of a given Action.", + "tags": [ + "Actions" + ], + "summary": "Get Action", + "operationId": "GetAction", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "action_id": { + "description": "Unique Action ID.", + "type": "string", + "x-order": 0 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMongoDBExplain": { + "post": { + "description": "Starts 'MongoDB EXPLAIN' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'MongoDB EXPLAIN' Action", + "operationId": "StartMongoDBExplainAction", + "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 + }, + "service_id": { + "description": "Service ID for this Action. Required.", + "type": "string", + "x-order": 1 + }, + "query": { + "description": "Query. Required.", + "type": "string", + "x-order": 2 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLExplain": { + "post": { + "description": "Starts 'MySQL EXPLAIN' Action with traditional output.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL EXPLAIN' Action", + "operationId": "StartMySQLExplainAction", + "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 + }, + "service_id": { + "description": "Service ID for this Action. Required.", + "type": "string", + "x-order": 1 + }, + "query": { + "description": "SQL query. Required.", + "type": "string", + "x-order": 2 + }, + "database": { + "description": "Database name. Required if it can't be deduced from the query.", + "type": "string", + "x-order": 3 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLExplainJSON": { + "post": { + "description": "Starts 'MySQL EXPLAIN' Action with JSON output.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL EXPLAIN JSON' Action", + "operationId": "StartMySQLExplainJSONAction", + "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 + }, + "service_id": { + "description": "Service ID for this Action. Required.", + "type": "string", + "x-order": 1 + }, + "query": { + "description": "SQL query. Required.", + "type": "string", + "x-order": 2 + }, + "database": { + "description": "Database name. Required if it can't be deduced from the query.", + "type": "string", + "x-order": 3 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLExplainTraditionalJSON": { + "post": { + "description": "Starts 'MySQL EXPLAIN' Action with traditional JSON output.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL EXPLAIN Traditional JSON' Action", + "operationId": "StartMySQLExplainTraditionalJSONAction", + "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 + }, + "service_id": { + "description": "Service ID for this Action. Required.", + "type": "string", + "x-order": 1 + }, + "query": { + "description": "SQL query. Required.", + "type": "string", + "x-order": 2 + }, + "database": { + "description": "Database name. Required if it can't be deduced from the query.", + "type": "string", + "x-order": 3 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLShowCreateTable": { + "post": { + "description": "Starts 'MySQL SHOW CREATE TABLE' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL SHOW CREATE TABLE' Action", + "operationId": "StartMySQLShowCreateTableAction", + "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 + }, + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLShowIndex": { + "post": { + "description": "Starts 'MySQL SHOW INDEX' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL SHOW INDEX' Action", + "operationId": "StartMySQLShowIndexAction", + "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 + }, + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartMySQLShowTableStatus": { + "post": { + "description": "Starts 'MySQL SHOW TABLE STATUS' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'MySQL SHOW TABLE STATUS' Action", + "operationId": "StartMySQLShowTableStatusAction", + "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 + }, + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPTMongoDBSummary": { + "post": { + "description": "Starts 'Percona Toolkit MongoDB Summary' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'PT MongoDB Summary' Action", + "operationId": "StartPTMongoDBSummaryAction", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPTMySQLSummary": { + "post": { + "description": "Starts 'Percona Toolkit MySQL Summary' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'PT MySQL Summary' Action", + "operationId": "StartPTMySQLSummaryAction", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPTPgSummary": { + "post": { + "description": "Starts 'Percona Toolkit PostgreSQL Summary' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'PT PostgreSQL Summary' Action", + "operationId": "StartPTPgSummaryAction", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "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 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPTSummary": { + "post": { + "description": "Starts 'Percona Toolkit Summary' Action.", + "tags": [ + "Actions" + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPostgreSQLShowCreateTable": { + "post": { + "description": "Starts 'PostgreSQL SHOW CREATE TABLE' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'PostgreSQL SHOW CREATE TABLE' Action", + "operationId": "StartPostgreSQLShowCreateTableAction", + "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 + }, + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Actions/StartPostgreSQLShowIndex": { + "post": { + "description": "Starts 'PostgreSQL SHOW INDEX' Action.", + "tags": [ + "Actions" + ], + "summary": "Start 'PostgreSQL SHOW INDEX' Action", + "operationId": "StartPostgreSQLShowIndexAction", + "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 + }, + "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 + } + } + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Annotations/Add": { + "post": { + "description": "Adds annotation.", + "tags": [ + "Annotation" + ], + "summary": "Add Annotation", + "operationId": "AddAnnotation", + "parameters": [ + { + "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 annotate node.", + "type": "string", + "x-order": 2 + }, + "service_names": { + "description": "Used for annotate 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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/External/Add": { + "post": { + "description": "Adds external service and adds external exporter. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds an \"external exporter\" agent to inventory, which is running on provided \"runs_on_node_id\".", + "tags": [ + "External" + ], + "summary": "Add External Service", + "operationId": "AddExternal", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "runs_on_node_id": { + "description": "Node identifier on which an external exporter is been running.\nruns_on_node_id always should be passed with node_id.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + } + }, + "node_name": { + "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", + "type": "string", + "x-order": 3 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 4 + }, + "username": { + "description": "HTTP basic auth username for collecting metrics.", + "type": "string", + "x-order": 5 + }, + "password": { + "description": "HTTP basic auth password for collecting metrics.", + "type": "string", + "x-order": 6 + }, + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", + "type": "string", + "x-order": 7 + }, + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", + "type": "string", + "x-order": 8 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 9 + }, + "node_id": { + "description": "Node identifier on which an external service is been running.\nnode_id always should be passed with runs_on_node_id.", + "type": "string", + "x-order": 10 + }, + "environment": { + "description": "Environment name.", + "type": "string", + "x-order": 11 + }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 12 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 13 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 14 + }, + "group": { + "description": "Group name of external service.", + "type": "string", + "x-order": 15 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 17 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/HAProxy/Add": { + "post": { + "description": "Adds HAProxy service and external exporter. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds an \"external exporter\" agent to the inventory.", + "tags": [ + "HAProxy" + ], + "summary": "Add HAProxy", + "operationId": "AddHAProxy", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "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 + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + } + }, + "node_name": { + "description": "Node name on which a service and node is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", + "type": "string", + "x-order": 3 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 4 + }, + "username": { + "description": "HTTP basic auth username for collecting metrics.", + "type": "string", + "x-order": 5 + }, + "password": { + "description": "HTTP basic auth password for collecting metrics.", + "type": "string", + "x-order": 6 + }, + "scheme": { + "description": "Scheme to generate URI to exporter metrics endpoints.", + "type": "string", + "x-order": 7 + }, + "metrics_path": { + "description": "Path under which metrics are exposed, used to generate URI.", + "type": "string", + "x-order": 8 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 9 + }, + "environment": { + "description": "Environment name.", + "type": "string", + "x-order": 10 + }, + "cluster": { + "description": "Cluster name.", + "type": "string", + "x-order": 11 + }, + "replication_set": { + "description": "Replication set name.", + "type": "string", + "x-order": 12 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 13 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 15 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/MongoDB/Add": { + "post": { + "description": "Adds MongoDB Service and starts several Agents. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds \"mongodb_exporter\", and \"qan_mongodb_profiler\" agents with the provided \"pmm_agent_id\" and other parameters.", + "tags": [ + "MongoDB" + ], + "summary": "Add MongoDB", + "operationId": "AddMongoDB", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "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 + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "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 + } + } + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 3 + }, + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 4 + }, + "port": { + "description": "Service Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 14 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 15 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 16 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 17 + }, + "tls_certificate_key": { + "description": "Client certificate and key.", + "type": "string", + "x-order": 18 + }, + "tls_certificate_key_file_password": { + "description": "Password for decrypting tls_certificate_key.", + "type": "string", + "x-order": 19 + }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 20 + }, + "disable_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 22 + }, + "authentication_mechanism": { + "description": "Authentication mechanism.\nSee https://docs.mongodb.com/manual/reference/connection-string/#mongodb-urioption-urioption.authMechanism\nfor details.", + "type": "string", + "x-order": 23 + }, + "authentication_database": { + "description": "Authentication database.", + "type": "string", + "x-order": 24 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", + "type": "string", + "x-order": 25 + }, + "stats_collections": { + "description": "List of collections to get stats from. Can use * .", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 26 + }, + "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": 27 + }, + "enable_all_collectors": { + "type": "boolean", + "title": "Enable all collectors", + "x-order": 28 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/MySQL/Add": { + "post": { + "description": "Adds MySQL Service and starts several Agents. It automatically adds a service to inventory, which is running on the provided \"node_id\", then adds \"mysqld_exporter\", and \"qan_mysql_perfschema\" agents with the provided \"pmm_agent_id\" and other parameters.", + "tags": [ + "MySQL" + ], + "summary": "Add MySQL", + "operationId": "AddMySQL", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + } + }, + "node_id": { + "description": "Node identifier on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 3 + }, + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 4 + }, + "port": { + "description": "Service Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "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_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 17 + }, + "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": 18 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 19 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation.", + "type": "boolean", + "x-order": 20 + }, + "tls_ca": { + "description": "Certificate Authority certificate chain.", + "type": "string", + "x-order": 21 + }, + "tls_cert": { + "description": "Client certificate.", + "type": "string", + "x-order": 22 + }, + "tls_key": { + "description": "Password for decrypting tls_cert.", + "type": "string", + "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_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 26 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", + "type": "string", + "x-order": 27 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + }, + "qan_mysql_perfschema": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + }, + "qan_mysql_slowlog": { + "description": "QANMySQLSlowlogAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "max_slowlog_file_size": { + "description": "Slowlog file is rotated at this size if \u003e 0.", + "type": "string", + "format": "int64", + "x-order": 11 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 12 + } + } + }, + "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 + } + } + }, + "table_count": { + "description": "Actual table count at the moment of adding.", + "type": "integer", + "format": "int32", + "x-order": 4 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Node/Register": { + "post": { + "description": "Registers a new Node and pmm-agent.", + "tags": [ + "Node" + ], + "summary": "Register 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "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 + }, + "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 + }, + "disable_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 13 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/PostgreSQL/Add": { + "post": { + "description": "Adds PostgreSQL Service and starts postgres exporter. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds \"postgres_exporter\" with provided \"pmm_agent_id\" and other parameters.", + "tags": [ + "PostgreSQL" + ], + "summary": "Add PostgreSQL", + "operationId": "AddPostgreSQL", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "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 + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + } + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 3 + }, + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 4 + }, + "port": { + "description": "Service Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "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 + }, + "disable_query_examples": { + "description": "Disable query examples.", + "type": "boolean", + "x-order": 16 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Service.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 17 + }, + "skip_connection_check": { + "description": "Skip connection check.", + "type": "boolean", + "x-order": 18 + }, + "tls": { + "description": "Use TLS for database connections.", + "type": "boolean", + "x-order": 19 + }, + "tls_skip_verify": { + "description": "Skip TLS certificate and hostname validation. Uses sslmode=required instead of verify-full.", + "type": "boolean", + "x-order": 20 + }, + "disable_collectors": { + "description": "List of collector names to disable in this exporter.", + "type": "array", + "items": { + "type": "string" + }, + "x-order": 22 + }, + "tls_ca": { + "description": "TLS CA certificate.", + "type": "string", + "x-order": 23 + }, + "tls_cert": { + "description": "TLS Certifcate.", + "type": "string", + "x-order": 24 + }, + "tls_key": { + "description": "TLS Certificate Key.", + "type": "string", + "x-order": 25 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", + "type": "string", + "x-order": 26 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/ProxySQL/Add": { + "post": { + "description": "Adds ProxySQL Service and starts several Agents. It automatically adds a service to inventory, which is running on provided \"node_id\", then adds \"proxysql_exporter\" with provided \"pmm_agent_id\" and other parameters.", + "tags": [ + "ProxySQL" + ], + "summary": "Add ProxySQL", + "operationId": "AddProxySQL", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "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 + }, + "add_node": { + "description": "AddNodeParams is a params 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_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "GENERIC_NODE", + "CONTAINER_NODE", + "REMOTE_NODE", + "REMOTE_RDS_NODE", + "REMOTE_AZURE_DATABASE_NODE" + ] + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels for Node.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + } + }, + "node_name": { + "description": "Node name on which a service is been running.\nExactly one of these parameters should be present: node_id, node_name, add_node.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Required.", + "type": "string", + "x-order": 3 + }, + "address": { + "description": "Node and Service access address (DNS name or IP).\nAddress (and port) or socket is required.", + "type": "string", + "x-order": 4 + }, + "port": { + "description": "Service Access port.\nPort is required when the address present.", + "type": "integer", + "format": "int64", + "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 + }, + "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 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "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 + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/RDS/Add": { + "post": { + "description": "Adds RDS instance.", + "tags": [ + "RDS" + ], + "summary": "Add RDS", + "operationId": "AddRDS", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "engine": { + "description": "DiscoverRDSEngine describes supported RDS instance engines.", + "type": "string", + "default": "DISCOVER_RDS_ENGINE_INVALID", + "enum": [ + "DISCOVER_RDS_ENGINE_INVALID", + "DISCOVER_RDS_MYSQL", + "DISCOVER_RDS_POSTGRESQL" + ] + }, + "region": { + "description": "AWS region.", + "type": "string", + "x-order": 0 + }, + "metrics_mode": { + "description": "MetricsMode defines desired metrics mode for agent,\nit can be pull, push or auto mode chosen by server.", + "type": "string", + "default": "AUTO", + "enum": [ + "AUTO", + "PULL", + "PUSH" + ] + }, + "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 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name. Defaults to AWS instance ID.", + "type": "string", + "x-order": 7 + }, + "service_name": { + "description": "Unique across all Services user-defined name. Defaults to AWS instance ID.", + "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": "Username for scraping metrics.", + "type": "string", + "x-order": 12 + }, + "password": { + "description": "Password for scraping metrics.", + "type": "string", + "x-order": 13 + }, + "aws_access_key": { + "description": "AWS Access key.", + "type": "string", + "x-order": 14 + }, + "aws_secret_key": { + "description": "AWS Secret key.", + "type": "string", + "x-order": 15 + }, + "rds_exporter": { + "description": "If true, adds rds_exporter.", + "type": "boolean", + "x-order": 16 + }, + "qan_mysql_perfschema": { + "description": "If true, adds qan-mysql-perfschema-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 + }, + "disable_basic_metrics": { + "description": "Disable basic metrics.", + "type": "boolean", + "x-order": 24 + }, + "disable_enhanced_metrics": { + "description": "Disable enhanced metrics.", + "type": "boolean", + "x-order": 25 + }, + "qan_postgresql_pgstatements": { + "type": "boolean", + "title": "If true, add qan-pgstatements", + "x-order": 27 + }, + "agent_password": { + "description": "Custom password for exporter endpoint /metrics.", + "type": "string", + "x-order": 28 + } + } + } + } + ], + "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 + } + } + }, + "mysqld_exporter": { + "description": "MySQLdExporter runs on Generic or Container Node and exposes MySQL Service metrics.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 15 + }, + "tablestats_group_disabled": { + "description": "True if tablestats group collectors are currently disabled.", + "type": "boolean", + "x-order": 16 + } + } + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "listen_port": { + "description": "Listen port for scraping metrics.", + "type": "integer", + "format": "int64", + "x-order": 11 + } + } + }, + "qan_mysql_perfschema": { + "description": "QANMySQLPerfSchemaAgent runs within pmm-agent and sends MySQL Query Analytics data to the PMM Server.", + "type": "object", + "properties": { + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "query_examples_disabled": { + "description": "True if query examples are disabled.", + "type": "boolean", + "x-order": 10 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 11 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "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 + }, + "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 + } + } + }, + "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 + }, + "status": { + "description": "AgentStatus represents actual Agent status.\n\n - STARTING: Agent is starting.\n - RUNNING: Agent is running.\n - WAITING: Agent encountered error and will be restarted automatically soon.\n - STOPPING: Agent is stopping.\n - DONE: Agent finished.\n - UNKNOWN: Agent is not connected, we don't know anything about it's state.", + "type": "string", + "default": "AGENT_STATUS_INVALID", + "enum": [ + "AGENT_STATUS_INVALID", + "STARTING", + "RUNNING", + "WAITING", + "STOPPING", + "DONE", + "UNKNOWN" + ] + }, + "pmm_agent_id": { + "description": "The pmm-agent identifier which runs this instance.", + "type": "string", + "x-order": 1 + }, + "disabled": { + "description": "Desired Agent status: enabled (false) or disabled (true).", + "type": "boolean", + "x-order": 2 + }, + "node_id": { + "description": "Node identifier.", + "type": "string", + "x-order": 3 + }, + "aws_access_key": { + "description": "AWS Access Key.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "listen_port": { + "description": "Listen port for scraping metrics (the same for several configurations).", + "type": "integer", + "format": "int64", + "x-order": 7 + }, + "basic_metrics_disabled": { + "description": "Basic metrics are disabled.", + "type": "boolean", + "x-order": 8 + }, + "enhanced_metrics_disabled": { + "description": "Enhanced metrics are disabled.", + "type": "boolean", + "x-order": 9 + }, + "push_metrics_enabled": { + "description": "True if exporter uses push metrics mode.", + "type": "boolean", + "x-order": 10 + } + } + }, + "table_count": { + "description": "Actual table count at the moment of adding.", + "type": "integer", + "format": "int32", + "x-order": 5 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/RDS/Discover": { + "post": { + "description": "Discovers RDS instances.", + "tags": [ + "RDS" + ], + "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 + }, + "engine": { + "description": "DiscoverRDSEngine describes supported RDS instance engines.", + "type": "string", + "default": "DISCOVER_RDS_ENGINE_INVALID", + "enum": [ + "DISCOVER_RDS_ENGINE_INVALID", + "DISCOVER_RDS_MYSQL", + "DISCOVER_RDS_POSTGRESQL" + ] + }, + "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_version": { + "description": "Engine version.", + "type": "string", + "x-order": 7 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/Change": { + "post": { + "description": "Enables/disables Security Thread Tool checks or changes their interval by names.", + "tags": [ + "SecurityChecks" + ], + "summary": "Change Security Checks", + "operationId": "ChangeSecurityChecks", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "description": "ChangeSecurityCheckParams specifies a single check parameters.", + "type": "object", + "properties": { + "interval": { + "description": "SecurityCheckInterval represents possible execution interval values for checks.", + "type": "string", + "default": "SECURITY_CHECK_INTERVAL_INVALID", + "enum": [ + "SECURITY_CHECK_INTERVAL_INVALID", + "STANDARD", + "FREQUENT", + "RARE" + ] + }, + "name": { + "description": "The name of the check to change.", + "type": "string", + "x-order": 0 + }, + "enable": { + "type": "boolean", + "x-order": 1 + }, + "disable": { + "type": "boolean", + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/FailedChecks": { + "post": { + "description": "Returns the latest check results for a given service.", + "tags": [ + "SecurityChecks" + ], + "summary": "Get Failed Checks", + "operationId": "GetFailedChecks", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "page_params": { + "description": "PageParams represents page request parameters for pagination.", + "type": "object", + "properties": { + "page_size": { + "description": "Maximum number of results per page.", + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "index": { + "description": "Index of the requested page, starts from 0.", + "type": "integer", + "format": "int32", + "x-order": 1 + } + } + }, + "service_id": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "page_totals": { + "description": "PageTotals represents total values for pagination.", + "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", + "items": { + "description": "CheckResult represents the check results for a given service.", + "type": "object", + "properties": { + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "summary": { + "type": "string", + "x-order": 0 + }, + "description": { + "type": "string", + "x-order": 1 + }, + "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 STT 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 + }, + "alert_id": { + "type": "string", + "title": "ID of the check result as stored in AlertManager", + "x-order": 8 + }, + "silenced": { + "type": "boolean", + "title": "Silence status of the check result", + "x-order": 9 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/GetCheckResults": { + "post": { + "description": "Returns Security Thread Tool's latest checks results.", + "tags": [ + "SecurityChecks" + ], + "summary": "Get Security Check Results", + "operationId": "GetSecurityCheckResults", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "description": "SecurityCheckResult represents the check result returned from pmm-managed after running the check.", + "type": "object", + "properties": { + "severity": { + "description": "Severity represents severity level of the check result or alert.", + "type": "string", + "default": "SEVERITY_INVALID", + "enum": [ + "SEVERITY_INVALID", + "SEVERITY_EMERGENCY", + "SEVERITY_ALERT", + "SEVERITY_CRITICAL", + "SEVERITY_ERROR", + "SEVERITY_WARNING", + "SEVERITY_NOTICE", + "SEVERITY_INFO", + "SEVERITY_DEBUG" + ] + }, + "summary": { + "type": "string", + "x-order": 0 + }, + "description": { + "type": "string", + "x-order": 1 + }, + "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 STT check.", + "type": "string", + "x-order": 4 + }, + "service_name": { + "description": "Name of the monitored service on which the check ran.", + "type": "string", + "x-order": 5 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/List": { + "post": { + "description": "Returns a list of available Security Thread Tool checks.", + "tags": [ + "SecurityChecks" + ], + "summary": "List Security Checks", + "operationId": "ListSecurityChecks", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "checks": { + "type": "array", + "items": { + "description": "SecurityCheck contains check name and status.", + "type": "object", + "properties": { + "interval": { + "description": "SecurityCheckInterval represents possible execution interval values for checks.", + "type": "string", + "default": "SECURITY_CHECK_INTERVAL_INVALID", + "enum": [ + "SECURITY_CHECK_INTERVAL_INVALID", + "STANDARD", + "FREQUENT", + "RARE" + ] + }, + "name": { + "description": "Machine-readable name (ID) that is used in expression.", + "type": "string", + "x-order": 0 + }, + "disabled": { + "description": "True if that check is disabled.", + "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 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/ListFailedServices": { + "post": { + "description": "Returns a list of services with failed checks and a summary of check results.", + "tags": [ + "SecurityChecks" + ], + "summary": "List Failed Services", + "operationId": "ListFailedServices", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/Start": { + "post": { + "description": "Executes Security Thread Tool checks and returns when all checks are executed. All available checks will be started if check names aren't specified.", + "tags": [ + "SecurityChecks" + ], + "summary": "Start Security Checks", + "operationId": "StartSecurityChecks", + "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": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/SecurityChecks/ToggleCheckAlert": { + "post": { + "description": "Silence/Unsilence alerts for a specific check result.", + "tags": [ + "SecurityChecks" + ], + "summary": "Toggle Check Alert", + "operationId": "ToggleCheckAlert", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "alert_id": { + "description": "Alert ID of the check result.", + "type": "string", + "x-order": 0 + }, + "silence": { + "description": "Silence the check result if set to true, unsilence otherwise.", + "type": "boolean", + "x-order": 1 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/Service/Remove": { + "post": { + "description": "Removes Service with Agents.", + "tags": [ + "Service" + ], + "summary": "Remove Service", + "operationId": "RemoveServiceMixin2", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "service_type": { + "description": "ServiceType describes supported Service types.", + "type": "string", + "default": "SERVICE_TYPE_INVALID", + "enum": [ + "SERVICE_TYPE_INVALID", + "MYSQL_SERVICE", + "MONGODB_SERVICE", + "POSTGRESQL_SERVICE", + "PROXYSQL_SERVICE", + "HAPROXY_SERVICE", + "EXTERNAL_SERVICE" + ] + }, + "service_id": { + "description": "Service ID or Service Name is required.\nUnique randomly generated instance identifier.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Unique across all Services user-defined name.", + "type": "string", + "x-order": 2 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/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": [ + "Server" + ], + "summary": "Check server readiness", + "operationId": "Readiness", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/version": { + "get": { + "description": "Returns PMM Server versions.", + "tags": [ + "Server" + ], + "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": { + "distribution_method": { + "description": "DistributionMethod defines PMM Server distribution method: Docker image, OVF/OVA, or AMI.", + "type": "string", + "default": "DISTRIBUTION_METHOD_INVALID", + "enum": [ + "DISTRIBUTION_METHOD_INVALID", + "DOCKER", + "OVF", + "AMI", + "AZURE", + "DO" + ] + }, + "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 + } + } + }, + "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 + } + } + }, + "version": { + "description": "PMM Server version.", + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + } + }, + "securityDefinitions": { + "basicAuth": { + "type": "basic" + } + }, + "security": [ + { + "basicAuth": [] + } + ], + "x-readme": { + "samples-languages": [ + "curl", + "go", + "node", + "python" + ] + } +} \ No newline at end of file